Remove obsolete tests. Add incomplete test for GNU __builtin_expect to gnu.c

This commit is contained in:
Alexander Mai 2015-08-10 21:20:20 +02:00
parent a5aba110a4
commit b3cc4629a6
2 changed files with 4 additions and 18 deletions

View File

@ -21,4 +21,8 @@ void leakReturnValNotUsed() {
// cppcheck-suppress ignoredReturnValue // cppcheck-suppress ignoredReturnValue
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer
strcasestr("test", NULL); strcasestr("test", NULL);
//
if (42 == __builtin_expect(42, 0))
return;
} }

View File

@ -218,7 +218,6 @@ private:
TEST_CASE(simplifyFunctionParametersErrors); TEST_CASE(simplifyFunctionParametersErrors);
TEST_CASE(removeParentheses1); // Ticket #61 TEST_CASE(removeParentheses1); // Ticket #61
TEST_CASE(removeParentheses2);
TEST_CASE(removeParentheses3); TEST_CASE(removeParentheses3);
TEST_CASE(removeParentheses4); // Ticket #390 TEST_CASE(removeParentheses4); // Ticket #390
TEST_CASE(removeParentheses5); // Ticket #392 TEST_CASE(removeParentheses5); // Ticket #392
@ -295,8 +294,6 @@ private:
TEST_CASE(syntax_error_templates_3); // Ticket #5605, #5759, #5762, #5774 TEST_CASE(syntax_error_templates_3); // Ticket #5605, #5759, #5762, #5774
TEST_CASE(template_member_ptr); // Ticket #5786 - crash upon valid code TEST_CASE(template_member_ptr); // Ticket #5786 - crash upon valid code
TEST_CASE(simplifyBuiltinExpect);
// unsigned i; => unsigned int i; // unsigned i; => unsigned int i;
TEST_CASE(unsigned1); TEST_CASE(unsigned1);
TEST_CASE(unsigned2); TEST_CASE(unsigned2);
@ -3200,16 +3197,6 @@ private:
ASSERT_EQUALS("void foo ( ) { free ( p ) ; }", tokenizeAndStringify(code, true)); ASSERT_EQUALS("void foo ( ) { free ( p ) ; }", tokenizeAndStringify(code, true));
} }
void removeParentheses2() {
const char code[] = "void foo()"
"{"
" if (__builtin_expect((s == NULL), 0))"
" return;"
"}";
ASSERT_EQUALS("void foo ( ) { if ( s == 0 ) { return ; } }", tokenizeAndStringify(code));
}
void removeParentheses3() { void removeParentheses3() {
{ {
const char code[] = "void foo()" const char code[] = "void foo()"
@ -4355,11 +4342,6 @@ private:
"};"); "};");
} }
void simplifyBuiltinExpect() {
const char code[] = "if (__builtin_expect(!!(x), 1));";
ASSERT_EQUALS("if ( ! ! x ) { ; }", tokenizeAndStringify(code, true));
}
void simplifyKeyword() { void simplifyKeyword() {
{ {
const char code[] = "void f (int a [ static 5] );"; const char code[] = "void f (int a [ static 5] );";