tests/auto/xmlpatterns/tst_xmlpatterns.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    45 
    45 
    46 #ifdef QTEST_XMLPATTERNS
    46 #ifdef QTEST_XMLPATTERNS
    47 
    47 
    48 #include "../qxmlquery/TestFundament.h"
    48 #include "../qxmlquery/TestFundament.h"
    49 #include "../network-settings.h"
    49 #include "../network-settings.h"
       
    50 
       
    51 #if defined(Q_OS_SYMBIAN)
       
    52 #define SRCDIR ""
       
    53 #endif
    50 
    54 
    51 /*!
    55 /*!
    52  \class tst_XmlPatterns
    56  \class tst_XmlPatterns
    53  \internal
    57  \internal
    54  \since 4.4
    58  \since 4.4
   128     if(m_dontRun)
   132     if(m_dontRun)
   129         QSKIP("The command line utility is not in the path.", SkipAll);
   133         QSKIP("The command line utility is not in the path.", SkipAll);
   130 
   134 
   131 #ifdef Q_OS_WINCE
   135 #ifdef Q_OS_WINCE
   132     QSKIP("WinCE: This test uses unsupported WinCE functionality", SkipAll);
   136     QSKIP("WinCE: This test uses unsupported WinCE functionality", SkipAll);
       
   137 #elif defined(Q_OS_SYMBIAN)
       
   138     QSKIP("Symbian: This test uses unsupported Symbian functionality (QProcess with std streams)", SkipAll);
   133 #endif
   139 #endif
   134 
   140 
   135     QFETCH(int,         expectedExitCode);
   141     QFETCH(int,         expectedExitCode);
   136     QFETCH(QByteArray,  expectedQueryOutput);
   142     QFETCH(QByteArray,  expectedQueryOutput);
   137     QFETCH(QStringList, arguments);
   143     QFETCH(QStringList, arguments);
   152         QTextStream(stderr) << "stderr:" << process.readAllStandardError();
   158         QTextStream(stderr) << "stderr:" << process.readAllStandardError();
   153 
   159 
   154     QCOMPARE(process.exitCode(), expectedExitCode);
   160     QCOMPARE(process.exitCode(), expectedExitCode);
   155 
   161 
   156     const QByteArray rawProducedStderr((process.readAllStandardError()));
   162     const QByteArray rawProducedStderr((process.readAllStandardError()));
   157     const QString fixedStderr(QString::fromLocal8Bit(rawProducedStderr).remove(m_filenameInStderr));
   163     QString fixedStderr(QString::fromLocal8Bit(rawProducedStderr).remove(m_filenameInStderr));
       
   164     // convert Windows line endings to Unix ones
       
   165     fixedStderr.replace("\r\n", "\n");
   158 
   166 
   159     const QString errorFileName(inputFile(QLatin1String(SRCDIR "stderrBaselines/") +
   167     const QString errorFileName(inputFile(QLatin1String(SRCDIR "stderrBaselines/") +
   160                                           QString::fromUtf8(QTest::currentDataTag()).remove(m_normalizeTestName) +
   168                                           QString::fromUtf8(QTest::currentDataTag()).remove(m_normalizeTestName) +
   161                                           QLatin1String(".txt")));
   169                                           QLatin1String(".txt")));
   162 
   170 
   216     }
   224     }
   217 }
   225 }
   218 
   226 
   219 void tst_XmlPatterns::xquerySupport_data() const
   227 void tst_XmlPatterns::xquerySupport_data() const
   220 {
   228 {
   221 #ifdef Q_OS_WINCE
   229 #if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
   222     return;
   230     return;
   223 #endif
   231 #endif
   224 
   232 
   225     /* Check one file for existence, to avoid possible false positives. */
   233     /* Check one file for existence, to avoid possible false positives. */
   226     QVERIFY(QFile::exists(inputFile(QLatin1String(SRCDIR "queries/onePlusOne.xq"))));
   234     QVERIFY(QFile::exists(inputFile(QLatin1String(SRCDIR "queries/onePlusOne.xq"))));
   847     if(m_dontRun)
   855     if(m_dontRun)
   848         QSKIP("The command line utility is not in the path.", SkipAll);
   856         QSKIP("The command line utility is not in the path.", SkipAll);
   849 
   857 
   850 #ifdef Q_OS_WINCE
   858 #ifdef Q_OS_WINCE
   851     QSKIP("WinCE: This test uses unsupported WinCE functionality", SkipAll);
   859     QSKIP("WinCE: This test uses unsupported WinCE functionality", SkipAll);
       
   860 #elif defined(Q_OS_SYMBIAN)
       
   861     QSKIP("Symbian: This test uses unsupported Symbian functionality (QProcess with std streams)", SkipAll);
   852 #endif
   862 #endif
   853 
   863 
   854     QTest::addColumn<int>("expectedExitCode");
   864     QTest::addColumn<int>("expectedExitCode");
   855     QTest::addColumn<QByteArray>("expectedQueryOutput");
   865     QTest::addColumn<QByteArray>("expectedQueryOutput");
   856     QTest::addColumn<QStringList>("arguments");
   866     QTest::addColumn<QStringList>("arguments");