aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-24 02:29:42 +0800
committerchriseth <chris@ethereum.org>2018-03-02 00:19:35 +0800
commit1e26011d2cdb11b2df089fa97e2ab15ac329a45c (patch)
tree4023bccc96a8fe78089be527217f2f9007076ea6
parent05cc5f22b204a0c389e1de4feaa44d33492dd053 (diff)
downloaddexon-solidity-1e26011d2cdb11b2df089fa97e2ab15ac329a45c.tar.gz
dexon-solidity-1e26011d2cdb11b2df089fa97e2ab15ac329a45c.tar.zst
dexon-solidity-1e26011d2cdb11b2df089fa97e2ab15ac329a45c.zip
Returndatasize and staticcall test fixes.
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp15
-rw-r--r--test/libsolidity/ViewPureChecker.cpp5
2 files changed, 10 insertions, 10 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index a5ed4402..f92cd47c 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -3352,11 +3352,6 @@ BOOST_AUTO_TEST_CASE(dynamic_return_types_not_possible)
}
}
)";
- m_compiler.setEVMVersion(EVMVersion{});
- CHECK_WARNING(sourceCode, "Use of the \"var\" keyword is deprecated");
- m_compiler.setEVMVersion(*EVMVersion::fromString("byzantium"));
- CHECK_WARNING(sourceCode, "Use of the \"var\" keyword is deprecated");
- m_compiler.setEVMVersion(*EVMVersion::fromString("homestead"));
CHECK_ERROR(sourceCode, TypeError, "Explicit type conversion not allowed from \"inaccessible dynamic type\" to \"bytes storage pointer\".");
}
@@ -7088,11 +7083,13 @@ BOOST_AUTO_TEST_CASE(returndatacopy_as_variable)
char const* text = R"(
contract c { function f() public { uint returndatasize; assembly { returndatasize }}}
)";
- CHECK_ALLOW_MULTI(text, (std::vector<std::pair<Error::Type, std::string>>{
+ vector<pair<Error::Type, std::string>> expectations(vector<pair<Error::Type, std::string>>{
{Error::Type::Warning, "Variable is shadowed in inline assembly by an instruction of the same name"},
- {Error::Type::DeclarationError, "Unbalanced stack"},
- {Error::Type::Warning, "only available after the Metropolis"}
- }));
+ {Error::Type::DeclarationError, "Unbalanced stack"}
+ });
+ if (dev::test::Options::get().evmVersion() == EVMVersion::homestead())
+ expectations.emplace_back(make_pair(Error::Type::Warning, std::string("\"returndatasize\" instruction is only available for Byzantium-compatible")));
+ CHECK_ALLOW_MULTI(text, expectations);
}
BOOST_AUTO_TEST_CASE(create2_as_variable)
diff --git a/test/libsolidity/ViewPureChecker.cpp b/test/libsolidity/ViewPureChecker.cpp
index f6b2c62e..35a0c7e5 100644
--- a/test/libsolidity/ViewPureChecker.cpp
+++ b/test/libsolidity/ViewPureChecker.cpp
@@ -425,7 +425,10 @@ BOOST_AUTO_TEST_CASE(assembly_staticcall)
}
}
)";
- CHECK_WARNING(text, "only available after the Metropolis");
+ if (dev::test::Options::get().evmVersion() == EVMVersion::homestead())
+ CHECK_WARNING(text, "\"staticcall\" instruction is only available for Byzantium-compatible");
+ else
+ CHECK_SUCCESS_NO_WARNINGS(text);
}
BOOST_AUTO_TEST_CASE(assembly_jump)