diff options
author | chriseth <c@ethdev.com> | 2016-07-29 22:57:08 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-08-01 18:17:04 +0800 |
commit | 8b68d476c2b0b29e3d18ee576785c591ce498f5d (patch) | |
tree | 8e80898a10389fd231fff4c4d949832586466eb9 | |
parent | 8c5a56d8648c9722d96638bf6dc1be94c7828cb3 (diff) | |
download | dexon-solidity-8b68d476c2b0b29e3d18ee576785c591ce498f5d.tar.gz dexon-solidity-8b68d476c2b0b29e3d18ee576785c591ce498f5d.tar.zst dexon-solidity-8b68d476c2b0b29e3d18ee576785c591ce498f5d.zip |
Fix optimizer tests.
-rw-r--r-- | test/libsolidity/SolidityOptimizer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index ad573823..67b161b9 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -79,6 +79,8 @@ public: bytes nonOptimizedOutput = callContractFunction(_sig, _arguments...); m_contractAddress = m_optimizedContract; bytes optimizedOutput = callContractFunction(_sig, _arguments...); + BOOST_CHECK_MESSAGE(!optimizedOutput.empty(), "No optimized output for " + _sig); + BOOST_CHECK_MESSAGE(!nonOptimizedOutput.empty(), "No un-optimized output for " + _sig); BOOST_CHECK_MESSAGE(nonOptimizedOutput == optimizedOutput, "Computed values do not match." "\nNon-Optimized: " + toHex(nonOptimizedOutput) + "\nOptimized: " + toHex(optimizedOutput)); @@ -176,7 +178,7 @@ BOOST_AUTO_TEST_CASE(identities) } })"; compileBothVersions(sourceCode); - compareVersions("f(uint256)", u256(0x12334664)); + compareVersions("f(int256)", u256(0x12334664)); } BOOST_AUTO_TEST_CASE(unused_expressions) @@ -230,6 +232,7 @@ BOOST_AUTO_TEST_CASE(array_copy) bytes2[] data1; bytes5[] data2; function f(uint x) returns (uint l, uint y) { + data1.length = msg.data.length; for (uint i = 0; i < msg.data.length; ++i) data1[i] = msg.data[i]; data2 = data1; @@ -241,7 +244,7 @@ BOOST_AUTO_TEST_CASE(array_copy) compileBothVersions(sourceCode); compareVersions("f(uint256)", 0); compareVersions("f(uint256)", 10); - compareVersions("f(uint256)", 36); + compareVersions("f(uint256)", 35); } BOOST_AUTO_TEST_CASE(function_calls) @@ -346,7 +349,7 @@ BOOST_AUTO_TEST_CASE(store_tags_as_unions) } )"; compileBothVersions(sourceCode); - compareVersions("f()", 7, "abc"); + compareVersions("f(uint256,bytes32)", 7, "abc"); m_optimize = true; bytes optimizedBytecode = compileAndRun(sourceCode, 0, "test"); |