[PATCH 1/2] setupapi/tests: Add error tests for SetupDiDestroyDeviceInfoList.

Jeff Smith whydoubt at gmail.com
Sun Jun 7 01:19:47 CDT 2020


On Sat, Jun 6, 2020, 11:45 PM Dmitry Timoshkov <dmitry at baikal.ru> wrote:

> Jeff Smith <whydoubt at gmail.com> wrote:
>
> > +    SetLastError(0xcafef00d);
>
> Please use a commonly accepted value of 0xdeadbeef.
>
> > +    ret = SetupDiDestroyDeviceInfoList(set);
> > +    ok(ret, "Failed to destroy device list, error %#x.\n",
> GetLastError());
> > +    todo_wine ok(!ret || !GetLastError(), "Got unexpected error
> %#x.\n", GetLastError());
>
> These two ok() calls contradict each other (here and in other places).
> ok() should accept either ret or !ret, last error should be tested
> separately.
>

The first message is triggered if ret is FALSE. The second message is
triggered if ret is TRUE but GetLastError() returns a non-zero value.
The second message seems redundant in the case that ret is FALSE, but maybe
I am overthinking it.

Thanks,
Jeff

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200607/14ad222b/attachment.htm>


More information about the wine-devel mailing list