Fix MinGW compilation for tst_qwinoverlappedionotifier

Change-Id: I664761e7e6fd1c00067ae1def496ba4974e539be
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
bb10
Jonathan Liu 2012-11-21 21:24:04 +11:00 committed by The Qt Project
parent d429d65628
commit 96361d82c9
1 changed files with 10 additions and 3 deletions

View File

@ -43,6 +43,10 @@
#include <private/qwinoverlappedionotifier_p.h>
#include <qbytearray.h>
#ifndef PIPE_REJECT_REMOTE_CLIENTS
#define PIPE_REJECT_REMOTE_CLIENTS 0x08
#endif
class tst_QWinOverlappedIoNotifier : public QObject
{
Q_OBJECT
@ -141,7 +145,8 @@ void tst_QWinOverlappedIoNotifier::readFile()
notifier.setHandle(hFile);
notifier.setEnabled(true);
OVERLAPPED overlapped = {0};
OVERLAPPED overlapped;
ZeroMemory(&overlapped, sizeof(OVERLAPPED));
QByteArray buffer(readBufferSize, 0);
BOOL readSuccess = ReadFile(hFile, buffer.data(), buffer.size(), NULL, &overlapped);
QVERIFY(readSuccess || GetLastError() == ERROR_IO_PENDING);
@ -175,7 +180,8 @@ void tst_QWinOverlappedIoNotifier::waitForNotified()
notifier.setEnabled(true);
QCOMPARE(notifier.waitForNotified(100, 0), false);
OVERLAPPED overlapped = {0};
OVERLAPPED overlapped;
ZeroMemory(&overlapped, sizeof(OVERLAPPED));
QByteArray buffer(readBufferSize, 0);
BOOL readSuccess = ReadFile(hFile, buffer.data(), buffer.size(), NULL, &overlapped);
QVERIFY(readSuccess || GetLastError() == ERROR_IO_PENDING);
@ -206,7 +212,8 @@ void tst_QWinOverlappedIoNotifier::brokenPipe()
notifier.setHandle(hReadEnd);
notifier.setEnabled(true);
OVERLAPPED overlapped = {0};
OVERLAPPED overlapped;
ZeroMemory(&overlapped, sizeof(OVERLAPPED));
QByteArray buffer(1024, 0);
BOOL readSuccess = ReadFile(hReadEnd, buffer.data(), buffer.size(), NULL, &overlapped);
QVERIFY(readSuccess || GetLastError() == ERROR_IO_PENDING);