diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-11-15 11:36:18 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-18 01:51:57 +0100 |
commit | a8fd0c3654f8352773638633778cd8003680cbc7 (patch) | |
tree | 4815cca9daf879b96a92a3de95621b56ac5ba868 /tests/auto/corelib/io/qtextstream | |
parent | d90d57bb8b995c7a66e7f9b7b2515447fbe11de0 (diff) |
Don't depend on moc to disable test functions.
The moc tool is not aware of all defines (particularly those that are
compiler builtins) and does not correctly evaluate others that depend
on compiler builtins, such as Q_OS_FOO.
This commit reverts parts of the following commits, but is not a
complete fix as there were many instances of this problem in the tests
prior to those commits:
924d810dbdcd5b5b0fa860922b2487ea9062d002
8aaff6751038b88d17e23be6fcee945771297c5b
338d3f11973412047c2c9cd41cbd0c961d738ef3
a55034062ba2bf73a9f1ed3d9cf31745b38149e3
253497b7446c7d723aa3bdd7152e25d6852f2604
7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6
9d2ff58f3642828e494e7e9b2df7dbb8e2cd408f
0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b
Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/io/qtextstream')
-rw-r--r-- | tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index 4a814799da..a2e8006951 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -188,20 +188,16 @@ private slots: void octTest(); void zeroTermination(); void ws_manipulator(); -#ifndef Q_OS_WINCE void stillOpenWhenAtEnd(); -#endif void readNewlines_data(); void readNewlines(); void seek(); void pos(); void pos2(); void pos3LargeFile(); -#ifndef Q_OS_WINCE void readStdin(); void readAllFromStdin(); void readLineFromStdin(); -#endif void read(); void qbool(); void forcePoint(); @@ -1085,9 +1081,6 @@ void tst_QTextStream::ws_manipulator() } // ------------------------------------------------------------------------------ - -// Qt/CE: Cannot test network on emulator. -#ifndef Q_OS_WINCE void tst_QTextStream::stillOpenWhenAtEnd() { int argc = 0; @@ -1101,6 +1094,9 @@ void tst_QTextStream::stillOpenWhenAtEnd() while (!stream.readLine().isNull()) {} QVERIFY(file.isOpen()); +#ifdef Q_OS_WINCE + QSKIP("Qt/CE: Cannot test network on emulator"); +#endif QTcpSocket socket; socket.connectToHost(QtNetworkSettings::serverName(), 143); QVERIFY(socket.waitForReadyRead(5000)); @@ -1109,7 +1105,6 @@ void tst_QTextStream::stillOpenWhenAtEnd() while (!stream2.readLine().isNull()) {} QVERIFY(socket.isOpen()); } -#endif // ------------------------------------------------------------------------------ void tst_QTextStream::readNewlines_data() @@ -1380,11 +1375,11 @@ void tst_QTextStream::pos3LargeFile() } // ------------------------------------------------------------------------------ - -// Qt/CE has no stdin/out support for processes. -#ifndef Q_OS_WINCE void tst_QTextStream::readStdin() { +#if defined(Q_OS_WINCE) + QSKIP("Qt/CE has no stdin/out support for processes"); +#endif QProcess stdinProcess; stdinProcess.start("stdinProcess/stdinProcess"); stdinProcess.setReadChannel(QProcess::StandardError); @@ -1404,14 +1399,13 @@ void tst_QTextStream::readStdin() QCOMPARE(b, 2); QCOMPARE(c, 3); } -#endif // ------------------------------------------------------------------------------ - -// Qt/CE has no stdin/out support for processes. -#ifndef Q_OS_WINCE void tst_QTextStream::readAllFromStdin() { +#if defined(Q_OS_WINCE) + QSKIP("Qt/CE has no stdin/out support for processes"); +#endif QProcess stdinProcess; stdinProcess.start("readAllStdinProcess/readAllStdinProcess", QIODevice::ReadWrite | QIODevice::Text); stdinProcess.setReadChannel(QProcess::StandardError); @@ -1426,14 +1420,13 @@ void tst_QTextStream::readAllFromStdin() QChar quoteChar('"'); QCOMPARE(stream.readAll(), QString::fromLatin1("%1hello world%2 \n").arg(quoteChar).arg(quoteChar)); } -#endif // ------------------------------------------------------------------------------ - -// Qt/CE has no stdin/out support for processes. -#ifndef Q_OS_WINCE void tst_QTextStream::readLineFromStdin() { +#if defined(Q_OS_WINCE) + QSKIP("Qt/CE has no stdin/out support for processes"); +#endif QProcess stdinProcess; stdinProcess.start("readLineStdinProcess/readLineStdinProcess", QIODevice::ReadWrite | QIODevice::Text); stdinProcess.setReadChannel(QProcess::StandardError); @@ -1450,7 +1443,6 @@ void tst_QTextStream::readLineFromStdin() QVERIFY(stdinProcess.waitForFinished(5000)); } -#endif // ------------------------------------------------------------------------------ void tst_QTextStream::read() |