ntdll/tests: Don't test function directly when reporting GetLastError().

This commit is contained in:
André Hentschel 2010-12-28 21:10:40 +01:00 committed by Alexandre Julliard
parent 2774d40463
commit ba1f962d10
3 changed files with 12 additions and 8 deletions

View file

@ -71,9 +71,10 @@ static const int max_test_dir_size = 20; /* size of above plus some for .. etc
static void set_up_attribute_test(const char *testdirA)
{
int i;
BOOL ret;
ok(CreateDirectoryA(testdirA, NULL),
"couldn't create dir '%s', error %d\n", testdirA, GetLastError());
ret = CreateDirectoryA(testdirA, NULL);
ok(ret, "couldn't create dir '%s', error %d\n", testdirA, GetLastError());
for (i=0; testfiles[i].name; i++) {
char buf[MAX_PATH];
@ -82,8 +83,8 @@ static void set_up_attribute_test(const char *testdirA)
sprintf(buf, "%s\\%s", testdirA, testfiles[i].name);
testfiles[i].nfound = 0;
if (testfiles[i].attr & FILE_ATTRIBUTE_DIRECTORY) {
ok(CreateDirectoryA(buf, NULL),
"couldn't create dir '%s', error %d\n", buf, GetLastError());
ret = CreateDirectoryA(buf, NULL);
ok(ret, "couldn't create dir '%s', error %d\n", buf, GetLastError());
} else {
HANDLE h = CreateFileA(buf,
GENERIC_READ|GENERIC_WRITE,

View file

@ -828,8 +828,10 @@ static void test_debugger(void)
} while (de.dwDebugEventCode != EXIT_PROCESS_DEBUG_EVENT);
winetest_wait_child_process( pi.hProcess );
ok(CloseHandle(pi.hThread) != 0, "error %u\n", GetLastError());
ok(CloseHandle(pi.hProcess) != 0, "error %u\n", GetLastError());
ret = CloseHandle(pi.hThread);
ok(ret, "error %u\n", GetLastError());
ret = CloseHandle(pi.hProcess);
ok(ret, "error %u\n", GetLastError());
return;
}

View file

@ -456,6 +456,7 @@ static void read_file_test(void)
char buffer[128];
LARGE_INTEGER offset;
HANDLE event = CreateEventA( NULL, TRUE, FALSE, NULL );
BOOL ret;
buffer[0] = 1;
@ -599,8 +600,8 @@ static void read_file_test(void)
CloseHandle( read );
if (!create_pipe( &read, &write, FILE_FLAG_OVERLAPPED, 4096 )) return;
ok(DuplicateHandle(GetCurrentProcess(), read, GetCurrentProcess(), &handle, 0, TRUE, DUPLICATE_SAME_ACCESS),
"Failed to duplicate handle: %d\n", GetLastError());
ret = DuplicateHandle(GetCurrentProcess(), read, GetCurrentProcess(), &handle, 0, TRUE, DUPLICATE_SAME_ACCESS);
ok(ret, "Failed to duplicate handle: %d\n", GetLastError());
apc_count = 0;
U(iosb).Status = 0xdeadbabe;