RFC: patch to advapi32's cred tests

Rob Shearman robertshearman at gmail.com
Fri Feb 13 11:54:11 CST 2009


2009/2/13 Juan Lang <juan.lang at gmail.com>:
> Hi all, I've written a patch which should fix the failing advapi32
> cred tests that mirrors the skips in the existing tests:
>
> diff --git a/dlls/advapi32/tests/cred.c b/dlls/advapi32/tests/cred.c
> index 58103c6..bb6935b 100644
> --- a/dlls/advapi32/tests/cred.c
> +++ b/dlls/advapi32/tests/cred.c
> @@ -238,7 +238,13 @@ static void test_generic(void)
>     new_cred.UserName = (char *)"winetest";
>
>     ret = pCredWriteA(&new_cred, 0);
> -    ok(ret, "CredWriteA failed with error %d\n", GetLastError());
> +    ok(ret || broken(GetLastError() == ERROR_NO_SUCH_LOGON_SESSION),
> +       "CredWriteA failed with error %d\n", GetLastError());
> +    if (!ret)
> +    {
> +        skip("couldn't write generic credentials, skipping tests\n");
> +        return;
> +    }
>
>     ret = pCredEnumerateA(NULL, 0, &count, &creds);
>     ok(ret, "CredEnumerateA failed with error %d\n", GetLastError());
>
> I'm wondering whether a better patch would be to change the persist
> type from CRED_PERSIST_ENTERPRISE to CRED_PERSIST_LOCAL_MACHINE.  Rob,
> this is particularly aimed at you since you wrote the original tests:
> is there a good reason to use CRED_PERSIST_ENTERPRISE here?

No, CRED_PERSIST_LOCAL_MACHINE should be fine but does this change
make any difference? I believe the ERROR_NO_SUCH_LOGON_SESSION is
returned when the tests are being run as a user that doesn't have a
profile, and therefore the credentials manager doesn't have anywhere
to store the credentials. Changing the persist type shouldn't affect
this, so I don't see why it would make these calls start working.

-- 
Rob Shearman



More information about the wine-devel mailing list