diff options
author | chriseth <chris@ethereum.org> | 2018-01-05 00:08:47 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-04-12 19:09:38 +0800 |
commit | 42c4c78390b6330e8bc4558b4be5d580251abcba (patch) | |
tree | cb4fcdee2c40a7623b13ffba16d415129fbe7282 | |
parent | 167ee2fcbb1000e6387142892c4252f8597a4481 (diff) | |
download | dexon-solidity-42c4c78390b6330e8bc4558b4be5d580251abcba.tar.gz dexon-solidity-42c4c78390b6330e8bc4558b4be5d580251abcba.tar.zst dexon-solidity-42c4c78390b6330e8bc4558b4be5d580251abcba.zip |
Adjust tests.
-rw-r--r-- | test/libsolidity/JSONCompiler.cpp | 8 | ||||
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 5 | ||||
-rw-r--r-- | test/libsolidity/StandardCompiler.cpp | 19 |
3 files changed, 19 insertions, 13 deletions
diff --git a/test/libsolidity/JSONCompiler.cpp b/test/libsolidity/JSONCompiler.cpp index cdcc22a6..2b3df3a7 100644 --- a/test/libsolidity/JSONCompiler.cpp +++ b/test/libsolidity/JSONCompiler.cpp @@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(basic_compilation) BOOST_CHECK(contract["bytecode"].isString()); BOOST_CHECK_EQUAL( dev::test::bytecodeSansMetadata(contract["bytecode"].asString()), - "60806040523415600e57600080fd5b603580601b6000396000f3006080604052600080fd00" + "6080604052348015600f57600080fd5b50603580601d6000396000f3006080604052600080fd00" ); BOOST_CHECK(contract["runtimeBytecode"].isString()); BOOST_CHECK_EQUAL( @@ -122,7 +122,7 @@ BOOST_AUTO_TEST_CASE(basic_compilation) BOOST_CHECK(contract["gasEstimates"].isObject()); BOOST_CHECK_EQUAL( dev::jsonCompactPrint(contract["gasEstimates"]), - "{\"creation\":[61,10600],\"external\":{},\"internal\":{}}" + "{\"creation\":[66,10600],\"external\":{},\"internal\":{}}" ); BOOST_CHECK(contract["metadata"].isString()); BOOST_CHECK(dev::test::isValidMetadata(contract["metadata"].asString())); @@ -153,7 +153,7 @@ BOOST_AUTO_TEST_CASE(single_compilation) BOOST_CHECK(contract["bytecode"].isString()); BOOST_CHECK_EQUAL( dev::test::bytecodeSansMetadata(contract["bytecode"].asString()), - "60806040523415600e57600080fd5b603580601b6000396000f3006080604052600080fd00" + "6080604052348015600f57600080fd5b50603580601d6000396000f3006080604052600080fd00" ); BOOST_CHECK(contract["runtimeBytecode"].isString()); BOOST_CHECK_EQUAL( @@ -164,7 +164,7 @@ BOOST_AUTO_TEST_CASE(single_compilation) BOOST_CHECK(contract["gasEstimates"].isObject()); BOOST_CHECK_EQUAL( dev::jsonCompactPrint(contract["gasEstimates"]), - "{\"creation\":[61,10600],\"external\":{},\"internal\":{}}" + "{\"creation\":[66,10600],\"external\":{},\"internal\":{}}" ); BOOST_CHECK(contract["metadata"].isString()); BOOST_CHECK(dev::test::isValidMetadata(contract["metadata"].asString())); diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 2bf71886..5688267a 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -6009,7 +6009,8 @@ BOOST_AUTO_TEST_CASE(bare_others) { CHECK_WARNING("contract C { function f() pure public { selfdestruct; } }", "Statement has no effect."); CHECK_WARNING("contract C { function f() pure public { assert; } }", "Statement has no effect."); - CHECK_WARNING("contract C { function f() pure public { require; } }", "Statement has no effect."); + // This is different because it does have overloads. + CHECK_ERROR("contract C { function f() pure public { require; } }", TypeError, "No matching declaration found after variable lookup."); CHECK_WARNING("contract C { function f() pure public { suicide; } }", "Statement has no effect."); } @@ -6508,7 +6509,7 @@ BOOST_AUTO_TEST_CASE(does_not_error_transfer_regular_function) CHECK_SUCCESS_NO_WARNINGS(text); } -BOOST_AUTO_TEST_CASE(returndatacopy_as_variable) +BOOST_AUTO_TEST_CASE(returndatasize_as_variable) { char const* text = R"( contract c { function f() public { uint returndatasize; assembly { returndatasize }}} diff --git a/test/libsolidity/StandardCompiler.cpp b/test/libsolidity/StandardCompiler.cpp index b285a2a0..74bf01b2 100644 --- a/test/libsolidity/StandardCompiler.cpp +++ b/test/libsolidity/StandardCompiler.cpp @@ -261,19 +261,24 @@ BOOST_AUTO_TEST_CASE(basic_compilation) BOOST_CHECK(contract["evm"]["bytecode"]["object"].isString()); BOOST_CHECK_EQUAL( dev::test::bytecodeSansMetadata(contract["evm"]["bytecode"]["object"].asString()), - "60806040523415600e57600080fd5b603580601b6000396000f3006080604052600080fd00" + "6080604052348015600f57600080fd5b50603580601d6000396000f3006080604052600080fd00" ); BOOST_CHECK(contract["evm"]["assembly"].isString()); BOOST_CHECK(contract["evm"]["assembly"].asString().find( - " /* \"fileA\":0:14 contract A { } */\n mstore(0x40, 0x80)\n jumpi(tag_1, iszero(callvalue))\n" - " 0x0\n dup1\n revert\ntag_1:\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x0\n codecopy\n 0x0\n" - " return\nstop\n\nsub_0: assembly {\n /* \"fileA\":0:14 contract A { } */\n" - " mstore(0x40, 0x80)\n 0x0\n dup1\n revert\n\n" - " auxdata: 0xa165627a7a7230582") == 0); + " /* \"fileA\":0:14 contract A { } */\n mstore(0x40, 0x80)\n " + "callvalue\n /* \"--CODEGEN--\":8:17 */\n dup1\n " + "/* \"--CODEGEN--\":5:7 */\n iszero\n tag_1\n jumpi\n " + "/* \"--CODEGEN--\":30:31 */\n 0x0\n /* \"--CODEGEN--\":27:28 */\n " + "dup1\n /* \"--CODEGEN--\":20:32 */\n revert\n /* \"--CODEGEN--\":5:7 */\n" + "tag_1:\n /* \"fileA\":0:14 contract A { } */\n pop\n dataSize(sub_0)\n dup1\n " + "dataOffset(sub_0)\n 0x0\n codecopy\n 0x0\n return\nstop\n\nsub_0: assembly {\n " + "/* \"fileA\":0:14 contract A { } */\n mstore(0x40, 0x80)\n 0x0\n " + "dup1\n revert\n\n auxdata: 0xa165627a7a72305820" + ) == 0); BOOST_CHECK(contract["evm"]["gasEstimates"].isObject()); BOOST_CHECK_EQUAL( dev::jsonCompactPrint(contract["evm"]["gasEstimates"]), - "{\"creation\":{\"codeDepositCost\":\"10600\",\"executionCost\":\"61\",\"totalCost\":\"10661\"}}" + "{\"creation\":{\"codeDepositCost\":\"10600\",\"executionCost\":\"66\",\"totalCost\":\"10666\"}}" ); BOOST_CHECK(contract["metadata"].isString()); BOOST_CHECK(dev::test::isValidMetadata(contract["metadata"].asString())); |