Merge branch 'develop' into discoveryEndpoints

This commit is contained in:
subtly 2015-04-15 22:51:43 -04:00
commit 5999c04eb5
2 changed files with 20 additions and 1 deletions

View File

@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE(smoke_test)
{
char const* text = "contract test {\n"
" uint256 stateVariable1;\n"
" function fun(uint256 arg1) { var x; uint256 y; }"
" function fun(uint256 arg1) { uint256 y; }"
"}\n";
ETH_TEST_CHECK_NO_THROW(parseTextAndResolveNames(text), "Parsing and Name Resolving Failed");
}
@ -1623,6 +1623,16 @@ BOOST_AUTO_TEST_CASE(bytes0_array)
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
}
BOOST_AUTO_TEST_CASE(uninitialized_var)
{
char const* sourceCode = R"(
contract C {
function f() returns (uint) { var x; return 2; }
}
)";
BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError);
}
BOOST_AUTO_TEST_SUITE_END()
}

View File

@ -841,6 +841,15 @@ BOOST_AUTO_TEST_CASE(constant_is_keyword)
BOOST_CHECK_THROW(parseText(text), ParserError);
}
BOOST_AUTO_TEST_CASE(var_array)
{
char const* text = R"(
contract Foo {
function f() { var[] a; }
})";
BOOST_CHECK_THROW(parseText(text), ParserError);
}
BOOST_AUTO_TEST_SUITE_END()
}