#5309 False positive: redundantCondition - comparing large integer values (unsigned long long). Testcase added, issue got fixed before.

This commit is contained in:
Alexander Mai 2015-06-20 12:18:24 +02:00
parent 272cf27ec3
commit 272cc55ab8
1 changed files with 10 additions and 0 deletions

View File

@ -49,6 +49,7 @@ private:
TEST_CASE(secondAlwaysTrueFalseWhenFirstTrueError);
TEST_CASE(incorrectLogicOp_condSwapping);
TEST_CASE(testBug5895);
TEST_CASE(testBug5309);
TEST_CASE(modulo);
@ -1439,6 +1440,15 @@ private:
"}");
TODO_ASSERT_EQUALS("", "[test.cpp:2]: (style) Redundant condition: If init == 9894494448401390090, the comparison init == 9965707617509186058 is always true.\n", errout.str());
}
void testBug5309() {
check("extern uint64_t value;\n"
"void foo() {\n"
" if( ( value >= 0x7ff0000000000001ULL )\n"
" && ( value <= 0x7fffffffffffffffULL ) );\n"
"}");
ASSERT_EQUALS("", errout.str());
}
};
REGISTER_TEST(TestCondition)