From 7752f2c62cebe62a1ec5ffbc6aeeaa72dde1e6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 27 Aug 2008 06:32:35 +0000 Subject: [PATCH] testdivision: changed the error message. hopefully it is clearer --- CheckOther.cpp | 2 +- testdivision.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CheckOther.cpp b/CheckOther.cpp index c0213be63..da81dc5d7 100644 --- a/CheckOther.cpp +++ b/CheckOther.cpp @@ -369,7 +369,7 @@ void CheckUnsignedDivision() { // One of the operands are signed, the other is unsigned.. std::ostringstream ostr; - ostr << FileLine(div_tok) << ": If the result is negative it will be wrong because an operand is unsigned."; + ostr << FileLine(div_tok) << ": Warning: Division with signed and unsigned operators"; ReportErr(ostr.str()); } } diff --git a/testdivision.cpp b/testdivision.cpp index 1f5722133..d16167957 100644 --- a/testdivision.cpp +++ b/testdivision.cpp @@ -11,7 +11,6 @@ extern std::ostringstream errout; extern bool ShowAll; -extern bool CheckCodingStyle; class TestDivision : public TestFixture { @@ -28,7 +27,6 @@ private: errout.str(""); // Check for memory leaks.. - CheckCodingStyle = true; ShowAll = true; CheckUnsignedDivision(); } @@ -48,7 +46,7 @@ public: " unsigned int uvar = 2;\n" " return ivar / uvar;\n" "}\n" ); - ASSERT_EQUALS( std::string("[test.cpp:5]: If the result is negative it will be wrong because an operand is unsigned.\n"), errout.str() ); + ASSERT_EQUALS( std::string("[test.cpp:5]: Warning: Division with signed and unsigned operators\n"), errout.str() ); } void division2() @@ -59,7 +57,7 @@ public: " unsigned int uvar = 2;\n" " return uvar / ivar;\n" "}\n" ); - ASSERT_EQUALS( std::string("[test.cpp:5]: If the result is negative it will be wrong because an operand is unsigned.\n"), errout.str() ); + ASSERT_EQUALS( std::string("[test.cpp:5]: Warning: Division with signed and unsigned operators\n"), errout.str() ); } };