Add tests for the ErrorTag

This commit is contained in:
Alex Beregszaszi 2016-10-20 12:30:10 +01:00
parent 91367234d9
commit bee926bf3f
2 changed files with 20 additions and 0 deletions

View File

@ -177,6 +177,11 @@ BOOST_AUTO_TEST_CASE(imbalanced_stack)
BOOST_CHECK(successAssemble("{ let x := 4 7 add }", false));
}
BOOST_AUTO_TEST_CASE(error_tag)
{
BOOST_CHECK(successAssemble("{ ErrorTag }"));
}
BOOST_AUTO_TEST_SUITE_END()
}

View File

@ -7692,6 +7692,21 @@ BOOST_AUTO_TEST_CASE(packed_storage_overflow)
BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(0x1234), u256(0), u256(0), u256(0xfffe)));
}
BOOST_AUTO_TEST_CASE(inline_assembly_errortag)
{
char const* sourceCode = R"(
contract C {
function f() {
assembly {
jump(ErrorTag)
}
}
}
)";
compileAndRun(sourceCode, 0, "C");
BOOST_CHECK(callContractFunction("f()") == encodeArgs());
}
BOOST_AUTO_TEST_SUITE_END()
}