Update tests.

This commit is contained in:
chriseth 2020-02-17 12:56:44 +01:00
parent 29e5cd89be
commit c50631d4e2
3 changed files with 13 additions and 6 deletions

View File

@ -732,9 +732,9 @@ BOOST_AUTO_TEST_CASE(shift_constantinople_warning)
{
if (solidity::test::CommonOptions::get().evmVersion().hasBitwiseShifting())
return;
CHECK_PARSE_WARNING("{ pop(shl(10, 32)) }", TypeError, "The \"shl\" instruction is only available for Constantinople-compatible VMs");
CHECK_PARSE_WARNING("{ pop(shr(10, 32)) }", TypeError, "The \"shr\" instruction is only available for Constantinople-compatible VMs");
CHECK_PARSE_WARNING("{ pop(sar(10, 32)) }", TypeError, "The \"sar\" instruction is only available for Constantinople-compatible VMs");
CHECK_PARSE_WARNING("{ shl(10, 32) }", TypeError, "The \"shl\" instruction is only available for Constantinople-compatible VMs");
CHECK_PARSE_WARNING("{ shr(10, 32) }", TypeError, "The \"shr\" instruction is only available for Constantinople-compatible VMs");
CHECK_PARSE_WARNING("{ sar(10, 32) }", TypeError, "The \"sar\" instruction is only available for Constantinople-compatible VMs");
}
BOOST_AUTO_TEST_CASE(jump_error)

View File

@ -387,7 +387,10 @@ BOOST_AUTO_TEST_CASE(returndatasize_as_variable)
{Error::Type::Warning, "Variable is shadowed in inline assembly by an instruction of the same name"}
});
if (!solidity::test::CommonOptions::get().evmVersion().supportsReturndata())
{
expectations.emplace_back(make_pair(Error::Type::TypeError, std::string("\"returndatasize\" instruction is only available for Byzantium-compatible VMs")));
expectations.emplace_back(make_pair(Error::Type::TypeError, std::string("Expected expression to evaluate to one value, but got 0 values instead.")));
}
CHECK_ALLOW_MULTI(text, expectations);
}
@ -402,7 +405,10 @@ BOOST_AUTO_TEST_CASE(create2_as_variable)
{Error::Type::Warning, "Variable is shadowed in inline assembly by an instruction of the same name"}
});
if (!solidity::test::CommonOptions::get().evmVersion().hasCreate2())
{
expectations.emplace_back(make_pair(Error::Type::TypeError, std::string("\"create2\" instruction is only available for Constantinople-compatible VMs")));
expectations.emplace_back(make_pair(Error::Type::TypeError, std::string("Expected expression to evaluate to one value, but got 0 values instead.")));
}
CHECK_ALLOW_MULTI(text, expectations);
}
@ -417,7 +423,10 @@ BOOST_AUTO_TEST_CASE(extcodehash_as_variable)
{Error::Type::Warning, "Variable is shadowed in inline assembly by an instruction of the same name"}
});
if (!solidity::test::CommonOptions::get().evmVersion().hasExtCodeHash())
{
expectations.emplace_back(make_pair(Error::Type::TypeError, std::string("\"extcodehash\" instruction is only available for Constantinople-compatible VMs")));
expectations.emplace_back(make_pair(Error::Type::TypeError, std::string("Expected expression to evaluate to one value, but got 0 values instead.")));
}
CHECK_ALLOW_MULTI(text, expectations);
}

View File

@ -121,9 +121,7 @@ BOOST_AUTO_TEST_CASE(assembly_staticcall)
}
}
)";
if (!solidity::test::CommonOptions::get().evmVersion().hasStaticCall())
CHECK_ERROR(text, TypeError, "\"staticcall\" instruction is only available for Byzantium-compatible");
else
if (solidity::test::CommonOptions::get().evmVersion().hasStaticCall())
CHECK_SUCCESS_NO_WARNINGS(text);
}