From 38cc0b8dd30c003a91918e078493352b2a52998f Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 7 Jan 2015 18:13:03 +0100 Subject: [PATCH] Adjusting SolidityCompiler tests - Adjusting SolidityCompiler tests to take into account the size of the new Function Selector --- SolidityCompiler.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/SolidityCompiler.cpp b/SolidityCompiler.cpp index 385a3e577..ea09678d9 100644 --- a/SolidityCompiler.cpp +++ b/SolidityCompiler.cpp @@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE(smoke_test) "}\n"; bytes code = compileContract(sourceCode); - unsigned boilerplateSize = 40; + unsigned boilerplateSize = 72; bytes expectation({byte(Instruction::JUMPDEST), byte(Instruction::PUSH1), 0x0, // initialize local variable x byte(Instruction::PUSH1), 0x2, @@ -115,9 +115,8 @@ BOOST_AUTO_TEST_CASE(different_argument_numbers) " function g() returns (uint e, uint h) { h = f(1, 2, 3); }\n" "}\n"; bytes code = compileContract(sourceCode); - - unsigned shift = 68; - unsigned boilerplateSize = 81; + unsigned shift = 102; + unsigned boilerplateSize = 115; bytes expectation({byte(Instruction::JUMPDEST), byte(Instruction::PUSH1), 0x0, // initialize return variable d byte(Instruction::DUP3), @@ -166,9 +165,8 @@ BOOST_AUTO_TEST_CASE(ifStatement) " function f() { bool x; if (x) 77; else if (!x) 78; else 79; }" "}\n"; bytes code = compileContract(sourceCode); - - unsigned shift = 27; - unsigned boilerplateSize = 40; + unsigned shift = 59; + unsigned boilerplateSize = 72; bytes expectation({byte(Instruction::JUMPDEST), byte(Instruction::PUSH1), 0x0, byte(Instruction::DUP1), @@ -208,9 +206,8 @@ BOOST_AUTO_TEST_CASE(loops) " function f() { while(true){1;break;2;continue;3;return;4;} }" "}\n"; bytes code = compileContract(sourceCode); - - unsigned shift = 27; - unsigned boilerplateSize = 40; + unsigned shift = 59; + unsigned boilerplateSize = 72; bytes expectation({byte(Instruction::JUMPDEST), byte(Instruction::JUMPDEST), byte(Instruction::PUSH1), 0x1,