From 29d8d8faec4f6ec4f3b7325c8dfe18fb908c06d0 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 11 Jan 2012 16:26:03 +1000 Subject: 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 --- tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') 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 qDebug("begin"); QEXPECT_FAIL("", "This should xfail", Abort); QVERIFY(false); - 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 -- cgit v1.2.3