From 4e65800adfedfb258eedc205c051c513961083cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 16 Apr 2013 16:54:19 +0200 Subject: [PATCH] TestRunner: Updated warning message when there is unsimplified code --- test/testassignif.cpp | 4 +++- test/testautovariables.cpp | 5 ++++- test/testbool.cpp | 5 ++++- test/testbufferoverrun.cpp | 4 +++- test/testnullpointer.cpp | 4 +++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/test/testassignif.cpp b/test/testassignif.cpp index 11a604853..8d325e9dc 100644 --- a/test/testassignif.cpp +++ b/test/testassignif.cpp @@ -56,7 +56,9 @@ private: // Ensure that the test case is not bad. if (str1 != str2) { - warn(("Unsimplified code in test case\nstr1="+str1+"\nstr2="+str2).c_str()); + warn(("Unsimplified code in test case. It looks like this test " + "should either be cleaned up or moved to TestTokenizer or " + "TestSimplifyTokens instead.\nstr1="+str1+"\nstr2="+str2).c_str()); } diff --git a/test/testautovariables.cpp b/test/testautovariables.cpp index 6ec8da080..84d471096 100644 --- a/test/testautovariables.cpp +++ b/test/testautovariables.cpp @@ -55,7 +55,10 @@ private: tokenizer.simplifyTokenList(); const std::string str2(tokenizer.tokens()->stringifyList(0,true)); if (str1 != str2) - warn(("Unsimplified code in test case\nstr1="+str1+"\nstr2="+str2).c_str()); + warn(("Unsimplified code in test case. It looks like this test " + "should either be cleaned up or moved to TestTokenizer or " + "TestSimplifyTokens instead.\nstr1="+str1+"\nstr2="+str2).c_str()); + // Check auto variables checkAutoVariables.autoVariables(); diff --git a/test/testbool.cpp b/test/testbool.cpp index aef959b22..7fc9a9268 100644 --- a/test/testbool.cpp +++ b/test/testbool.cpp @@ -80,7 +80,10 @@ private: tokenizer.simplifyTokenList(); const std::string str2(tokenizer.tokens()->stringifyList(0,true)); if (str1 != str2) - warn("Unsimplified code in test case"); + warn(("Unsimplified code in test case. It looks like this test " + "should either be cleaned up or moved to TestTokenizer or " + "TestSimplifyTokens instead.\nstr1="+str1+"\nstr2="+str2).c_str()); + checkBool.runSimplifiedChecks(&tokenizer, &settings, this); } diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index 7090d51f3..f8bf64309 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -59,7 +59,9 @@ private: // Ensure that the test case is not bad. if (verify && str1 != str2) { - warn("Unsimplified code in test case"); + warn(("Unsimplified code in test case. It looks like this test " + "should either be cleaned up or moved to TestTokenizer or " + "TestSimplifyTokens instead.\nstr1="+str1+"\nstr2="+str2).c_str()); } // Check for buffer overruns.. diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index 71303cfbe..62676693a 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -99,7 +99,9 @@ private: tokenizer.simplifyTokenList(); const std::string str2(tokenizer.tokens()->stringifyList(0,true)); if (verify && str1 != str2) - warn(("Unsimplified code in test case\nstr1="+str1+"\nstr2="+str2).c_str()); + warn(("Unsimplified code in test case. It looks like this test " + "should either be cleaned up or moved to TestTokenizer or " + "TestSimplifyTokens instead.\nstr1="+str1+"\nstr2="+str2).c_str()); checkNullPointer.nullConstantDereference(); checkNullPointer.executionPaths();