Moved a few tests to testgarbage.cpp

This commit is contained in:
PKEuS 2016-02-04 09:10:20 +01:00
parent d3546ea410
commit cc8c498ebb
4 changed files with 27 additions and 25 deletions

View File

@ -224,8 +224,12 @@ private:
TEST_CASE(garbageCode173); // #6781
TEST_CASE(garbageCode174); // #7356
TEST_CASE(garbageCode175);
TEST_CASE(garbageCode176);
TEST_CASE(garbageCode177);
TEST_CASE(garbageCode176); // #7527
TEST_CASE(garbageCode177); // #7321
TEST_CASE(garbageCode178); // #3441
TEST_CASE(garbageCode179); // #3533
TEST_CASE(garbageCode180);
TEST_CASE(garbageCode181);
TEST_CASE(garbageValueFlow);
TEST_CASE(garbageSymbolDatabase);
TEST_CASE(garbageAST);
@ -1484,6 +1488,27 @@ private:
void garbageCode177() { // #7321
checkCode("{(){(())}}r&const");
}
void garbageCode178() { // #3441
checkCode("%: return ; ()");
}
void garbageCode179() { // #3533
checkCode("<class T>\n"
"{\n"
" struct {\n"
" typename D4:typename Base<T*>\n"
" };\n"
"};");
}
void garbageCode180() {
checkCode("int");
}
void garbageCode181() {
checkCode("int test() { int +; }");
}
};
REGISTER_TEST(TestGarbage)

View File

@ -2694,8 +2694,6 @@ private:
"}");
ASSERT_EQUALS("", errout.str()); // #3457
check("%: return ; ()"); // Don't crash. #3441.
// #3383. TODO: Use preprocessor
check("int foo() {\n"
"\n" // #ifdef A

View File

@ -232,7 +232,6 @@ private:
TEST_CASE(simplifyStructDecl2); // ticket #2579
TEST_CASE(simplifyStructDecl3);
TEST_CASE(simplifyStructDecl4);
TEST_CASE(simplifyStructDecl5); // ticket #3533 (segmentation fault)
TEST_CASE(simplifyStructDecl6); // ticket #3732
TEST_CASE(simplifyStructDecl7); // ticket #476 (static anonymous struct array)
@ -3819,17 +3818,6 @@ private:
ASSERT_EQUALS(expected, tok(code, false));
}
void simplifyStructDecl5() {
const char code[] = "<class T>\n"
"{\n"
" struct {\n"
" typename D4:typename Base<T*>\n"
" };\n"
"};\n";
//don't crash
tok(code, false);
}
void simplifyStructDecl6() {
ASSERT_EQUALS("struct A { "
"char integers [ X ] ; "
@ -4058,9 +4046,6 @@ private:
" int a [ 10 ] ;"
" memset ( a + 4 , 0 , 80 ) ;"
" }", tok(code, true));
// Don't crash
tok("int", true);
}
void simplifyCharAt() { // ticket #4481

View File

@ -44,7 +44,6 @@ private:
TEST_CASE(strPlusChar1); // "/usr" + '/'
TEST_CASE(strPlusChar2); // "/usr" + ch
TEST_CASE(strPlusChar3); // ok: path + "/sub" + '/'
TEST_CASE(strPlusChar4); // ast
TEST_CASE(sprintf1); // Dangerous usage of sprintf
TEST_CASE(sprintf2);
@ -484,11 +483,6 @@ private:
ASSERT_EQUALS("", errout.str());
}
void strPlusChar4() {
// don't crash
check("int test() { int +; }");
}
void incorrectStringCompare() {
check("int f() {\n"