Module: wine Branch: master Commit: a61ef431b8fe9593970aff497a6756a231df8657 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a61ef431b8fe9593970aff497a...
Author: Maarten Lankhorst m.b.lankhorst@gmail.com Date: Mon May 5 23:05:08 2008 -0700
netapi32: Fix test crash occuring when NetWkstaUserGetInfo fails.
---
dlls/netapi32/tests/wksta.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/dlls/netapi32/tests/wksta.c b/dlls/netapi32/tests/wksta.c index 5eefba4..01d0d6f 100644 --- a/dlls/netapi32/tests/wksta.c +++ b/dlls/netapi32/tests/wksta.c @@ -80,7 +80,17 @@ static void run_wkstausergetinfo_tests(void)
/* Level 0 */ ok(pNetWkstaUserGetInfo(NULL, 0, (LPBYTE *)&ui0) == NERR_Success, - "NetWkstaUserGetInfo is successful\n"); + "NetWkstaUserGetInfo is unsuccessful\n"); + + ok(ui0 != NULL, "ui0 is NULL\n"); + /* This failure occured when I ran sshd as service and didn't authenticate + * Since the test dereferences ui0, the rest of this test is worthless + */ + if (!ui0) + { + return; + } + ok(!lstrcmpW(user_name, ui0->wkui0_username), "This is really user name\n"); pNetApiBufferSize(ui0, &dwSize); ok(dwSize >= (sizeof(WKSTA_USER_INFO_0) +