GUITESTS: Fix XML V1 test.

Test was using and assuming that severity string starts with
capital letter (e.g. "Style"). But the strings are all lowercase
letters.

Ticket #2832 (GUI: XML version 1 test fails)
This commit is contained in:
Kimmo Varis 2011-06-10 15:16:44 +03:00
parent 8cff768d99
commit ebd5a123ce
2 changed files with 6 additions and 6 deletions

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<results> <results>
<error file="test.cxx" line="11" id="unreadVariable" severity="Style" msg="Variable &amp;#039;a&amp;#039; is assigned a value that is never used"/> <error file="test.cxx" line="11" id="unreadVariable" severity="style" msg="Variable &amp;#039;a&amp;#039; is assigned a value that is never used"/>
<error file="test.cxx" line="28" id="unreadVariable" severity="Style" msg="Variable &amp;#039;b&amp;#039; is assigned a value that is never used"/> <error file="test.cxx" line="28" id="unreadVariable" severity="style" msg="Variable &amp;#039;b&amp;#039; is assigned a value that is never used"/>
<error file="test.cxx" line="31" id="memleak" severity="Error" msg="Memory leak: b"/> <error file="test.cxx" line="31" id="memleak" severity="error" msg="Memory leak: b"/>
<error file="test.cxx" line="16" id="mismatchAllocDealloc" severity="Error" msg="Mismatching allocation and deallocation: k"/> <error file="test.cxx" line="16" id="mismatchAllocDealloc" severity="error" msg="Mismatching allocation and deallocation: k"/>
<error file="test.cxx" line="31" id="obsoleteFunctionsgets" severity="Style" msg="Found obsolete function &amp;#039;gets&amp;#039;. With gets you&amp;#039;ll get buffer overruns if the input data too big for the buffer. It is recommended to use the function &amp;#039;fgets&amp;#039; instead."/> <error file="test.cxx" line="31" id="obsoleteFunctionsgets" severity="style" msg="Found obsolete function &amp;#039;gets&amp;#039;. With gets you&amp;#039;ll get buffer overruns if the input data too big for the buffer. It is recommended to use the function &amp;#039;fgets&amp;#039; instead."/>
<error file="test.cxx" line="22" id="postfixOperator" severity="performance" msg="Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code."/> <error file="test.cxx" line="22" id="postfixOperator" severity="performance" msg="Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code."/>
</results> </results>

View File

@ -35,7 +35,7 @@ void TestXmlReportV1::readXml()
QCOMPARE(item.file, QString("test.cxx")); QCOMPARE(item.file, QString("test.cxx"));
QCOMPARE(item.lines[0], (unsigned int)11); QCOMPARE(item.lines[0], (unsigned int)11);
QCOMPARE(item.id, QString("unreadVariable")); QCOMPARE(item.id, QString("unreadVariable"));
QCOMPARE(GuiSeverity::toString(item.severity), QString("Style")); QCOMPARE(GuiSeverity::toString(item.severity), QString("style"));
QCOMPARE(item.summary, QString("Variable 'a' is assigned a value that is never used")); QCOMPARE(item.summary, QString("Variable 'a' is assigned a value that is never used"));
QCOMPARE(item.message, QString("Variable 'a' is assigned a value that is never used")); QCOMPARE(item.message, QString("Variable 'a' is assigned a value that is never used"));
} }