tests: fix some self-check findings about functions that can be static.

Was:
[test/testtype.cpp:223]: (performance, inconclusive) Technically the member function 'TestType::removeFloat' can be static.
[test/testsymboldatabase.cpp:61]: (performance, inconclusive) Technically the member function 'TestSymbolDatabase::getSymbolDB_inner' can be static.
[test/teststl.cpp:1437]: (performance, inconclusive) Technically the member function 'TestStl::getArraylength' can be static.
This commit is contained in:
Matthias Krüger 2017-04-09 16:59:41 +02:00
parent 7d12e1f3a6
commit 494f64cb88
3 changed files with 3 additions and 3 deletions

View File

@ -1434,7 +1434,7 @@ private:
}
template<size_t n, typename T>
size_t getArraylength(const T(&)[n]) {
static size_t getArraylength(const T(&)[n]) {
return n;
}

View File

@ -58,7 +58,7 @@ private:
found = false;
}
const SymbolDatabase* getSymbolDB_inner(Tokenizer& tokenizer, const char* code, const char* filename) {
const static SymbolDatabase* getSymbolDB_inner(Tokenizer& tokenizer, const char* code, const char* filename) {
errout.str("");
std::istringstream istr(code);
tokenizer.tokenize(istr, filename);

View File

@ -220,7 +220,7 @@ private:
// This function ensure that test works with different compilers. Floats can
// be stringified differently.
std::string removeFloat(const std::string& msg) {
static std::string removeFloat(const std::string& msg) {
std::string::size_type pos1 = msg.find("float (");
std::string::size_type pos2 = msg.find(") conversion");
if (pos1 == std::string::npos || pos2 == std::string::npos || pos1 > pos2)