From 7a5bb18dc68326537ff0dc81932e715f1d129a83 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 15 Feb 2012 17:56:30 +1000 Subject: Fixed tst_QFile when redirecting stdin/stdout/stderr to/from files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openStandardStreamsBufferedStreams would fail if standard streams were redirected to a file (e.g. ./tst_qfile > testlog.txt). openStandardStreamsFileDescriptors already has a workaround, so apply it here too. Change-Id: Iffe9d7864909e489e77c1114e80c4e3bc70a8722 Reviewed-by: João Abecasis --- tests/auto/corelib/io/qfile/tst_qfile.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/auto/corelib/io/qfile') diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 0ed1b8ed5a..d1a0debf4d 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -3028,25 +3028,28 @@ void tst_QFile::openStandardStreamsBufferedStreams() { QFile in; in.open(stdin, QIODevice::ReadOnly); + if (!in.isSequential()) + QSKIP("Standard input redirected."); QCOMPARE( in.pos(), (qint64)0 ); QCOMPARE( in.size(), (qint64)0 ); - QVERIFY( in.isSequential() ); } { QFile out; out.open(stdout, QIODevice::WriteOnly); + if (!out.isSequential()) + QSKIP("Standard output redirected."); QCOMPARE( out.pos(), (qint64)0 ); QCOMPARE( out.size(), (qint64)0 ); - QVERIFY( out.isSequential() ); } { QFile err; err.open(stderr, QIODevice::WriteOnly); + if (!err.isSequential()) + QSKIP("Standard error redirected."); QCOMPARE( err.pos(), (qint64)0 ); QCOMPARE( err.size(), (qint64)0 ); - QVERIFY( err.isSequential() ); } } -- cgit v1.2.3