Skip to content

Commit 8d0ad65

Browse files
committed
testrunner: removed unused/redundant parameters [skip ci]
1 parent 5692009 commit 8d0ad65

File tree

5 files changed

+14
-20
lines changed

5 files changed

+14
-20
lines changed

test/testbufferoverrun.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5276,9 +5276,9 @@ class TestBufferOverrun : public TestFixture {
52765276
ASSERT_EQUALS("", errout_str());
52775277
}
52785278

5279-
#define ctu(code) ctu_(code, __FILE__, __LINE__)
5279+
#define ctu(...) ctu_(__FILE__, __LINE__, __VA_ARGS__)
52805280
template<size_t size>
5281-
void ctu_(const char (&code)[size], const char* file, int line) {
5281+
void ctu_(const char* file, int line, const char (&code)[size]) {
52825282
// Tokenize..
52835283
SimpleTokenizer tokenizer(settings0, *this);
52845284
ASSERT_LOC(tokenizer.tokenize(code), file, line);

test/testleakautovar.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3224,8 +3224,8 @@ class TestLeakAutoVarRecursiveCountLimit : public TestFixture {
32243224

32253225
#define checkP(...) checkP_(__FILE__, __LINE__, __VA_ARGS__)
32263226
template<size_t size>
3227-
void checkP_(const char* file, int line, const char (&code)[size], bool cpp = false) {
3228-
SimpleTokenizer2 tokenizer(settings, *this, code, cpp?"test.cpp":"test.c");
3227+
void checkP_(const char* file, int line, const char (&code)[size]) {
3228+
SimpleTokenizer2 tokenizer(settings, *this, code, "test.c");
32293229

32303230
// Tokenizer..
32313231
ASSERT_LOC(tokenizer.simplifyTokens1(""), file, line);

test/testuninitvar.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3611,8 +3611,7 @@ class TestUninitVar : public TestFixture {
36113611
" if (y != 0) return;\n"
36123612
" i++;\n"
36133613
" }\n"
3614-
"}",
3615-
true);
3614+
"}");
36163615
ASSERT_EQUALS("", errout_str());
36173616

36183617
valueFlowUninit("void f() {\n"
@@ -3622,8 +3621,7 @@ class TestUninitVar : public TestFixture {
36223621
" if (y != 0) return;\n"
36233622
" i++;\n"
36243623
" }\n"
3625-
"}",
3626-
true);
3624+
"}");
36273625
ASSERT_EQUALS("", errout_str());
36283626

36293627
valueFlowUninit("void f() {\n"
@@ -3892,8 +3890,7 @@ class TestUninitVar : public TestFixture {
38923890
valueFlowUninit("void f() {\n"
38933891
" int x;\n"
38943892
" char *p = (char*)&x + 1;\n"
3895-
"}",
3896-
true);
3893+
"}");
38973894
ASSERT_EQUALS("", errout_str());
38983895

38993896
valueFlowUninit("void f() {\n"
@@ -7371,8 +7368,7 @@ class TestUninitVar : public TestFixture {
73717368
"void foo() {\n"
73727369
" A a;\n"
73737370
" x = a.m;\n"
7374-
"}",
7375-
true);
7371+
"}");
73767372
ASSERT_EQUALS("", errout_str());
73777373

73787374
// Unknown type (C)

test/testvalueflow.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ class TestValueFlow : public TestFixture {
418418

419419
#define testLifetimeOfX(...) testLifetimeOfX_(__FILE__, __LINE__, __VA_ARGS__)
420420
template<size_t size>
421-
bool testLifetimeOfX_(const char* file, int line, const char (&code)[size], unsigned int linenr, const char value[], ValueFlow::Value::LifetimeScope lifetimeScope = ValueFlow::Value::LifetimeScope::Local) {
421+
bool testLifetimeOfX_(const char* file, int line, const char (&code)[size], unsigned int linenr, const char value[]) {
422422
// Tokenize..
423423
SimpleTokenizer tokenizer(settings, *this);
424424
ASSERT_LOC(tokenizer.tokenize(code), file, line);
@@ -427,7 +427,7 @@ class TestValueFlow : public TestFixture {
427427
for (const Token *tok = tokenizer.tokens(); tok; tok = tok->next()) {
428428
if (tok->str() == "x" && tok->linenr() == linenr) {
429429
if (std::any_of(tok->values().cbegin(), tok->values().cend(), [&](const ValueFlow::Value& v) {
430-
return v.isLifetimeValue() && v.lifetimeScope == lifetimeScope && Token::simpleMatch(v.tokvalue, value, len);
430+
return v.isLifetimeValue() && v.lifetimeScope == ValueFlow::Value::LifetimeScope::Local && Token::simpleMatch(v.tokvalue, value, len);
431431
}))
432432
return true;
433433
}
@@ -546,11 +546,9 @@ class TestValueFlow : public TestFixture {
546546
int line,
547547
const char code[],
548548
const char tokstr[],
549-
int value,
550-
const Settings* s = nullptr,
551-
bool cpp = true)
549+
int value)
552550
{
553-
std::list<ValueFlow::Value> values = removeImpossible(tokenValues_(file, line, code, tokstr, s, cpp));
551+
std::list<ValueFlow::Value> values = removeImpossible(tokenValues_(file, line, code, tokstr));
554552
return std::any_of(values.begin(), values.end(), [&](const ValueFlow::Value& v) {
555553
return v.isKnown() && v.isIntValue() && v.intvalue == value;
556554
});

test/testvarid.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ class TestVarID : public TestFixture {
310310

311311
#define compareVaridsForVariable(...) compareVaridsForVariable_(__FILE__, __LINE__, __VA_ARGS__)
312312
template<size_t size>
313-
std::string compareVaridsForVariable_(const char* file, int line, const char (&code)[size], const char varname[], bool cpp = true) {
314-
SimpleTokenizer tokenizer(settings, *this, cpp);
313+
std::string compareVaridsForVariable_(const char* file, int line, const char (&code)[size], const char varname[]) {
314+
SimpleTokenizer tokenizer(settings, *this);
315315
ASSERT_LOC((tokenizer.tokenize)(code), file, line);
316316

317317
unsigned int varid = ~0U;

0 commit comments

Comments
 (0)