Skip to content

Commit

Permalink
testsymboldatabase.cpp: split some conditions in asserts in attempt o…
Browse files Browse the repository at this point in the history
…f fixing `nullPointerRedundantCheck` selfcheck warnings
  • Loading branch information
firewave committed Aug 28, 2024
1 parent 01008d3 commit 73bd4c4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/testsymboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,8 @@ class TestSymbolDatabase : public TestFixture {
ASSERT_EQUALS(1U, (*it)->dimensions().size());
ASSERT_EQUALS(4U, (*it)->dimension(0));
const ValueType* vt = (*it)->valueType();
ASSERT(vt && vt->container);
ASSERT(vt);
ASSERT(vt->container);
ASSERT_EQUALS(vt->pointer, 0);
const Token* tok = (*it)->nameToken();
ASSERT(tok && (vt = tok->valueType()));
Expand Down Expand Up @@ -1904,7 +1905,8 @@ class TestSymbolDatabase : public TestFixture {
ASSERT(function && function->functionScope == scope && scope->function == function && function->nestedIn == db->findScopeByName("Fred"));
ASSERT(function && function->retDef == functionToken->previous());

ASSERT(db && db->findScopeByName("Fred") && db->findScopeByName("Fred")->definedType->getFunction("func") == function);
ASSERT(db);
ASSERT(db->findScopeByName("Fred") && db->findScopeByName("Fred")->definedType->getFunction("func") == function);
}


Expand All @@ -1930,7 +1932,8 @@ class TestSymbolDatabase : public TestFixture {
ASSERT(function && function->functionScope == scope && scope->function == function && function->nestedIn == db->findScopeByName("Fred"));
ASSERT(function && function->retDef == functionToken->tokAt(4));

ASSERT(db && db->findScopeByName("Fred") && db->findScopeByName("Fred")->definedType->getFunction("func") == function);
ASSERT(db);
ASSERT(db->findScopeByName("Fred") && db->findScopeByName("Fred")->definedType->getFunction("func") == function);
}

void hasMissingInlineClassFunction() {
Expand Down Expand Up @@ -1974,7 +1977,8 @@ class TestSymbolDatabase : public TestFixture {
ASSERT(function && function->functionScope == scope && scope->function == function && function->nestedIn == db->findScopeByName("Fred"));
ASSERT(function && function->retDef == functionToken->tokAt(-2));

ASSERT(db && db->findScopeByName("Fred") && db->findScopeByName("Fred")->definedType->getFunction("operator=") == function);
ASSERT(db);
ASSERT(db->findScopeByName("Fred") && db->findScopeByName("Fred")->definedType->getFunction("operator=") == function);
}

void hasClassFunction() {
Expand Down

0 comments on commit 73bd4c4

Please sign in to comment.