Skip to content

Commit 12496fb

Browse files
author
Your Name
committed
Reduce the test cases
1 parent 878eb63 commit 12496fb

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

test/testnullpointer.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ class TestNullPointer : public TestFixture {
144144
TEST_CASE(nullpointer104); // #13881
145145
TEST_CASE(nullpointer105); // #13861
146146
TEST_CASE(nullpointer106); // #13682
147-
TEST_CASE(nullpointer107); // #13682 (no false positive past unrelated conditions)
148-
TEST_CASE(nullpointer109); // #13682 (no FP when guard depends on pointer via conditional modification)
147+
TEST_CASE(nullpointer107); // #13682 (FP/FN cases around guards that depend on the pointer indirectly)
149148
TEST_CASE(nullpointer_addressOf); // address of
150149
TEST_CASE(nullpointerSwitch); // #2626
151150
TEST_CASE(nullpointer_cast); // #4692
@@ -3078,10 +3077,7 @@ class TestNullPointer : public TestFixture {
30783077
"[test.cpp:5:9] -> [test.cpp:10:5]: (warning) Either the condition 'p' is redundant or there is possible null pointer dereference: p. [nullPointerRedundantCheck]\n",
30793078
"",
30803079
errout_str());
3081-
}
30823080

3083-
void nullpointer109() // #13682 - no false positive when a guard depends on the pointer through a conditional modification
3084-
{
30853081
// These are dereferences that are actually safe, but the dependency that makes them safe is hidden
30863082
// behind a conditional modification. ProgramMemory tracks 'q'/'ok' and would normally evaluate the
30873083
// guard, but a conditional modification ('if (c) ...') makes it stop tracking the value, so the guard

0 commit comments

Comments
 (0)