diff options
author | Joerg Bornemann <joerg.bornemann@digia.com> | 2012-09-29 17:55:32 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-02 08:05:55 +0200 |
commit | 94dc0c659425f091595dc77c03b9a94f446a65f8 (patch) | |
tree | 83f91700fa24e1fb0d10ce052e90ffe358741e16 /tests/auto/corelib/io | |
parent | d3c24d241e10ae36e768b93607fd3226c48751c6 (diff) |
QWinOverlappedIoNotifier: multiple I/O operations on the same handle
When doing multiple I/O operations on the same handle, we get notified
for every operations. These must be distinguished by comparing the
pointer to the OVERLAPPED struct.
We now pass the OVERLAPPED pointer via the notified signal and let the
receiver decide if it wants to handle this notification.
Change-Id: I4efe70f39c6ae5282b949f2f4b21f6e7dd3df785
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r-- | tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp b/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp index 1de79b18bf..47be60b478 100644 --- a/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp +++ b/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp @@ -157,22 +157,22 @@ void tst_QWinOverlappedIoNotifier::waitForNotified() HANDLE hFile = CreateFile(reinterpret_cast<const wchar_t*>(fileName.utf16()), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); - QCOMPARE(notifier.waitForNotified(0), false); + QCOMPARE(notifier.waitForNotified(0, 0), false); notifier.setHandle(hFile); notifier.setEnabled(true); - QCOMPARE(notifier.waitForNotified(100), false); + QCOMPARE(notifier.waitForNotified(100, 0), false); OVERLAPPED overlapped = {0}; QByteArray buffer(readBufferSize, 0); BOOL readSuccess = ReadFile(hFile, buffer.data(), buffer.size(), NULL, &overlapped); QVERIFY(readSuccess || GetLastError() == ERROR_IO_PENDING); - QCOMPARE(notifier.waitForNotified(3000), true); + QCOMPARE(notifier.waitForNotified(3000, &overlapped), true); CloseHandle(hFile); QCOMPARE(sink.notifications, 1); QCOMPARE(sink.notifiedBytesRead, expectedBytesRead); QCOMPARE(sink.notifiedErrorCode, DWORD(ERROR_SUCCESS)); - QCOMPARE(notifier.waitForNotified(100), false); + QCOMPARE(notifier.waitForNotified(100, &overlapped), false); } void tst_QWinOverlappedIoNotifier::brokenPipe() |