added testcase to ticket 3727

This commit is contained in:
Ettl Martin 2012-05-01 14:36:42 +02:00
parent 28510bdd38
commit f01c244212
1 changed files with 18 additions and 1 deletions

View File

@ -36,7 +36,8 @@ private:
TEST_CASE(complexPatternInTokenSimpleMatch)
TEST_CASE(simplePatternSquareBrackets)
TEST_CASE(simplePatternAlternatives)
TEST_CASE(missingPercentCharacter);
TEST_CASE(missingPercentCharacter)
TEST_CASE(internalError)
}
void check(const std::string &code) {
@ -227,6 +228,22 @@ private:
"}");
ASSERT_EQUALS("", errout.str());
}
void internalError() {
// Make sure cppcheck does not raise an internal error of Token::Match ( Ticket #3727 )
check("class DELPHICLASS X;\n"
"class Y {\n"
"private:\n"
" X* x;\n"
"};\n"
"class Z {\n"
" char z[1];\n"
" Z(){\n"
" z[0] = 0;\n"
" }\n"
"};\n");
ASSERT_EQUALS("", errout.str());
}
};
REGISTER_TEST(TestInternal)