Fix tests.

This commit is contained in:
chriseth 2016-08-16 19:03:00 +02:00
parent 6df6728165
commit 15b85e2ea8
2 changed files with 12 additions and 12 deletions

View File

@ -2410,7 +2410,7 @@ BOOST_AUTO_TEST_CASE(function_modifier_overriding)
modifier mod { _ } modifier mod { _ }
} }
contract C is A { contract C is A {
modifier mod { } modifier mod { if (false) _ }
} }
)"; )";
compileAndRun(sourceCode); compileAndRun(sourceCode);
@ -2427,7 +2427,7 @@ BOOST_AUTO_TEST_CASE(function_modifier_calling_functions_in_creation_context)
function f2() { data |= 0x20; } function f2() { data |= 0x20; }
function f3() { } function f3() { }
modifier mod1 { f2(); _ } modifier mod1 { f2(); _ }
modifier mod2 { f3(); } modifier mod2 { f3(); if (false) _ }
function getData() returns (uint r) { return data; } function getData() returns (uint r) { return data; }
} }
contract C is A { contract C is A {

View File

@ -901,8 +901,8 @@ BOOST_AUTO_TEST_CASE(function_modifier_invocation_local_variables)
BOOST_AUTO_TEST_CASE(legal_modifier_override) BOOST_AUTO_TEST_CASE(legal_modifier_override)
{ {
char const* text = R"( char const* text = R"(
contract A { modifier mod(uint a) {} } contract A { modifier mod(uint a) { _ } }
contract B is A { modifier mod(uint a) {} } contract B is A { modifier mod(uint a) { _ } }
)"; )";
BOOST_CHECK(success(text)); BOOST_CHECK(success(text));
} }
@ -910,8 +910,8 @@ BOOST_AUTO_TEST_CASE(legal_modifier_override)
BOOST_AUTO_TEST_CASE(illegal_modifier_override) BOOST_AUTO_TEST_CASE(illegal_modifier_override)
{ {
char const* text = R"( char const* text = R"(
contract A { modifier mod(uint a) {} } contract A { modifier mod(uint a) { _ } }
contract B is A { modifier mod(uint8 a) {} } contract B is A { modifier mod(uint8 a) { _ } }
)"; )";
BOOST_CHECK(expectError(text) == Error::Type::TypeError); BOOST_CHECK(expectError(text) == Error::Type::TypeError);
} }
@ -919,8 +919,8 @@ BOOST_AUTO_TEST_CASE(illegal_modifier_override)
BOOST_AUTO_TEST_CASE(modifier_overrides_function) BOOST_AUTO_TEST_CASE(modifier_overrides_function)
{ {
char const* text = R"( char const* text = R"(
contract A { modifier mod(uint a) {} } contract A { modifier mod(uint a) { _ } }
contract B is A { function mod(uint a) {} } contract B is A { function mod(uint a) { } }
)"; )";
BOOST_CHECK(expectError(text) == Error::Type::TypeError); BOOST_CHECK(expectError(text) == Error::Type::TypeError);
} }
@ -928,8 +928,8 @@ BOOST_AUTO_TEST_CASE(modifier_overrides_function)
BOOST_AUTO_TEST_CASE(function_overrides_modifier) BOOST_AUTO_TEST_CASE(function_overrides_modifier)
{ {
char const* text = R"( char const* text = R"(
contract A { function mod(uint a) {} } contract A { function mod(uint a) { } }
contract B is A { modifier mod(uint a) {} } contract B is A { modifier mod(uint a) { _ } }
)"; )";
BOOST_CHECK(expectError(text) == Error::Type::TypeError); BOOST_CHECK(expectError(text) == Error::Type::TypeError);
} }
@ -938,8 +938,8 @@ BOOST_AUTO_TEST_CASE(modifier_returns_value)
{ {
char const* text = R"( char const* text = R"(
contract A { contract A {
function f(uint a) mod(2) returns (uint r) {} function f(uint a) mod(2) returns (uint r) { }
modifier mod(uint a) { return 7; } modifier mod(uint a) { _ return 7; }
} }
)"; )";
BOOST_CHECK(expectError(text) == Error::Type::TypeError); BOOST_CHECK(expectError(text) == Error::Type::TypeError);