From 571de5844f95dc23da27c5d63780a59b0eb92bdd Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 4 Dec 2019 18:12:10 +0300 Subject: [PATCH] Improve test coverage for functions returning bool values --- test/testbool.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/testbool.cpp b/test/testbool.cpp index 5b2c0e118..c0b6bc988 100644 --- a/test/testbool.cpp +++ b/test/testbool.cpp @@ -597,13 +597,20 @@ private: } void checkComparisonOfFuncReturningBool2() { - check("void f(){\n" + check("void leftOfComparison(){\n" " int temp = 4;\n" " bool a = true;\n" " if(compare(temp) > a){\n" " printf(\"foo\");\n" " }\n" "}\n" + "void rightOfComparison(){\n" + " int temp = 4;\n" + " bool a = true;\n" + " if(a < compare(temp)){\n" + " printf(\"foo\");\n" + " }\n" + "}\n" "bool compare(int temp){\n" " if(temp==4){\n" " return true;\n" @@ -611,7 +618,8 @@ private: " else\n" " return false;\n" "}"); - ASSERT_EQUALS("[test.cpp:4]: (style) Comparison of a function returning boolean value using relational (<, >, <= or >=) operator.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:4]: (style) Comparison of a function returning boolean value using relational (<, >, <= or >=) operator.\n" + "[test.cpp:11]: (style) Comparison of a function returning boolean value using relational (<, >, <= or >=) operator.\n", errout.str()); } void checkComparisonOfFuncReturningBool3() {