tst_qprocess cleanup

Give setStandardOutputFile2 a sensible name, move it to where it
belongs and remove bogus Q_OS_WINCE ifdef.

Change-Id: I5c843e8b6cb626979966f3e61f7a7c720173bb28
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Joerg Bornemann 2015-07-28 14:40:02 +02:00
parent 507625d984
commit 734557bb84

View File

@ -117,7 +117,7 @@ private slots:
void setStandardInputFile();
void setStandardOutputFile_data();
void setStandardOutputFile();
void setStandardOutputFile2();
void setStandardOutputFileNullDevice();
void setStandardOutputFileAndWaitForBytesWritten();
void setStandardOutputProcess_data();
void setStandardOutputProcess();
@ -2005,22 +2005,6 @@ void tst_QProcess::setStandardOutputFile_data()
}
//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
void tst_QProcess::setStandardOutputFile2()
{
static const char testdata[] = "Test data.";
QProcess process;
process.setStandardOutputFile(QProcess::nullDevice());
process.start("testProcessEcho2/testProcessEcho2");
process.write(testdata, sizeof testdata);
QPROCESS_VERIFY(process,waitForFinished());
QCOMPARE(process.bytesAvailable(), Q_INT64_C(0));
QVERIFY(!QFileInfo(QProcess::nullDevice()).isFile());
}
#endif
void tst_QProcess::setStandardOutputFile()
{
static const char data[] = "Original data. ";
@ -2070,6 +2054,20 @@ void tst_QProcess::setStandardOutputFile()
QCOMPARE(all.size(), expectedsize);
}
void tst_QProcess::setStandardOutputFileNullDevice()
{
static const char testdata[] = "Test data.";
QProcess process;
process.setStandardOutputFile(QProcess::nullDevice());
process.start("testProcessEcho2/testProcessEcho2");
process.write(testdata, sizeof testdata);
QPROCESS_VERIFY(process,waitForFinished());
QCOMPARE(process.bytesAvailable(), Q_INT64_C(0));
QVERIFY(!QFileInfo(QProcess::nullDevice()).isFile());
}
void tst_QProcess::setStandardOutputFileAndWaitForBytesWritten()
{
static const char testdata[] = "Test data.";