diff options
author | LianaHus <liana@ethdev.com> | 2015-09-08 21:26:33 +0800 |
---|---|---|
committer | LianaHus <liana@ethdev.com> | 2015-09-15 17:40:19 +0800 |
commit | 7dbff2489f1f01d78690188bd0966af454999b26 (patch) | |
tree | 18d6ab15f27a6b692c380efa60781009870977b4 /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | ede1f4b153d010cb3d2b4e7182630baa6f241938 (diff) | |
download | dexon-solidity-7dbff2489f1f01d78690188bd0966af454999b26.tar.gz dexon-solidity-7dbff2489f1f01d78690188bd0966af454999b26.tar.zst dexon-solidity-7dbff2489f1f01d78690188bd0966af454999b26.zip |
some fixes in tests
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 53 |
1 files changed, 5 insertions, 48 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 73b24664..1ad57fb9 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -1037,9 +1037,12 @@ BOOST_AUTO_TEST_CASE(array_accessor) )"; compileAndRun(sourceCode); BOOST_CHECK(callContractFunction("data(uint256)", 0) == encodeArgs(8)); + BOOST_CHECK(callContractFunction("data(uint256)", 8) == encodeArgs()); BOOST_CHECK(callContractFunction("dynamicData(uint256)", 2) == encodeArgs(8)); + BOOST_CHECK(callContractFunction("dynamicData(uint256)", 8) == encodeArgs()); BOOST_CHECK(callContractFunction("smallTypeData(uint256)", 1) == encodeArgs(22)); BOOST_CHECK(callContractFunction("smallTypeData(uint256)", 127) == encodeArgs(2)); + BOOST_CHECK(callContractFunction("smallTypeData(uint256)", 128) == encodeArgs()); BOOST_CHECK(callContractFunction("multiple_map(uint256,uint256,uint256)", 2, 1, 2) == encodeArgs(3)); } @@ -1058,7 +1061,9 @@ BOOST_AUTO_TEST_CASE(accessors_mapping_for_array) )"; compileAndRun(sourceCode); BOOST_CHECK(callContractFunction("data(uint256,uint256)", 2, 2) == encodeArgs(8)); + BOOST_CHECK(callContractFunction("data(uint256, 256)", 2, 8) == encodeArgs()); BOOST_CHECK(callContractFunction("dynamicData(uint256,uint256)", 2, 2) == encodeArgs(8)); + BOOST_CHECK(callContractFunction("dynamicData(uint256,uint256)", 2, 8) == encodeArgs()); } BOOST_AUTO_TEST_CASE(multiple_elementary_accessors) @@ -4177,22 +4182,6 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_call_fail) BOOST_CHECK(callContractFunction("test()") == encodeArgs(2)); } -//BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_baund) -//{ -// char const* sourceCode = R"( -// contract A { -// uint public test = 1; -// uint[3] arr; -// function A() -// { -// test = arr[5]; -// ++test; -// } -// } -// )"; -// BOOST_CHECK(compileAndRunWithoutCheck(sourceCode, 0, "A").empty()); -//} - BOOST_AUTO_TEST_CASE(positive_integers_to_signed) { char const* sourceCode = R"( @@ -5273,38 +5262,6 @@ BOOST_AUTO_TEST_CASE(array_out_of_bound_access) compileRequireThrow<CompilerError>(sourceCode); } -//BOOST_AUTO_TEST_CASE(dynamic_array_out_of_bound_access) -//{ -// char const* sourceCode = R"( -// contract c { -// uint[] dataArrayDynamic; -// function set5th() returns (bool) { -// dataArrayDynamic.length = 2; -// dataArrayDynamic[5] = 3; -// return true; -// } -// } -// )"; -// compileRequireThrow<CompilerError>(sourceCode); -//} - -//BOOST_AUTO_TEST_CASE(bytes_out_of_bound_access) -//{ -// char const* sourceCode = R"( -// contract c { -// bytes data; -// function write() returns (uint) { -// data.length = 3; -// data[1] = 0x77; -// data[2] = 0x14; - -// data[8] = 3; -// } -// } -// )"; -// compileRequireThrow<CompilerError>(sourceCode); -//} - BOOST_AUTO_TEST_SUITE_END() } |