diff options
author | bitshift <bitshift@posteo.org> | 2018-03-07 17:48:10 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-03-27 10:30:03 +0800 |
commit | 2c56e530467c088c5096d95422313ca211786eca (patch) | |
tree | 89dfb9711bad71fc6dbdec2a4641ba7967d44dc4 /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | bddfa47e770d27005bd6604a24033cf2f632b9ee (diff) | |
download | dexon-solidity-2c56e530467c088c5096d95422313ca211786eca.tar.gz dexon-solidity-2c56e530467c088c5096d95422313ca211786eca.tar.zst dexon-solidity-2c56e530467c088c5096d95422313ca211786eca.zip |
Changes deprecation and adjusts tests.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 43d390f5..a866e46c 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -1805,33 +1805,16 @@ BOOST_AUTO_TEST_CASE(uncalled_blockhash) BOOST_CHECK(result[0] != 0 || result[1] != 0 || result[2] != 0); } -BOOST_AUTO_TEST_CASE(blockhash_global_level) +BOOST_AUTO_TEST_CASE(blockhash_shadow_resolution) { - char const* sourceCode = R"( - contract Test { - function a() public returns (bytes32) { - return blockhash(0); - } - } - )"; - compileAndRun(sourceCode); - BOOST_CHECK(!callContractFunction("a()").empty()); -} - -BOOST_AUTO_TEST_CASE(blockhash_shadow) -{ - char const* sourceCode = R"( - contract Test { - function blockhash(uint256 blockNumber) public returns (bytes32) { - return "abc"; - } - function f() returns (bytes32) { - return blockhash(3); - } + char const* code = R"( + contract C { + function blockhash(uint256 blockNumber) public returns(bytes32) { bytes32 x; return x; } + function f() public returns(bytes32) { return blockhash(3); } } )"; - compileAndRun(sourceCode); - BOOST_REQUIRE(callContractFunction("f()") != encodeArgs("abc")); + compileAndRun(code, 0, "C"); + ABI_CHECK(callContractFunction("f()"), encodeArgs(0)); } BOOST_AUTO_TEST_CASE(log0) |