mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update tests.
This commit is contained in:
parent
29e5cd89be
commit
c50631d4e2
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user