Empty storage option for isoltest.

This commit is contained in:
chriseth
2020-10-29 13:55:07 +01:00
parent f42280f5c9
commit 3b8c038647
8 changed files with 101 additions and 3 deletions
@@ -953,6 +953,28 @@ BOOST_AUTO_TEST_CASE(library)
);
}
BOOST_AUTO_TEST_CASE(empty_storage)
{
char const* source = R"(
// storage: empty
)";
auto const calls = parse(source);
BOOST_REQUIRE_EQUAL(calls.size(), 1);
BOOST_CHECK(calls.at(0).kind == FunctionCall::Kind::Storage);
BOOST_CHECK(calls.at(0).expectations.result.front().rawBytes == bytes(1, 0));
}
BOOST_AUTO_TEST_CASE(nonempty_storage)
{
char const* source = R"(
// storage: nonempty
)";
auto const calls = parse(source);
BOOST_REQUIRE_EQUAL(calls.size(), 1);
BOOST_CHECK(calls.at(0).kind == FunctionCall::Kind::Storage);
BOOST_CHECK(calls.at(0).expectations.result.front().rawBytes == bytes(1, 1));
}
BOOST_AUTO_TEST_SUITE_END()
}