testdivision: changed the error message. hopefully it is clearer

This commit is contained in:
Daniel Marjamäki 2008-08-27 06:32:35 +00:00
parent a8e5d28949
commit 7752f2c62c
2 changed files with 3 additions and 5 deletions

View File

@ -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());
}
}

View File

@ -11,7 +11,6 @@
extern std::ostringstream errout;
extern bool ShowAll;
extern bool CheckCodingStyle;
class TestDivision : public TestFixture<TestDivision>
{
@ -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() );
}
};