netapi32/tests: Adding a user with a too long name succeeds on NT4.

This commit is contained in:
Paul Vriens 2008-02-14 14:35:47 +01:00 committed by Alexandre Julliard
parent ab820ef24c
commit dd8fe5a973
1 changed files with 15 additions and 2 deletions

View File

@ -244,7 +244,17 @@ static void run_userhandling_tests(void)
usri.usri1_password = sTestUserOldPass;
ret = pNetUserAdd(NULL, 1, (LPBYTE)&usri, NULL);
ok(ret == NERR_BadUsername, "Adding user with too long username returned 0x%08x\n", ret);
if (ret == NERR_Success || ret == NERR_UserExists)
{
/* Windows NT4 does create the user. Delete the user and also if it already existed
* due to a previous test run on NT4.
*/
trace("We are on NT4, we have to delete the user with the too long username\n");
ret = pNetUserDel(NULL, sTooLongName);
ok(ret == NERR_Success, "Deleting the user failed : %d\n", ret);
}
else
ok(ret == NERR_BadUsername, "Adding user with too long username returned 0x%08x\n", ret);
usri.usri1_name = sTestUserName;
usri.usri1_password = sTooLongPassword;
@ -256,7 +266,10 @@ static void run_userhandling_tests(void)
usri.usri1_password = sTooLongPassword;
ret = pNetUserAdd(NULL, 1, (LPBYTE)&usri, NULL);
ok(ret == NERR_BadUsername,
/* NT4 doesn't have a problem with the username so it will report the too long password
* as the error. NERR_PasswordTooShort is reported for all kind of password related errors.
*/
ok(ret == NERR_BadUsername || ret == NERR_PasswordTooShort,
"Adding user with too long username/password returned 0x%08x\n", ret);
usri.usri1_name = sTestUserName;