From 47f1220367ad50168d91af49f13f9af7a329b6df Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Fri, 30 Nov 2012 12:40:22 +0100 Subject: [PATCH] Remove useless preprocessor pieces from some testcases. --- test/testdivision.cpp | 5 ++--- test/testincompletestatement.cpp | 4 ---- test/testother.cpp | 11 ++++------- test/testsimplifytokens.cpp | 11 +++++------ 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/test/testdivision.cpp b/test/testdivision.cpp index f623c42b3..0aba995f8 100644 --- a/test/testdivision.cpp +++ b/test/testdivision.cpp @@ -118,11 +118,10 @@ private: } void division5() { - check("#define USER_HASH (16)\n" - "void foo()\n" + check("void foo()\n" "{\n" " unsigned int val = 32;\n" - " val = val / USER_HASH;" + " val = val / (16);\n" "}", true); ASSERT_EQUALS("", errout.str()); } diff --git a/test/testincompletestatement.cpp b/test/testincompletestatement.cpp index 3db670908..ce080423e 100644 --- a/test/testincompletestatement.cpp +++ b/test/testincompletestatement.cpp @@ -74,11 +74,7 @@ private: check("void foo()\n" "{\n" " const char def[] =\n" - "#ifdef ABC\n" " \"abc\";\n" - "#else\n" - " \"not abc\";\n" - "#endif\n" "}\n"); ASSERT_EQUALS("", errout.str()); diff --git a/test/testother.cpp b/test/testother.cpp index c1b56f528..d86707703 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -4985,19 +4985,16 @@ private: void duplicateIf1() { // ticket 3689 ( avoid false positive ) - check("#define INT32_MAX 0x7fffffffLL\n" - "#define INT48_MAX 0x7fffffffffffLL\n" - "#define INT64_MAX 0x7fffffffffffffffLL\n" - "int fitInt(long long int nValue){\n" - " if( nValue < INT32_MAX )\n" + check("int fitInt(long long int nValue){\n" + " if( nValue < 0x7fffffffLL )\n" " {\n" " return 32;\n" " }\n" - " if( nValue < INT48_MAX )\n" + " if( nValue < 0x7fffffffffffLL )\n" " {\n" " return 48;\n" " }\n" - " else if( nValue < INT64_MAX )\n" + " else if( nValue < 0x7fffffffffffffffLL )\n" " {\n" " return 64;\n" " } else\n" diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index 3ec5899ba..05cc1335c 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -5792,12 +5792,11 @@ private: } void simplifyTypedef98() { // ticket #2963 - //TODO: this testcase fails because "inconclusive" and "style" are not enabled in "tok". - const char code[] = "#define X type ## __LINE__\n" - "typedef int X;\n" - "typedef int X;\n"; - tok(code); - ASSERT_EQUALS("", errout.str()); + const char code[] = "typedef int type ## __LINE__;\n" + "typedef int type ## __LINE__;\n" + "type1 x;\n" + "type2 y;"; + ASSERT_EQUALS("int x ; int y ;", tok(code)); } void simplifyTypedef99() { // ticket #2999