Merge remote-tracking branch 'upstream/develop' into memTests

This commit is contained in:
CJentzsch 2015-02-23 14:32:17 +01:00
commit c5b2733d1e
7 changed files with 35 additions and 14 deletions

View File

@ -4,6 +4,10 @@ aux_source_directory(. SRC_LIST)
list(REMOVE_ITEM SRC_LIST "./createRandomTest.cpp")
list(REMOVE_ITEM SRC_LIST "./checkRandomTest.cpp")
if (NOT JSONRPC)
list(REMOVE_ITEM SRC_LIST "./AccountHolder.cpp")
endif()
include_directories(BEFORE ${JSONCPP_INCLUDE_DIRS})
include_directories(BEFORE ..)
include_directories(${Boost_INCLUDE_DIRS})

View File

@ -1669,7 +1669,6 @@ BOOST_AUTO_TEST_CASE(value_insane)
function test() { h = new helper(); }
function sendAmount(uint amount) returns (uint256 bal) {
var x1 = h.getBalance.value;
uint someStackElement = 20;
var x2 = x1(amount).gas;
var x3 = x2(1000).value;
return x3(amount + 3)();// overwrite value

View File

@ -470,7 +470,7 @@ BOOST_AUTO_TEST_CASE(illegal_override_indirect)
BOOST_AUTO_TEST_CASE(illegal_override_visibility)
{
char const* text = R"(
contract B { function f() inheritable {} }
contract B { function f() internal {} }
contract C is B { function f() public {} }
)";
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
@ -706,7 +706,7 @@ BOOST_AUTO_TEST_CASE(private_state_variable)
" uint64(2);\n"
" }\n"
"uint256 private foo;\n"
"uint256 inheritable bar;\n"
"uint256 internal bar;\n"
"}\n";
ASTPointer<SourceUnit> source;
@ -717,7 +717,7 @@ BOOST_AUTO_TEST_CASE(private_state_variable)
function = retrieveFunctionBySignature(contract, "foo()");
BOOST_CHECK_MESSAGE(function == nullptr, "Accessor function of a private variable should not exist");
function = retrieveFunctionBySignature(contract, "bar()");
BOOST_CHECK_MESSAGE(function == nullptr, "Accessor function of an inheritable variable should not exist");
BOOST_CHECK_MESSAGE(function == nullptr, "Accessor function of an internal variable should not exist");
}
BOOST_AUTO_TEST_CASE(fallback_function)
@ -832,11 +832,11 @@ BOOST_AUTO_TEST_CASE(access_to_default_function_visibility)
BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
}
BOOST_AUTO_TEST_CASE(access_to_inheritable_function)
BOOST_AUTO_TEST_CASE(access_to_internal_function)
{
char const* text = R"(
contract c {
function f() inheritable {}
function f() internal {}
}
contract d {
function g() { c(0).f(); }
@ -856,7 +856,7 @@ BOOST_AUTO_TEST_CASE(access_to_default_state_variable_visibility)
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
}
BOOST_AUTO_TEST_CASE(access_to_inheritable_state_variable)
BOOST_AUTO_TEST_CASE(access_to_internal_state_variable)
{
char const* text = R"(
contract c {

View File

@ -651,13 +651,13 @@ BOOST_AUTO_TEST_CASE(visibility_specifiers)
char const* text = R"(
contract c {
uint private a;
uint inheritable b;
uint internal b;
uint public c;
uint d;
function f() {}
function f_priv() private {}
function f_public() public {}
function f_inheritable() inheritable {}
function f_internal() internal {}
})";
BOOST_CHECK_NO_THROW(parseText(text));
}
@ -666,7 +666,7 @@ BOOST_AUTO_TEST_CASE(multiple_visibility_specifiers)
{
char const* text = R"(
contract c {
uint private inheritable a;
uint private internal a;
})";
BOOST_CHECK_THROW(parseText(text), ParserError);
}

View File

@ -475,11 +475,11 @@ void executeTests(const string& _name, const string& _testPathAppendix, std::fun
}
catch (Exception const& _e)
{
BOOST_ERROR("Failed test with Exception: " << diagnostic_information(_e));
BOOST_ERROR("Failed filling test with Exception: " << diagnostic_information(_e));
}
catch (std::exception const& _e)
{
BOOST_ERROR("Failed test with Exception: " << _e.what());
BOOST_ERROR("Failed filling test with Exception: " << _e.what());
}
break;
}

View File

@ -51,7 +51,7 @@ void doTransactionTests(json_spirit::mValue& _v, bool _fillin)
catch(...)
{
BOOST_CHECK_MESSAGE(o.count("transaction") == 0, "A transaction object should not be defined because the RLP is invalid!");
return;
continue;
}
BOOST_REQUIRE(o.count("transaction") > 0);
@ -108,6 +108,11 @@ BOOST_AUTO_TEST_CASE(TransactionTest)
dev::test::executeTests("ttTransactionTest", "/TransactionTests", dev::test::doTransactionTests);
}
BOOST_AUTO_TEST_CASE(ttWrongRLPTransaction)
{
dev::test::executeTests("ttWrongRLPTransaction", "/TransactionTests", dev::test::doTransactionTests);
}
BOOST_AUTO_TEST_CASE(tt10mbDataField)
{
dev::test::executeTests("tt10mbDataField", "/TransactionTests", dev::test::doTransactionTests);

View File

@ -294,7 +294,7 @@
"gasPrice" : "1",
"nonce" : "0xffdc5",
"to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"value" : "0xfffdc12c",
"value" : "4294820140",
"v" : "28",
"r" : "0x98ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a",
"s" : "0x8887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3"
@ -314,5 +314,18 @@
"r" : "0x98ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a",
"s" : "0x8887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3"
}
},
"unpadedRValue": {
"transaction": {
"nonce": "13",
"gasPrice": "0x09184e72a000",
"gasLimit": "0x2710",
"to": "7c47ef93268a311f4cad0c750724299e9b72c268",
"data": "0x379607f50000000000000000000000000000000000000000000000000000000000000005",
"r": "0x006ab6dda9f4df56ea45583af36660329147f1753f3724ea5eb9ed83e812ca77",
"s": "0x495701e230667832c8999e884e366a61028633ecf951e8cd66d119f381ae5718",
"v": "28",
"value": ""
}
}
}