summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtest.h
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2012-02-29 15:43:42 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-08 05:31:40 +0100
commitd81b065bb3cea85a98f2299354d05ce440032f1f (patch)
tree1b6a25357b1f11fd3088357697adcbc18f5ddc30 /src/testlib/qtest.h
parent0eb95222acbd73713a934f0e1d2b291e858ec471 (diff)
testlib: Improve verbose and XPASS output
Previously, verbose (-v2) and XPASS test output showed all QCOMPAREs as "COMPARE()", making it impossible to see what was compared and difficult to match the output to the source of a test containing many calls to QCOMPARE. This commit changes testlib's internal compare_helper API so that string representations of the compared expressions are always passed to QTestResult::compare() when available, and can thus be shown in the verbose and XPASS output. The XPASS output has also been changed to state explicitly that the comparison succeeded unexpectedly, bringing it in line with the XPASS output resulting from a call to QVERIFY. This commit also changes all calls to compare_helper() to call the eight-argument version of the function, which simplifies much of the calling code. The now obsolete four-argument version of compare_helper() has been changed to output a warning that it is obsolete. It will be removed once other modules have had some time to catch up. The improved XPASS and verbose output is demonstrated by the expectfail and verbose2 selftests. Change-Id: I8baa46d5dd30e6c43b26f366c34dc5b64aab5f7c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'src/testlib/qtest.h')
-rw-r--r--src/testlib/qtest.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index 32b2f0ca9c..477d344d71 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -210,7 +210,7 @@ inline bool qCompare(QStringList const &t1, QStringList const &t2,
isOk = false;
}
}
- return compare_helper(isOk, msg, file, line);
+ return compare_helper(isOk, msg, 0, 0, actual, expected, file, line);
}
template <typename T>