summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp')
-rw-r--r--tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
index 09ba319105..8f67afc5ae 100644
--- a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+++ b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
@@ -53,6 +53,7 @@ private slots:
void expectAndContinue() const;
void expectAndAbort() const;
void xfailWithQString() const;
+ void xpass() const;
void dataDrivenTest_data() const;
void dataDrivenTest() const;
};
@@ -86,6 +87,16 @@ void tst_ExpectFail::xfailWithQString() const
QVERIFY(false);
}
+void tst_ExpectFail::xpass() const
+{
+ QEXPECT_FAIL("", "This test should xpass", Abort);
+ QVERIFY(true);
+
+ // If we get here the test did not correctly abort on the previous
+ // unexpected pass.
+ QVERIFY2(false, "This should not be reached");
+}
+
void tst_ExpectFail::dataDrivenTest_data() const
{
QTest::addColumn<bool>("shouldPass");