diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-12-10 09:58:18 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-12-10 09:58:18 +0100 |
commit | c5ea60cb84fc7af57a85389a20d91e8397cce1a8 (patch) | |
tree | 6f9394b540efb6b0319b6b649d728de84e6d4af0 /tests/auto/xmlpatternssdk/TestCase.cpp | |
parent | 944129e3022a28a5cb969c6adaf01378b4555375 (diff) | |
parent | 8ba610490e2d93526c165584e2f52c7ae8e9edc0 (diff) | |
download | qtxmlpatterns-c5ea60cb84fc7af57a85389a20d91e8397cce1a8.tar.gz |
Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Iaf57c1b0beffdceb3f0533aa77ba536ec4c373a9
Diffstat (limited to 'tests/auto/xmlpatternssdk/TestCase.cpp')
-rw-r--r-- | tests/auto/xmlpatternssdk/TestCase.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/auto/xmlpatternssdk/TestCase.cpp b/tests/auto/xmlpatternssdk/TestCase.cpp index d84ac06..acf9e84 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,23 @@ 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 *) { + ++TestCase::executions; + + if ((TestCase::executions < TestCase::executeRange.first) || (TestCase::executions > TestCase::executeRange.second)) { + qDebug("Skipping test case #%6d", TestCase::executions); + return TestResult::List(); + } + + const QByteArray nm = name().toLatin1(); + if(name() == QLatin1String("Constr-cont-document-3")) { TestResult::List result; @@ -95,9 +110,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 #%6d: %s", TestCase::executions, nm.constData()); return execute(stage); Q_ASSERT(false); |