path: root/tests
diff options
authorJason McDonald <>2012-01-11 16:26:03 +1000
committerQt by Nokia <>2012-01-12 06:41:35 +0100
commit29d8d8faec4f6ec4f3b7325c8dfe18fb908c06d0 (patch)
tree45492b438d6f8e65430025bc4096fffe92e06763 /tests
parenta59bc6a6e4c7c9f291e7d1b654c3b1ee157d8379 (diff)
Make selftest for QEXPECT_FAIL more robust.
Make the test fail if calling QEXPECT_FAIL with the mode set to Abort does not cause the current test function to abort. Previously, such an error would not cause the selftest to fail and someone would have to see the warning message in the test output to know that there is a problem. Change-Id: I2bd58fafe6b51ea0ab86fde7c5afb781e4534ee4 Reviewed-by: Rohan McGovern <>
Diffstat (limited to 'tests')
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
index 28b00dccf7..09ba319105 100644
--- a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+++ b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
@@ -70,7 +70,9 @@ void tst_ExpectFail::expectAndAbort() const
QEXPECT_FAIL("", "This should xfail", Abort);
- qDebug("this should not be reached");
+ // If we get here the test did not correctly abort on the previous QVERIFY.
+ QVERIFY2(false, "This should not be reached");
void tst_ExpectFail::xfailWithQString() const