From d17eba9d34f412e592c3b049c6c14fd9ccada87b Mon Sep 17 00:00:00 2001 From: "David E. Narvaez" Date: Sun, 21 Jun 2015 22:24:39 -0400 Subject: Iterate Over the Items (Not the Operands) of a Literal Sequence The current code iterates over the (empty) list of operands of a Literal Sequence, ignoring any items in it, so Literal Sequences are always ignored in the ExpressionSequence. Task-number: QTBUG-35897 Change-Id: I60341ac21c8e3b77bf6d8dfeebdbafe010844406 Reviewed-by: Erik Verbruggen --- tests/auto/qxmlquery/tst_qxmlquery.cpp | 2 +- tests/auto/xmlpatterns/queries/literalsequence.xq | 1 + .../auto/xmlpatterns/stderrBaselines/QTBUG35897literalsequence.txt | 0 tests/auto/xmlpatterns/tst_xmlpatterns.cpp | 7 +++++++ 4 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/auto/xmlpatterns/queries/literalsequence.xq create mode 100644 tests/auto/xmlpatterns/stderrBaselines/QTBUG35897literalsequence.txt (limited to 'tests') diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index 3350911..cc2cb13 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -231,7 +231,7 @@ private: /** * One excluded, since we skip static-base-uri.xq. */ - ExpectedQueryCount = 29 + ExpectedQueryCount = 30 }; static void checkBaseURI(const QUrl &baseURI, const QString &candidate); diff --git a/tests/auto/xmlpatterns/queries/literalsequence.xq b/tests/auto/xmlpatterns/queries/literalsequence.xq new file mode 100644 index 0000000..3420df0 --- /dev/null +++ b/tests/auto/xmlpatterns/queries/literalsequence.xq @@ -0,0 +1 @@ +("someString", tokenize("a,b",",")) diff --git a/tests/auto/xmlpatterns/stderrBaselines/QTBUG35897literalsequence.txt b/tests/auto/xmlpatterns/stderrBaselines/QTBUG35897literalsequence.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp index 85dc50a..ffb1697 100644 --- a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp +++ b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp @@ -757,6 +757,13 @@ void tst_XmlPatterns::xquerySupport_data() const << QString() << QString(); + QTest::newRow("QTBUG-35897: literal sequence") + << 0 + << QByteArray("someString a b\n") + << QStringList((path + QStringLiteral("literalsequence.xq"))) + << QString() + << QString(); + // TODO https? // TODO pass external variables that allows space around the equal sign. // TODO run fn:trace() -- cgit v1.2.1 From 3510040dc99a8266963c5e8ce10c2bd0edaaaf76 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 3 Sep 2015 13:40:09 +0200 Subject: xmlpatterns test: Improve process handling. Introduce a message when starting fails or timeouts occur and flip the order to check for timeouts first and then check the exit code. Change-Id: I293aa55888186f66c12cd86bcb8010802f521032 Reviewed-by: Mitch Curtis --- tests/auto/xmlpatterns/tst_xmlpatterns.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp index 85dc50a..90bfbe3 100644 --- a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp +++ b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp @@ -119,6 +119,17 @@ void tst_XmlPatterns::initTestCase() #endif // QT_NO_PROCESS } +#ifndef QT_NO_PROCESS +static QByteArray msgProcessError(const char *what, const QProcess &process) +{ + QString result = QLatin1String(what) + QLatin1Char(' ') + + QDir::toNativeSeparators(process.program()) + + QLatin1Char(' ') + process.arguments().join(QLatin1Char(' ')) + + QLatin1String(": ") + process.errorString(); + return result.toLocal8Bit(); +} +#endif // !QT_NO_PROCESS + void tst_XmlPatterns::xquerySupport() { if (QTest::currentDataTag() == QByteArray("Load query via FTP") @@ -145,9 +156,10 @@ void tst_XmlPatterns::xquerySupport() process.setWorkingDirectory(inputFile(cwd)); process.start(m_command, arguments); + QVERIFY2(process.waitForStarted(), msgProcessError("Failed to start", process).constData()); + QVERIFY2(process.waitForFinished(), msgProcessError("Timeout running", process).constData()); QCOMPARE(process.exitStatus(), QProcess::NormalExit); - QVERIFY(process.waitForFinished()); if(process.exitCode() != expectedExitCode) QTextStream(stderr) << "stderr:" << process.readAllStandardError(); -- cgit v1.2.1 From 670b2073c0b1c40f5b67fc36c18ed15fe2cdfee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Tue, 8 Sep 2015 15:04:58 +0300 Subject: Compile fix for platforms without QProcess support Change-Id: Ied9eefcaff7c7a991cde483dc08c6905ba9ca421 Reviewed-by: Maurice Kalinowski --- tests/auto/xmlpatterns/tst_xmlpatterns.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp index ffb1697..7c18bf6 100644 --- a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp +++ b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp @@ -66,9 +66,7 @@ private Q_SLOTS: void xquerySupport_data() const; void xsltSupport(); void xsltSupport_data() const; -#ifndef QT_NO_PROCESS void stdoutFailure() const; -#endif void cleanupTestCase() const; private: @@ -810,10 +808,10 @@ void tst_XmlPatterns::removeNonWritable(QFile &outFile) Check that we gracefully handle writing out to stdout when the latter is not writable. */ -#ifndef QT_NO_PROCESS void tst_XmlPatterns::stdoutFailure() const { return; // TODO It's really hard to write testing code for this. +#ifndef QT_NO_PROCESS const QString outName(QLatin1String("stdoutFailure.out")); createNonWritable(outName); @@ -835,8 +833,10 @@ void tst_XmlPatterns::stdoutFailure() const QCOMPARE(process.exitCode(), 1); removeNonWritable(outFile); +#else + QSKIP("Skipping test due to not having process support"); +#endif // QT_NO_PROCESS } -#endif void tst_XmlPatterns::cleanupTestCase() const { -- cgit v1.2.1 From 35affae0a748680d85133f9d8b7c588986e77c43 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Fri, 10 Apr 2015 20:01:01 +0200 Subject: Update new Baseline.xml Appararently, some new tests fail and other new tests started pass. I haven't digged into the reasons why, but the fact that the pass percentage is at 96%, this is better than not testing it at all. Change-Id: Id5e2710ebd3c17b65a2792245a073c676d116208 Reviewed-by: Frederik Gladhorn --- tests/auto/xmlpatternsxqts/Baseline.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/xmlpatternsxqts/Baseline.xml b/tests/auto/xmlpatternsxqts/Baseline.xml index d9be95a..ce8a4a6 100644 --- a/tests/auto/xmlpatternsxqts/Baseline.xml +++ b/tests/auto/xmlpatternsxqts/Baseline.xml @@ -1,2 +1,2 @@ -

Patternist is an implementation written in C++ and with the Qt/KDE libraries. It is licensed under GNU LGPL and part of KDE, the K Desktop Environment.

XQuery
\ No newline at end of file +

Patternist is an implementation written in C++ and with the Qt/KDE libraries. It is licensed under GNU LGPL and part of KDE, the K Desktop Environment.

XQuery
\ No newline at end of file -- cgit v1.2.1 From 3338de7bbe76bac44652c525003bc66b14ef16d4 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Thu, 8 Oct 2015 11:09:51 +0200 Subject: Add baseline file for literalsequence.xq autotest. d17eba9d34f412e592c3b049c6c14fd9ccada87b added literalsequence.xq, but forgot to add the baseline file. This probably passed in 5.5 because the test was run twice (because of flakyness): 1. The first pass it would fail (but generate the baseline). 2. The second pass it would succeed because the baseline was already there Change-Id: If40ee6c57e97cb4cffc959e0f6bb768e610a76d4 Reviewed-by: Liang Qi --- tests/auto/qxmlquery/pushBaselines/literalsequence.ref | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/auto/qxmlquery/pushBaselines/literalsequence.ref (limited to 'tests') diff --git a/tests/auto/qxmlquery/pushBaselines/literalsequence.ref b/tests/auto/qxmlquery/pushBaselines/literalsequence.ref new file mode 100644 index 0000000..a337101 --- /dev/null +++ b/tests/auto/qxmlquery/pushBaselines/literalsequence.ref @@ -0,0 +1,5 @@ +startOfSequence() +atomicValue(someString) +atomicValue(a) +atomicValue(b) +endOfSequence() -- cgit v1.2.1