Alexandre Julliard : ntdll/tests: Fix the async I/O test on Vista.

Alexandre Julliard julliard at winehq.org
Thu Sep 11 08:01:10 CDT 2008


Module: wine
Branch: master
Commit: a543896382ec6c90687aed5ce1a908d2052dad24
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a543896382ec6c90687aed5ce1a908d2052dad24

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Sep 11 14:18:46 2008 +0200

ntdll/tests: Fix the async I/O test on Vista.

---

 dlls/ntdll/tests/file.c |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index b58b1a7..e4f1d0a 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -377,7 +377,9 @@ static void read_file_test(void)
     offset.QuadPart = 0;
     ResetEvent( event );
     status = pNtReadFile( handle, event, apc, &apc_count, &iosb, buffer, strlen(text) + 10, &offset, NULL );
-    ok( status == STATUS_SUCCESS, "wrong status %x\n", status );
+    ok( status == STATUS_SUCCESS ||
+        status == STATUS_PENDING, /* vista */
+        "wrong status %x\n", status );
     ok( U(iosb).Status == STATUS_SUCCESS, "wrong status %x\n", U(iosb).Status );
     ok( iosb.Information == strlen(text), "wrong info %lu\n", iosb.Information );
     ok( is_signaled( event ), "event is signaled\n" );
@@ -391,13 +393,25 @@ static void read_file_test(void)
     iosb.Information = 0xdeadbeef;
     offset.QuadPart = strlen(text) + 2;
     status = pNtReadFile( handle, event, apc, &apc_count, &iosb, buffer, 2, &offset, NULL );
-    ok( status == STATUS_END_OF_FILE, "wrong status %x\n", status );
-    ok( U(iosb).Status == 0xdeadbabe, "wrong status %x\n", U(iosb).Status );
-    ok( iosb.Information == 0xdeadbeef, "wrong info %lu\n", iosb.Information );
-    ok( !is_signaled( event ), "event is signaled\n" );
-    ok( !apc_count, "apc was called\n" );
-    SleepEx( 1, TRUE ); /* alertable sleep */
-    ok( !apc_count, "apc was called\n" );
+    if (status == STATUS_PENDING)  /* vista */
+    {
+        ok( U(iosb).Status == STATUS_END_OF_FILE, "wrong status %x\n", U(iosb).Status );
+        ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information );
+        ok( is_signaled( event ), "event is signaled\n" );
+        ok( !apc_count, "apc was called\n" );
+        SleepEx( 1, TRUE ); /* alertable sleep */
+        ok( apc_count == 1, "apc was not called\n" );
+    }
+    else
+    {
+        ok( status == STATUS_END_OF_FILE, "wrong status %x\n", status );
+        ok( U(iosb).Status == 0xdeadbabe, "wrong status %x\n", U(iosb).Status );
+        ok( iosb.Information == 0xdeadbeef, "wrong info %lu\n", iosb.Information );
+        ok( !is_signaled( event ), "event is signaled\n" );
+        ok( !apc_count, "apc was called\n" );
+        SleepEx( 1, TRUE ); /* alertable sleep */
+        ok( !apc_count, "apc was called\n" );
+    }
     CloseHandle( handle );
 
     /* now a non-overlapped file */
@@ -407,7 +421,9 @@ static void read_file_test(void)
     iosb.Information = 0xdeadbeef;
     offset.QuadPart = 0;
     pNtWriteFile( handle, event, apc, &apc_count, &iosb, text, strlen(text), &offset, NULL );
-    ok( status == STATUS_END_OF_FILE, "wrong status %x\n", status );
+    ok( status == STATUS_END_OF_FILE ||
+        status == STATUS_PENDING,  /* vista */
+        "wrong status %x\n", status );
     ok( U(iosb).Status == STATUS_SUCCESS, "wrong status %x\n", U(iosb).Status );
     ok( iosb.Information == strlen(text), "wrong info %lu\n", iosb.Information );
     ok( is_signaled( event ), "event is signaled\n" );




More information about the wine-cvs mailing list