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.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
index 4b9f3600ac..79325a3bfc 100644
--- a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+++ b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
@@ -59,6 +59,8 @@ private slots:
void dataDrivenTest() const;
void expectOnWrongRow_data() const;
void expectOnWrongRow() const;
+ void expectOnAnyRow_data() const;
+ void expectOnAnyRow() const;
};
void tst_ExpectFail::expectAndContinue() const
@@ -158,5 +160,21 @@ void tst_ExpectFail::expectOnWrongRow() const
QVERIFY(true);
}
+void tst_ExpectFail::expectOnAnyRow_data() const
+{
+ QTest::addColumn<int>("dummy");
+
+ QTest::newRow("first row") << 0;
+ QTest::newRow("second row") << 1;
+}
+
+void tst_ExpectFail::expectOnAnyRow() const
+{
+ // In a data-driven test, passing an empty first parameter to QEXPECT_FAIL
+ // should mean that the failure is expected for all data rows.
+ QEXPECT_FAIL("", "This test should xfail", Abort);
+ QVERIFY(false);
+}
+
QTEST_MAIN(tst_ExpectFail)
#include "tst_expectfail.moc"