From 8596fdfe4471b4e6c38fd8d2b28a9b745bac010b Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Mon, 5 May 2008 23:05:08 -0700 Subject: [PATCH] netapi32: Fix test crash occuring when in a specific situation --- dlls/netapi32/tests/wksta.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/netapi32/tests/wksta.c b/dlls/netapi32/tests/wksta.c index 5eefba4..e16b807 100644 --- a/dlls/netapi32/tests/wksta.c +++ b/dlls/netapi32/tests/wksta.c @@ -79,8 +79,16 @@ static void run_wkstausergetinfo_tests(void) DWORD dwSize; /* Level 0 */ - ok(pNetWkstaUserGetInfo(NULL, 0, (LPBYTE *)&ui0) == NERR_Success, - "NetWkstaUserGetInfo is successful\n"); + ok(pNetWkstaUserGetInfo(NULL, 0, (LPBYTE *)&ui0) == NERR_Success && ui0, + "NetWkstaUserGetInfo is unsuccessful\n"); + + /* This failure occured when I ran sshd as service and didn't authenticate */ + if (!ui0) + { + skip("Failed, to obtain a structure, tests are probably useless\n"); + return; + } + ok(!lstrcmpW(user_name, ui0->wkui0_username), "This is really user name\n"); pNetApiBufferSize(ui0, &dwSize); ok(dwSize >= (sizeof(WKSTA_USER_INFO_0) + -- 1.5.4.1