[PATCH 1/1] wininet/test: Check null pointer in InternetGetSecurityInfoByURLW

Jacek Caban jacek at codeweavers.com
Tue Jan 9 05:09:27 CST 2018


On 09.01.2018 09:28, Jactry Zeng wrote:
> Hi Wei,
>
> Thanks for contribution!
> I have a question about the tests:
>
> +
> +        SetLastError(0);
> +        res = pInternetGetSecurityInfoByURLA(url, &chain, NULL);
> +        ok_(__FILE__,line)(res && GetLastError() == 0,
> +                           "InternetGetSecurityInfoByURLA failed
> returned: %x(%u), expected success\n", res, GetLastError());
> +
> +        SetLastError(0);
> +        res = pInternetGetSecurityInfoByURLA(url, NULL, &flags);
> +        ok_(__FILE__,line)(res && GetLastError() == 0,
> +                           "InternetGetSecurityInfoByURLA failed
> returned: %x(%u), expected success\n", res, GetLastError());
>      }else {
>
> Why not set last error as 0xdeadbeef in these two tests?


Actually (with a few exceptions when apps really depend on it), it's
better to not test last error on success. Caller should never use it
anyway and it might be polluted by internal calls that we're not
interested in.


Wei, I sent a modified version of your patch. I hope you're fine with
those changes. Thanks for contribution.


Jacek

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20180109/4bb8c38f/attachment.html>


More information about the wine-devel mailing list