From f01c244212a0b2a1c68e65f5a3e101917e923b91 Mon Sep 17 00:00:00 2001 From: Ettl Martin Date: Tue, 1 May 2012 14:36:42 +0200 Subject: [PATCH] added testcase to ticket 3727 --- test/testinternal.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/testinternal.cpp b/test/testinternal.cpp index b3d4ad54f..7f0d2c41c 100644 --- a/test/testinternal.cpp +++ b/test/testinternal.cpp @@ -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)