some fixes in tests

This commit is contained in:
LianaHus 2015-09-08 15:26:33 +02:00
parent ede1f4b153
commit 7dbff2489f

View File

@ -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()
}