Minor style tweaks in test TestFileParser (names and wrapping)

This commit is contained in:
Kamil Śliwak 2021-05-19 22:50:00 +02:00
parent d07c85db67
commit 752483b92f
3 changed files with 9 additions and 7 deletions

View File

@ -726,7 +726,7 @@ char TestFileParser::Scanner::scanHexPart()
return static_cast<char>(value);
}
bool TestFileParser::isBuiltinFunction(std::string const& signature)
bool TestFileParser::isBuiltinFunction(std::string const& _signature)
{
return m_builtins.count(signature) > 0;
return m_builtins.count(_signature) > 0;
}

View File

@ -52,7 +52,10 @@ class TestFileParser
public:
/// Constructor that takes an input stream \param _stream to operate on
/// and creates the internal scanner.
explicit TestFileParser(std::istream& _stream, std::map<std::string, Builtin> const& _builtins): m_scanner(_stream), m_builtins(_builtins) {}
explicit TestFileParser(std::istream& _stream, std::map<std::string, Builtin> const& _builtins):
m_scanner(_stream),
m_builtins(_builtins)
{}
/// Parses function calls blockwise and returns a list of function calls found.
/// Throws an exception if a function call cannot be parsed because of its
@ -179,7 +182,7 @@ private:
/// Checks whether a builtin function with the given signature exist.
/// @returns true, if builtin found, false otherwise
bool isBuiltinFunction(std::string const& signature);
bool isBuiltinFunction(std::string const& _signature);
/// A scanner instance
Scanner m_scanner;

View File

@ -45,8 +45,7 @@ namespace
vector<FunctionCall> parse(string const& _source)
{
istringstream stream{_source, ios_base::out};
TestFileParser parser{stream, {}};
return parser.parseFunctionCalls(0);
return TestFileParser{stream, {}}.parseFunctionCalls(0);
}
void testFunctionCall(
@ -99,7 +98,7 @@ BOOST_AUTO_TEST_CASE(smoke_test)
BOOST_REQUIRE_EQUAL(parse(source).size(), 0);
}
BOOST_AUTO_TEST_CASE(call_succees)
BOOST_AUTO_TEST_CASE(call_success)
{
char const* source = R"(
// success() ->