summaryrefslogtreecommitdiffstats
path: root/tests/auto/qfile/tst_qfile.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-19 10:55:45 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-19 10:55:57 (GMT)
commit8415ced03461fa4d3d9f915da0251760bd0a7202 (patch)
treef960fd9827f85434053559f7d59e0afb528bf9ce /tests/auto/qfile/tst_qfile.cpp
parent132a42c28e35ac69a5af8c2b7d478b86e92b87e4 (diff)
parent80dfb33cc5fec8fd19e78a959e02588ce58736ee (diff)
downloadQt-8415ced03461fa4d3d9f915da0251760bd0a7202.zip
Qt-8415ced03461fa4d3d9f915da0251760bd0a7202.tar.gz
Qt-8415ced03461fa4d3d9f915da0251760bd0a7202.tar.bz2
Merge upstream/4.6 into oslo-staging-2/4.6
Diffstat (limited to 'tests/auto/qfile/tst_qfile.cpp')
-rw-r--r--tests/auto/qfile/tst_qfile.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/auto/qfile/tst_qfile.cpp b/tests/auto/qfile/tst_qfile.cpp
index b3d6fd9..cf46ce1 100644
--- a/tests/auto/qfile/tst_qfile.cpp
+++ b/tests/auto/qfile/tst_qfile.cpp
@@ -210,6 +210,7 @@ private slots:
void task167217();
void openDirectory();
+ void writeNothing();
public:
// disabled this test for the moment... it hangs
@@ -750,6 +751,7 @@ void tst_QFile::readAllStdin()
QProcess process;
process.start("stdinprocess/stdinprocess all");
+ QVERIFY( process.waitForStarted() );
for (int i = 0; i < 5; ++i) {
QTest::qWait(1000);
process.write(lotsOfData);
@@ -2489,13 +2491,13 @@ void tst_QFile::readEof()
}
QByteArray ret = file.read(10);
- QVERIFY(ret.isNull());
+ QVERIFY(ret.isEmpty());
QVERIFY(file.error() == QFile::NoError);
QVERIFY(file.atEnd());
// Do it again to ensure that we get the same result
ret = file.read(10);
- QVERIFY(ret.isNull());
+ QVERIFY(ret.isEmpty());
QVERIFY(file.error() == QFile::NoError);
QVERIFY(file.atEnd());
}
@@ -2840,5 +2842,16 @@ void tst_QFile::openStandardStreams()
}
}
+void tst_QFile::writeNothing()
+{
+ for (int i = 0; i < 3; ++i) {
+ QFile file("file.txt");
+ QVERIFY( openFile(file, QIODevice::WriteOnly | QIODevice::Unbuffered, FileType(i)) );
+ QVERIFY( 0 == file.write((char *)0, 0) );
+ QCOMPARE( file.error(), QFile::NoError );
+ closeFile(file);
+ }
+}
+
QTEST_MAIN(tst_QFile)
#include "tst_qfile.moc"