summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-11-18 15:39:46 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2009-11-18 15:39:46 +0100
commite2a6bf8d1c69d86c939aafcf357d60dcaa5f3d42 (patch)
treea121e872fd29a1820300b11a0261bf4ac78482e9 /tests
parent7b41d3937c4521ba74b421da26d3a61a7aa4aa6e (diff)
parentcb5e66d1d43c0cf452aff0e437a2ea9011c6b659 (diff)
Merge remote branch 'staging/4.6' into 4.6
Conflicts: configure.exe
Diffstat (limited to 'tests')
-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 b3d6fd917e..cf46ce1616 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"