summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@theqtcompany.com>2015-10-09 14:43:25 +0200
committerJan Arve Sæther <jan-arve.saether@theqtcompany.com>2015-10-23 08:52:54 +0000
commite19bbdf888e1fdf73872fd8b1598a245ad77d459 (patch)
treeca537a6f84108be0e0c66664aedf93358257c00d
parent3338de7bbe76bac44652c525003bc66b14ef16d4 (diff)
downloadqtxmlpatterns-e19bbdf888e1fdf73872fd8b1598a245ad77d459.tar.gz
Skip tests that crashes.
Change-Id: I45ad981fa4d6d7302cf2e06429ea1134957034f3 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
-rw-r--r--tests/auto/xmlpatternssdk/TestCase.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/auto/xmlpatternssdk/TestCase.cpp b/tests/auto/xmlpatternssdk/TestCase.cpp
index d84ac06..642e84d 100644
--- a/tests/auto/xmlpatternssdk/TestCase.cpp
+++ b/tests/auto/xmlpatternssdk/TestCase.cpp
@@ -38,6 +38,7 @@
#include <QXmlResultItems>
#include <QXmlSerializer>
#include <private/qxmlquery_p.h>
+#include <algorithm>
#include "DebugExpressionFactory.h"
#include "ExternalSourceLoader.h"
@@ -62,9 +63,16 @@ TestCase::~TestCase()
delete m_result;
}
+static bool lessThan(const char *a, const char *b)
+{
+ return qstrcmp(a, b) < 0;
+}
+
TestResult::List TestCase::execute(const ExecutionStage stage,
TestSuite *)
{
+ const QByteArray nm = name().toAscii();
+
if(name() == QLatin1String("Constr-cont-document-3"))
{
TestResult::List result;
@@ -95,9 +103,28 @@ TestResult::List TestCase::execute(const ExecutionStage stage,
result.append(createTestResult(TestResult::Fail, QLatin1String("Skipped this test, we crash on it.")));
return result;
}
+ else {
+ // Should be sorted in the order that std::binary_search expects
+ static const char *crashes[] = {"Constr-attr-content-4",
+ "K2-DirectConElem-12",
+ "K2-DirectConElem-50",
+ "K2-DirectConElemAttr-10",
+ "K2-DirectConElemAttr-18",
+ "K2-DirectConElemAttr-19",
+ "K2-DirectConElemAttr-20",
+ "K2-DirectConElemAttr-21"
+ };
+
+ const bool skip = std::binary_search(&crashes[0], &crashes[sizeof(crashes)/sizeof(crashes[0])], nm.constData(), lessThan);
+ if (skip) {
+ TestResult::List result;
+ result.append(createTestResult(TestResult::Fail, QLatin1String("Skipped this test, we crash on it.")));
+ return result;
+ }
+ }
- qDebug() << "Running test case: " << name();
+ qDebug() << "Running test case: " << nm;
return execute(stage);
Q_ASSERT(false);