Re: netapi32: Add test for adding/deleting users.
Kai Blin wrote:
+ ret = pNetUserAdd(NULL, 1, (LPBYTE)&usri, NULL); + if(ret == ERROR_ACCESS_DENIED) + { + skip("Insufficient permissions to add users. Skipping test.\n"); + return; + } + if(ret == NERR_UserExists) + { + skip("User already exists, skipping test to not mess up the system\n"); + return; + } + + ok(ret == NERR_Success, "Adding user failed with error 0x%08x\n", ret); + if(ret != NERR_Success) + { + skip("As adding the user failed, skip the change password and userdel " + "tests\n"); + return; + }
The skip here is pointless. The test failure will already signal that something unexpected happened.
+ + ret = pNetUserChangePassword(NULL, sTestUserName, sTestUserOldPass, + sTestUserNewPass); + + if(ret == ERROR_ACCESS_DENIED) + { + skip("Insufficient permissions to change password, skipping test.\n"); + } + else + { + todo_wine ok(ret == NERR_Success, "Changing the password failed.\n"); + } + + ret = pNetUserDel(NULL, sTestUserName); + + if(ret == ERROR_ACCESS_DENIED) + { + skip("Failed to delete user. You need to manually delete the user.\n"); + } + else + { + todo_wine ok(ret == NERR_Success, "Deleting the user failed.\n"); + } +}
I think it is reasonable to assume that if the user add the rights to add a user then they will have the rights to change the password and to delete it, so the skip statements seem unnecessary. -- Rob Shearman
participants (1)
-
Robert Shearman