summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/expectfail
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2012-01-11 17:01:16 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-12 06:41:39 +0100
commit188db2b81748a49c61ba0005f0955024b5255bb7 (patch)
tree21704bd81b3dd49a474a979e227172e0bffb7431 /tests/auto/testlib/selftests/expectfail
parent29d8d8faec4f6ec4f3b7325c8dfe18fb908c06d0 (diff)
Make expectfail selftest test XPASS.
Change-Id: I0f7943049995c7fa4ad70a05fd2fdac4bc9f6ff6 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/testlib/selftests/expectfail')
-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");