Module: wine Branch: master Commit: 87db683aad87de07f0f3ef8ae5e46d9c624abeca URL: http://source.winehq.org/git/wine.git/?a=commit;h=87db683aad87de07f0f3ef8ae5...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Tue Aug 20 20:21:27 2013 +0900
ntdll/tests: Check WriteFile return values.
---
dlls/ntdll/tests/file.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 77a8431..cc0b5c2 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -505,7 +505,8 @@ static void read_file_test(void) ok( U(iosb).Status == 0xdeadbabe, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 0xdeadbeef, "wrong info %lu\n", iosb.Information ); ok( !apc_count, "apc was called\n" ); - WriteFile( write, buffer, 1, &written, NULL ); + ret = WriteFile( write, buffer, 1, &written, NULL ); + ok(ret && written == 1, "WriteFile error %d\n", GetLastError()); /* iosb updated here by async i/o */ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( U(iosb).Status == 0, "wrong status %x\n", U(iosb).Status ); @@ -530,7 +531,8 @@ static void read_file_test(void) ok( U(iosb).Status == 0xdeadbabe, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 0xdeadbeef, "wrong info %lu\n", iosb.Information ); ok( !apc_count, "apc was called\n" ); - WriteFile( write, buffer, 1, &written, NULL ); + ret = WriteFile( write, buffer, 1, &written, NULL ); + ok(ret && written == 1, "WriteFile error %d\n", GetLastError()); /* iosb updated here by async i/o */ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( U(iosb).Status == 0, "wrong status %x\n", U(iosb).Status ); @@ -548,7 +550,8 @@ static void read_file_test(void) U(iosb).Status = 0xdeadbabe; iosb.Information = 0xdeadbeef; ResetEvent( event ); - WriteFile( write, buffer, 1, &written, NULL ); + ret = WriteFile( write, buffer, 1, &written, NULL ); + ok(ret && written == 1, "WriteFile error %d\n", GetLastError()); status = pNtReadFile( read, event, apc, &apc_count, &iosb, buffer, 1, NULL, NULL ); ok( status == STATUS_SUCCESS, "wrong status %x\n", status ); ok( U(iosb).Status == 0, "wrong status %x\n", U(iosb).Status ); @@ -571,7 +574,8 @@ static void read_file_test(void) ok( U(iosb).Status == 0xdeadbabe, "wrong status %x\n", U(iosb).Status ); ok( iosb.Information == 0xdeadbeef, "wrong info %lu\n", iosb.Information ); ok( !apc_count, "apc was called\n" ); - WriteFile( write, buffer, 1, &written, NULL ); + ret = WriteFile( write, buffer, 1, &written, NULL ); + ok(ret && written == 1, "WriteFile error %d\n", GetLastError()); /* partial read is good enough */ Sleep(1); /* FIXME: needed for wine to run the i/o apc */ ok( is_signaled( event ), "event is signaled\n" );