test: add an assertion about storing an invalid boolean into the memory

This commit is contained in:
Yoichi Hirai 2016-11-17 12:39:22 +01:00 committed by Alex Beregszaszi
parent 7cbf6a86dd
commit fdc9ef14ad

View File

@ -3715,11 +3715,19 @@ BOOST_AUTO_TEST_CASE(storing_invalid_boolean)
perm = tmp;
return 1;
}
function ret() returns(bool) {
bool tmp;
assembly {
tmp := 5
}
return tmp;
}
}
)";
compileAndRun(sourceCode);
BOOST_CHECK(callContractFunction("set()") == encodeArgs(1));
BOOST_CHECK(callContractFunction("perm()") == encodeArgs(1));
BOOST_CHECK(callContractFunction("ret()") == encodeArgs(1));
}