summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r--tests/auto/corelib/io/largefile/tst_largefile.cpp12
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp17
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp10
-rw-r--r--tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp16
4 files changed, 40 insertions, 15 deletions
diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp
index c1c4b5ea46..0a28ee7b9c 100644
--- a/tests/auto/corelib/io/largefile/tst_largefile.cpp
+++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp
@@ -407,11 +407,11 @@ void tst_LargeFile::fdPositioning()
file.close();
- QCOMPARE( QT_LSEEK(fd_, QT_OFF_T(0), SEEK_SET), QT_OFF_T(0) );
- QCOMPARE( QT_LSEEK(fd_, QT_OFF_T(position), SEEK_SET), QT_OFF_T(position) );
+ QCOMPARE( QT_OFF_T(QT_LSEEK(fd_, QT_OFF_T(0), SEEK_SET)), QT_OFF_T(0) );
+ QCOMPARE( QT_OFF_T(QT_LSEEK(fd_, QT_OFF_T(position), SEEK_SET)), QT_OFF_T(position) );
QVERIFY( file.open(fd_, QIODevice::ReadOnly) );
- QCOMPARE( QT_LSEEK(fd_, QT_OFF_T(0), SEEK_CUR), QT_OFF_T(position) );
+ QCOMPARE( QT_OFF_T(QT_LSEEK(fd_, QT_OFF_T(0), SEEK_CUR)), QT_OFF_T(position) );
QCOMPARE( file.pos(), position );
QVERIFY( file.seek(0) );
QCOMPARE( file.pos(), (qint64)0 );
@@ -438,12 +438,12 @@ void tst_LargeFile::streamPositioning()
file.close();
QVERIFY( !QT_FSEEK(stream_, QT_OFF_T(0), SEEK_SET) );
- QCOMPARE( QT_FTELL(stream_), QT_OFF_T(0) );
+ QCOMPARE( QT_OFF_T(QT_FTELL(stream_)), QT_OFF_T(0) );
QVERIFY( !QT_FSEEK(stream_, QT_OFF_T(position), SEEK_SET) );
- QCOMPARE( QT_FTELL(stream_), QT_OFF_T(position) );
+ QCOMPARE( QT_OFF_T(QT_FTELL(stream_)), QT_OFF_T(position) );
QVERIFY( file.open(stream_, QIODevice::ReadOnly) );
- QCOMPARE( QT_FTELL(stream_), QT_OFF_T(position) );
+ QCOMPARE( QT_OFF_T(QT_FTELL(stream_)), QT_OFF_T(position) );
QCOMPARE( file.pos(), position );
QVERIFY( file.seek(0) );
QCOMPARE( file.pos(), (qint64)0 );
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index a0609d67ac..98963108be 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -139,7 +139,7 @@ private slots:
void readAll_data();
void readAll();
void readAllBuffer();
-#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
+#if !defined(Q_OS_WINCE)
void readAllStdin();
void readLineStdin();
void readLineStdin_lineByLine();
@@ -868,9 +868,12 @@ void tst_QFile::readAllBuffer()
QFile::remove(fileName);
}
-#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
+#if !defined(Q_OS_WINCE)
void tst_QFile::readAllStdin()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QByteArray lotsOfData(1024, '@'); // 10 megs
QProcess process;
@@ -887,11 +890,14 @@ void tst_QFile::readAllStdin()
process.closeWriteChannel();
process.waitForFinished();
QCOMPARE(process.readAll().size(), lotsOfData.size() * 5);
+#endif
}
void tst_QFile::readLineStdin()
{
-
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QByteArray lotsOfData(1024, '@'); // 10 megs
for (int i = 0; i < lotsOfData.size(); ++i) {
if ((i % 32) == 31)
@@ -926,10 +932,14 @@ void tst_QFile::readLineStdin()
QCOMPARE(char(array[i]), char('0' + i % 32));
}
}
+#endif
}
void tst_QFile::readLineStdin_lineByLine()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
for (int i = 0; i < 2; ++i) {
QProcess process;
process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"),
@@ -949,6 +959,7 @@ void tst_QFile::readLineStdin_lineByLine()
process.closeWriteChannel();
QVERIFY(process.waitForFinished(5000));
}
+#endif
}
#endif
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index 05546eb2b7..62e183f619 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -219,10 +219,8 @@ private slots:
void fileTimes();
void fileTimes_oldFile();
-#ifndef Q_NO_SYMLINKS
void isSymLink_data();
void isSymLink();
-#endif
void isHidden_data();
void isHidden();
@@ -1206,9 +1204,9 @@ void tst_QFileInfo::fileTimes_oldFile()
#endif
}
-#ifndef Q_NO_SYMLINKS
void tst_QFileInfo::isSymLink_data()
{
+#ifndef Q_NO_SYMLINKS
QFile::remove("link.lnk");
QFile::remove("brokenlink.lnk");
QFile::remove("dummyfile");
@@ -1228,10 +1226,14 @@ void tst_QFileInfo::isSymLink_data()
QTest::newRow("existent file") << m_sourceFile << false << "";
QTest::newRow("link") << "link.lnk" << true << QFileInfo(m_sourceFile).absoluteFilePath();
QTest::newRow("broken link") << "brokenlink.lnk" << true << QFileInfo("dummyfile").absoluteFilePath();
+#endif
}
void tst_QFileInfo::isSymLink()
{
+#ifdef Q_NO_SYMLINKS
+ QSKIP("No symlink support", SkipAll);
+#else
QFETCH(QString, path);
QFETCH(bool, isSymLink);
QFETCH(QString, linkTarget);
@@ -1239,8 +1241,8 @@ void tst_QFileInfo::isSymLink()
QFileInfo fi(path);
QCOMPARE(fi.isSymLink(), isSymLink);
QCOMPARE(fi.symLinkTarget(), linkTarget);
-}
#endif
+}
void tst_QFileInfo::isHidden_data()
{
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
index 63d07a7ce3..aa7a3762ce 100644
--- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
@@ -187,7 +187,7 @@ private slots:
void pos();
void pos2();
void pos3LargeFile();
-#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
+#if !defined(Q_OS_WINCE)
void readStdin();
void readAllFromStdin();
void readLineFromStdin();
@@ -1484,9 +1484,12 @@ void tst_QTextStream::pos3LargeFile()
// ------------------------------------------------------------------------------
// Qt/CE has no stdin/out support for processes
-#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
+#if !defined(Q_OS_WINCE)
void tst_QTextStream::readStdin()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QProcess stdinProcess;
stdinProcess.start("stdinProcess/stdinProcess");
stdinProcess.setReadChannel(QProcess::StandardError);
@@ -1505,12 +1508,16 @@ void tst_QTextStream::readStdin()
QCOMPARE(a, 1);
QCOMPARE(b, 2);
QCOMPARE(c, 3);
+#endif
}
// ------------------------------------------------------------------------------
// Qt/CE has no stdin/out support for processes
void tst_QTextStream::readAllFromStdin()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QProcess stdinProcess;
stdinProcess.start("readAllStdinProcess/readAllStdinProcess", QIODevice::ReadWrite | QIODevice::Text);
stdinProcess.setReadChannel(QProcess::StandardError);
@@ -1523,12 +1530,16 @@ void tst_QTextStream::readAllFromStdin()
QVERIFY(stdinProcess.waitForFinished(5000));
QCOMPARE(stream.readAll(), QString::fromLatin1("hello world\n"));
+#endif
}
// ------------------------------------------------------------------------------
// Qt/CE has no stdin/out support for processes
void tst_QTextStream::readLineFromStdin()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QProcess stdinProcess;
stdinProcess.start("readLineStdinProcess/readLineStdinProcess", QIODevice::ReadWrite | QIODevice::Text);
stdinProcess.setReadChannel(QProcess::StandardError);
@@ -1544,6 +1555,7 @@ void tst_QTextStream::readLineFromStdin()
stdinProcess.closeWriteChannel();
QVERIFY(stdinProcess.waitForFinished(5000));
+#endif
}
#endif