Remove useless preprocessor pieces from some testcases.
This commit is contained in:
parent
45b77554ea
commit
47f1220367
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue