summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qtextstream
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-10-04 11:51:31 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-05 03:04:31 +0200
commit7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6 (patch)
tree5df8fca668dace17eea7b6c5ed82db8e87180105 /tests/auto/corelib/io/qtextstream
parentc46f59fadf63b661d8611e5896f09fb85c17a00c (diff)
Avoid using QSKIP in lieu of compile-time checks
QSKIP is intended to be used to skip test functions that are found at run-time to be inapplicable or unsafe. If a test function can be determined to be inapplicable at compile-time, the entire test function should be omitted instead of replacing the body of the test function with a QSKIP, which only serves to slow down test runs and to inflate test run-rates with empty, inapplicable tests. Task-number: QTQAINFRA-278 Change-Id: Ib2025339422749cf216e87ac414a3056250bf8f9 Reviewed-on: http://codereview.qt-project.org/5942 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> 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.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
index 1348e6d6c7..5ab71de9d1 100644
--- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
@@ -198,16 +198,20 @@ 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();
@@ -1103,6 +1107,9 @@ void tst_QTextStream::ws_manipulator()
}
// ------------------------------------------------------------------------------
+
+// Qt/CE: Cannot test network on emulator.
+#ifndef Q_OS_WINCE
void tst_QTextStream::stillOpenWhenAtEnd()
{
int argc = 0;
@@ -1116,9 +1123,6 @@ void tst_QTextStream::stillOpenWhenAtEnd()
while (!stream.readLine().isNull()) {}
QVERIFY(file.isOpen());
-#ifdef Q_OS_WINCE
- QSKIP("Qt/CE: Cannot test network on emulator", SkipAll);
-#endif
QTcpSocket socket;
socket.connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(socket.waitForReadyRead(5000));
@@ -1127,6 +1131,7 @@ void tst_QTextStream::stillOpenWhenAtEnd()
while (!stream2.readLine().isNull()) {}
QVERIFY(socket.isOpen());
}
+#endif
// ------------------------------------------------------------------------------
void tst_QTextStream::readNewlines_data()
@@ -1397,11 +1402,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", SkipAll);
-#endif
QProcess stdinProcess;
stdinProcess.start("stdinProcess/stdinProcess");
stdinProcess.setReadChannel(QProcess::StandardError);
@@ -1421,13 +1426,14 @@ 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", SkipAll);
-#endif
QProcess stdinProcess;
stdinProcess.start("readAllStdinProcess/readAllStdinProcess", QIODevice::ReadWrite | QIODevice::Text);
stdinProcess.setReadChannel(QProcess::StandardError);
@@ -1442,13 +1448,14 @@ 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", SkipAll);
-#endif
QProcess stdinProcess;
stdinProcess.start("readLineStdinProcess/readLineStdinProcess", QIODevice::ReadWrite | QIODevice::Text);
stdinProcess.setReadChannel(QProcess::StandardError);
@@ -1465,6 +1472,7 @@ void tst_QTextStream::readLineFromStdin()
QVERIFY(stdinProcess.waitForFinished(5000));
}
+#endif
// ------------------------------------------------------------------------------
void tst_QTextStream::read()