diff --git a/test.cpp b/test.cpp index 42552a39..75e73ee6 100644 --- a/test.cpp +++ b/test.cpp @@ -2752,6 +2752,16 @@ static void token() ASSERT_TOKEN("+22", false, true, false); } +static void leak() +{ + const char code[] = "#include\n" + "#include\n"; + simplecpp::OutputList outputList; + ASSERT_EQUALS("", preprocess(code, &outputList)); + ASSERT_EQUALS("file0,1,missing_header,Header not found: \n" + "file0,2,missing_header,Header not found: \n", toString(outputList)); +} + int main(int argc, char **argv) { TEST_CASE(backslash); @@ -2984,5 +2994,7 @@ int main(int argc, char **argv) TEST_CASE(token); + TEST_CASE(leak); + return numberOfFailedAssertions > 0 ? EXIT_FAILURE : EXIT_SUCCESS; }