aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-09-20 17:52:41 +0800
committerchriseth <chris@ethereum.org>2017-09-22 22:17:28 +0800
commita844bbda48564d65033522a64cef30bff5dea973 (patch)
tree008494a0618051e4d71a2e28b94e436dc34ece6a /test/libsolidity
parentab8ce58a3e522cfe8d0a36132e5e0b305d4ca052 (diff)
downloaddexon-solidity-a844bbda48564d65033522a64cef30bff5dea973.tar.gz
dexon-solidity-a844bbda48564d65033522a64cef30bff5dea973.tar.zst
dexon-solidity-a844bbda48564d65033522a64cef30bff5dea973.zip
Cleanup test helper macros.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/GasMeter.cpp2
-rw-r--r--test/libsolidity/Metadata.cpp8
-rw-r--r--test/libsolidity/SolidityABIJSON.cpp2
-rw-r--r--test/libsolidity/SolidityExpressionCompiler.cpp2
-rw-r--r--test/libsolidity/SolidityNatspecJSON.cpp2
-rw-r--r--test/libsolidity/SolidityParser.cpp22
6 files changed, 19 insertions, 19 deletions
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp
index df9afaae..b759678f 100644
--- a/test/libsolidity/GasMeter.cpp
+++ b/test/libsolidity/GasMeter.cpp
@@ -50,7 +50,7 @@ public:
m_compiler.reset(false);
m_compiler.addSource("", "pragma solidity >=0.0;\n" + _sourceCode);
m_compiler.setOptimiserSettings(dev::test::Options::get().optimize);
- ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(), "Compiling contract failed");
+ BOOST_REQUIRE_MESSAGE(m_compiler.compile(), "Compiling contract failed");
AssemblyItems const* items = m_compiler.runtimeAssemblyItems("");
ASTNode const& sourceUnit = m_compiler.ast();
diff --git a/test/libsolidity/Metadata.cpp b/test/libsolidity/Metadata.cpp
index c46e3160..efe8faff 100644
--- a/test/libsolidity/Metadata.cpp
+++ b/test/libsolidity/Metadata.cpp
@@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE(metadata_stamp)
CompilerStack compilerStack;
compilerStack.addSource("", std::string(sourceCode));
compilerStack.setOptimiserSettings(dev::test::Options::get().optimize);
- ETH_TEST_REQUIRE_NO_THROW(compilerStack.compile(), "Compiling contract failed");
+ BOOST_REQUIRE_MESSAGE(compilerStack.compile(), "Compiling contract failed");
bytes const& bytecode = compilerStack.runtimeObject("test").bytecode;
std::string const& metadata = compilerStack.metadata("test");
BOOST_CHECK(dev::test::isValidMetadata(metadata));
@@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE(metadata_stamp_experimental)
CompilerStack compilerStack;
compilerStack.addSource("", std::string(sourceCode));
compilerStack.setOptimiserSettings(dev::test::Options::get().optimize);
- ETH_TEST_REQUIRE_NO_THROW(compilerStack.compile(), "Compiling contract failed");
+ BOOST_REQUIRE_MESSAGE(compilerStack.compile(), "Compiling contract failed");
bytes const& bytecode = compilerStack.runtimeObject("test").bytecode;
std::string const& metadata = compilerStack.metadata("test");
BOOST_CHECK(dev::test::isValidMetadata(metadata));
@@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE(metadata_relevant_sources)
)";
compilerStack.addSource("B", std::string(sourceCode));
compilerStack.setOptimiserSettings(dev::test::Options::get().optimize);
- ETH_TEST_REQUIRE_NO_THROW(compilerStack.compile(), "Compiling contract failed");
+ BOOST_REQUIRE_MESSAGE(compilerStack.compile(), "Compiling contract failed");
std::string const& serialisedMetadata = compilerStack.metadata("A");
BOOST_CHECK(dev::test::isValidMetadata(serialisedMetadata));
@@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE(metadata_relevant_sources_imports)
)";
compilerStack.addSource("C", std::string(sourceCode));
compilerStack.setOptimiserSettings(dev::test::Options::get().optimize);
- ETH_TEST_REQUIRE_NO_THROW(compilerStack.compile(), "Compiling contract failed");
+ BOOST_REQUIRE_MESSAGE(compilerStack.compile(), "Compiling contract failed");
std::string const& serialisedMetadata = compilerStack.metadata("C");
BOOST_CHECK(dev::test::isValidMetadata(serialisedMetadata));
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp
index e5d9e99c..42f7525f 100644
--- a/test/libsolidity/SolidityABIJSON.cpp
+++ b/test/libsolidity/SolidityABIJSON.cpp
@@ -44,7 +44,7 @@ public:
{
m_compilerStack.reset(false);
m_compilerStack.addSource("", "pragma solidity >=0.0;\n" + _code);
- ETH_TEST_REQUIRE_NO_THROW(m_compilerStack.parseAndAnalyze(), "Parsing contract failed");
+ BOOST_REQUIRE_MESSAGE(m_compilerStack.parseAndAnalyze(), "Parsing contract failed");
Json::Value generatedInterface = m_compilerStack.contractABI("");
Json::Value expectedInterface;
diff --git a/test/libsolidity/SolidityExpressionCompiler.cpp b/test/libsolidity/SolidityExpressionCompiler.cpp
index 58efa0a2..67747386 100644
--- a/test/libsolidity/SolidityExpressionCompiler.cpp
+++ b/test/libsolidity/SolidityExpressionCompiler.cpp
@@ -125,7 +125,7 @@ bytes compileFirstExpression(
for (ASTPointer<ASTNode> const& node: sourceUnit->nodes())
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
{
- ETH_TEST_REQUIRE_NO_THROW(resolver.resolveNamesAndTypes(*contract), "Resolving names failed");
+ BOOST_REQUIRE_MESSAGE(resolver.resolveNamesAndTypes(*contract), "Resolving names failed");
inheritanceHierarchy = vector<ContractDefinition const*>(1, contract);
}
for (ASTPointer<ASTNode> const& node: sourceUnit->nodes())
diff --git a/test/libsolidity/SolidityNatspecJSON.cpp b/test/libsolidity/SolidityNatspecJSON.cpp
index 149221d5..d83773bc 100644
--- a/test/libsolidity/SolidityNatspecJSON.cpp
+++ b/test/libsolidity/SolidityNatspecJSON.cpp
@@ -47,7 +47,7 @@ public:
{
m_compilerStack.reset(false);
m_compilerStack.addSource("", "pragma solidity >=0.0;\n" + _code);
- ETH_TEST_REQUIRE_NO_THROW(m_compilerStack.parseAndAnalyze(), "Parsing contract failed");
+ BOOST_REQUIRE_MESSAGE(m_compilerStack.parseAndAnalyze(), "Parsing contract failed");
Json::Value generatedDocumentation;
if (_userDocumentation)
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp
index 60ca03c9..a8698d13 100644
--- a/test/libsolidity/SolidityParser.cpp
+++ b/test/libsolidity/SolidityParser.cpp
@@ -250,7 +250,7 @@ BOOST_AUTO_TEST_CASE(function_natspec_documentation)
FunctionDefinition const* function = nullptr;
auto functions = contract->definedFunctions();
- ETH_TEST_REQUIRE_NO_THROW(function = functions.at(0), "Failed to retrieve function");
+ BOOST_REQUIRE_MESSAGE(function = functions.at(0), "Failed to retrieve function");
checkFunctionNatspec(function, "This is a test function");
}
@@ -268,7 +268,7 @@ BOOST_AUTO_TEST_CASE(function_normal_comments)
ErrorList errors;
ASTPointer<ContractDefinition> contract = parseText(text, errors);
auto functions = contract->definedFunctions();
- ETH_TEST_REQUIRE_NO_THROW(function = functions.at(0), "Failed to retrieve function");
+ BOOST_REQUIRE_MESSAGE(function = functions.at(0), "Failed to retrieve function");
BOOST_CHECK_MESSAGE(function->documentation() == nullptr,
"Should not have gotten a Natspecc comment for this function");
}
@@ -294,17 +294,17 @@ BOOST_AUTO_TEST_CASE(multiple_functions_natspec_documentation)
ASTPointer<ContractDefinition> contract = parseText(text, errors);
auto functions = contract->definedFunctions();
- ETH_TEST_REQUIRE_NO_THROW(function = functions.at(0), "Failed to retrieve function");
+ BOOST_REQUIRE_MESSAGE(function = functions.at(0), "Failed to retrieve function");
checkFunctionNatspec(function, "This is test function 1");
- ETH_TEST_REQUIRE_NO_THROW(function = functions.at(1), "Failed to retrieve function");
+ BOOST_REQUIRE_MESSAGE(function = functions.at(1), "Failed to retrieve function");
checkFunctionNatspec(function, "This is test function 2");
- ETH_TEST_REQUIRE_NO_THROW(function = functions.at(2), "Failed to retrieve function");
+ BOOST_REQUIRE_MESSAGE(function = functions.at(2), "Failed to retrieve function");
BOOST_CHECK_MESSAGE(function->documentation() == nullptr,
"Should not have gotten natspec comment for functionName3()");
- ETH_TEST_REQUIRE_NO_THROW(function = functions.at(3), "Failed to retrieve function");
+ BOOST_REQUIRE_MESSAGE(function = functions.at(3), "Failed to retrieve function");
checkFunctionNatspec(function, "This is test function 4");
}
@@ -323,7 +323,7 @@ BOOST_AUTO_TEST_CASE(multiline_function_documentation)
ErrorList errors;
ASTPointer<ContractDefinition> contract = parseText(text, errors);
auto functions = contract->definedFunctions();
- ETH_TEST_REQUIRE_NO_THROW(function = functions.at(0), "Failed to retrieve function");
+ BOOST_REQUIRE_MESSAGE(function = functions.at(0), "Failed to retrieve function");
checkFunctionNatspec(function, "This is a test function\n"
" and it has 2 lines");
}
@@ -351,10 +351,10 @@ BOOST_AUTO_TEST_CASE(natspec_comment_in_function_body)
ASTPointer<ContractDefinition> contract = parseText(text, errors);
auto functions = contract->definedFunctions();
- ETH_TEST_REQUIRE_NO_THROW(function = functions.at(0), "Failed to retrieve function");
+ BOOST_REQUIRE_MESSAGE(function = functions.at(0), "Failed to retrieve function");
checkFunctionNatspec(function, "fun1 description");
- ETH_TEST_REQUIRE_NO_THROW(function = functions.at(1), "Failed to retrieve function");
+ BOOST_REQUIRE_MESSAGE(function = functions.at(1), "Failed to retrieve function");
checkFunctionNatspec(function, "This is a test function\n"
" and it has 2 lines");
}
@@ -380,7 +380,7 @@ BOOST_AUTO_TEST_CASE(natspec_docstring_between_keyword_and_signature)
ASTPointer<ContractDefinition> contract = parseText(text, errors);
auto functions = contract->definedFunctions();
- ETH_TEST_REQUIRE_NO_THROW(function = functions.at(0), "Failed to retrieve function");
+ BOOST_REQUIRE_MESSAGE(function = functions.at(0), "Failed to retrieve function");
BOOST_CHECK_MESSAGE(!function->documentation(),
"Shouldn't get natspec docstring for this function");
}
@@ -406,7 +406,7 @@ BOOST_AUTO_TEST_CASE(natspec_docstring_after_signature)
ASTPointer<ContractDefinition> contract = parseText(text, errors);
auto functions = contract->definedFunctions();
- ETH_TEST_REQUIRE_NO_THROW(function = functions.at(0), "Failed to retrieve function");
+ BOOST_REQUIRE_MESSAGE(function = functions.at(0), "Failed to retrieve function");
BOOST_CHECK_MESSAGE(!function->documentation(),
"Shouldn't get natspec docstring for this function");
}