Browse Source

now for SolidityEndToEndTest we can use compileRequireThrow<typename>

cl-refactor
Liana Husikyan 10 years ago
parent
commit
3d44ae2665
  1. 4
      libsolidity/InterfaceHandler.cpp
  2. 4
      test/libsolidity/SolidityEndToEndTest.cpp
  3. 3
      test/libsolidity/solidityExecutionFramework.h

4
libsolidity/InterfaceHandler.cpp

@ -165,7 +165,7 @@ void InterfaceHandler::generateUserDocumentation(ContractDefinition& _contractDe
} }
doc["methods"] = methods; doc["methods"] = methods;
_contractDef.setUserDocumentation(string(Json::FastWriter().write(doc))); _contractDef.setUserDocumentation(Json::FastWriter().write(doc));
} }
unique_ptr<string> InterfaceHandler::userDocumentation(ContractDefinition const& _contractDef) unique_ptr<string> InterfaceHandler::userDocumentation(ContractDefinition const& _contractDef)
@ -239,7 +239,7 @@ void InterfaceHandler::generateDevDocumentation(ContractDefinition& _contractDef
} }
doc["methods"] = methods; doc["methods"] = methods;
_contractDef.setDevDocumentation(string(Json::FastWriter().write(doc))); _contractDef.setDevDocumentation(Json::FastWriter().write(doc));
} }
/* -- private -- */ /* -- private -- */

4
test/libsolidity/SolidityEndToEndTest.cpp

@ -4668,7 +4668,7 @@ BOOST_AUTO_TEST_CASE(dev_title_at_function_error)
" function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n" " function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n"
"}\n"; "}\n";
compileRequireThrow(sourceCode); compileRequireThrow<DocstringParsingError>(sourceCode);
} }
BOOST_AUTO_TEST_CASE(dev_documenting_nonexistant_param) BOOST_AUTO_TEST_CASE(dev_documenting_nonexistant_param)
@ -4680,7 +4680,7 @@ BOOST_AUTO_TEST_CASE(dev_documenting_nonexistant_param)
" function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n" " function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n"
"}\n"; "}\n";
compileRequireThrow(sourceCode); compileRequireThrow<DocstringParsingError>(sourceCode);
} }

3
test/libsolidity/solidityExecutionFramework.h

@ -58,11 +58,12 @@ public:
return m_output; return m_output;
} }
template <class Exceptiontype>
void compileRequireThrow(std::string const& _sourceCode) void compileRequireThrow(std::string const& _sourceCode)
{ {
m_compiler.reset(false, m_addStandardSources); m_compiler.reset(false, m_addStandardSources);
m_compiler.addSource("", _sourceCode); m_compiler.addSource("", _sourceCode);
BOOST_REQUIRE_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), DocstringParsingError); BOOST_REQUIRE_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), Exceptiontype);
} }
bytes const& compileAndRun( bytes const& compileAndRun(

Loading…
Cancel
Save