From e19bbdf888e1fdf73872fd8b1598a245ad77d459 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Fri, 9 Oct 2015 14:43:25 +0200 Subject: Skip tests that crashes. Change-Id: I45ad981fa4d6d7302cf2e06429ea1134957034f3 Reviewed-by: Erik Verbruggen Reviewed-by: Frederik Gladhorn --- tests/auto/xmlpatternssdk/TestCase.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) 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 #include #include +#include #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); -- cgit v1.2.1