diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 22315d1c7d2..bd9b2cd358c 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -8262,19 +8262,15 @@ class TestTokenizerCompileLimits : public TestFixture } void test() { - const char raw_code[] = "#define PTR1 (* (* (* (* (* (* (* (* (* (*\n" - "#define PTR2 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1 PTR1\n" - "#define PTR3 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2 PTR2\n" - "#define PTR4 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3 PTR3\n" - "#define PTR5 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4 PTR4\n" - "#define PTR6 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5 PTR5\n" + const char raw_code[] = "#define PTR1 (* (* (* (*\n" + "#define PTR2 PTR1 PTR1 PTR1 PTR1\n" + "#define PTR3 PTR2 PTR2 PTR2 PTR2\n" + "#define PTR4 PTR3 PTR3 PTR3 PTR3\n" "\n" - "#define RBR1 ) ) ) ) ) ) ) ) ) )\n" - "#define RBR2 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1 RBR1\n" - "#define RBR3 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2 RBR2\n" - "#define RBR4 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3 RBR3\n" - "#define RBR5 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4 RBR4\n" - "#define RBR6 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5 RBR5\n" + "#define RBR1 ) ) ) )\n" + "#define RBR2 RBR1 RBR1 RBR1 RBR1\n" + "#define RBR3 RBR2 RBR2 RBR2 RBR2\n" + "#define RBR4 RBR3 RBR3 RBR3 RBR3\n" "\n" "int PTR4 q4_var RBR4 = 0;\n"; @@ -8287,7 +8283,7 @@ class TestTokenizerCompileLimits : public TestFixture const Settings settings; const std::string code = PreprocessorHelper::getcode(settings, *this, filedata, emptyString, emptyString); - ASSERT_THROW_INTERNAL(tokenizeAndStringify(code), AST); + ASSERT_THROW_INTERNAL_EQUALS(tokenizeAndStringify(code), AST, "maximum AST depth exceeded"); } };