Added the stop() slot to QIODeviceCopier.
This commit is contained in:
@@ -41,6 +41,7 @@ private Q_SLOTS:
|
||||
|
||||
void testQBuffer();
|
||||
void testQTcpSocket();
|
||||
void testStop();
|
||||
};
|
||||
|
||||
void TestQIODeviceCopier::testQBuffer()
|
||||
@@ -88,5 +89,26 @@ void TestQIODeviceCopier::testQTcpSocket()
|
||||
QCOMPARE(destData, SampleData);
|
||||
}
|
||||
|
||||
void TestQIODeviceCopier::testStop()
|
||||
{
|
||||
QSocketPair pair;
|
||||
QTRY_VERIFY(pair.isConnected());
|
||||
|
||||
QByteArray destData;
|
||||
QBuffer dest(&destData);
|
||||
|
||||
QIODeviceCopier copier(pair.server(), &dest);
|
||||
|
||||
copier.start();
|
||||
|
||||
pair.client()->write(SampleData);
|
||||
QTRY_COMPARE(destData, SampleData);
|
||||
|
||||
copier.stop();
|
||||
|
||||
pair.client()->write(SampleData);
|
||||
QTRY_COMPARE(destData, SampleData);
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestQIODeviceCopier)
|
||||
#include "TestQIODeviceCopier.moc"
|
||||
|
||||
Reference in New Issue
Block a user