summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-10-06 18:56:31 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-07 04:30:30 +0200
commit924d810dbdcd5b5b0fa860922b2487ea9062d002 (patch)
treeb14117ac5b9a2d8d02a502adbd00b94ba5eef424 /tests/auto/corelib/io
parent13251dcaea443d2f228fc797e54318191048e588 (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: I95feba3edbfa092c0ef4d85bb8c6877bd6be698e Reviewed-on: http://codereview.qt-project.org/6128 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')
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp7
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp10
2 files changed, 9 insertions, 8 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 5d976896d8..d4f99c5d74 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -609,10 +609,10 @@ void tst_QFile::size()
fclose(stream);
}
+ // Currently low level file I/O is not well supported on Windows CE, so
+ // skip this part of the test.
+#ifndef Q_OS_WINCE
{
-#ifdef Q_OS_WINCE
- QSKIP("Currently low level file I/O not well supported on Windows CE", SkipSingle);
-#endif
QFile f;
int fd = QT_OPEN(filename.toLocal8Bit().constData(), QT_OPEN_RDONLY);
@@ -624,6 +624,7 @@ void tst_QFile::size()
f.close();
QT_CLOSE(fd);
}
+#endif
}
void tst_QFile::sizeNoExist()
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index c6a5f39319..d28efd8934 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -170,6 +170,8 @@ private slots:
void detachedWorkingDirectoryAndPid();
#ifndef Q_OS_WINCE
void switchReadChannels();
+#endif
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
void setWorkingDirectory();
#endif
void startFinishStartFinish();
@@ -2188,8 +2190,9 @@ void tst_QProcess::switchReadChannels()
//-----------------------------------------------------------------------------
-// Windows CE does not support working directory logic.
-#ifndef Q_OS_WINCE
+// Windows CE does not support working directory logic, and
+// setWorkingDirectory will chdir before starting the process on unices.
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
void tst_QProcess::setWorkingDirectory()
{
process = new QProcess;
@@ -2199,9 +2202,6 @@ void tst_QProcess::setWorkingDirectory()
#else
process->start("testSetWorkingDirectory/testSetWorkingDirectory");
#endif
-#ifndef Q_OS_WIN
- QSKIP("setWorkingDirectory will chdir before starting the process on unices", SkipAll);
-#endif
QVERIFY(process->waitForFinished());
QByteArray workingDir = process->readAllStandardOutput();