From b67fe861b8a1efbca1d32064838c698adf2f5f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 10 Oct 2009 10:13:56 +0200 Subject: [PATCH] Added testcase for #807 (cppcheck crashes scanning ruby 1.9.1) --- test/testtokenize.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 2612b4637..ea54760c6 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -81,6 +81,7 @@ private: TEST_CASE(simplifyKnownVariables13); TEST_CASE(simplifyKnownVariables14); TEST_CASE(simplifyKnownVariables15); + TEST_CASE(simplifyKnownVariables16); TEST_CASE(match1); @@ -829,6 +830,13 @@ private: } } + void simplifyKnownVariables16() + { + // ticket #807 - segmentation fault when macro isn't found + const char code[] = "void f ( ) { int n = 1; DISPATCH(while); }"; + simplifyKnownVariables(code); + } + void match1() { // Match "%var% | %var%"