user32: Improve the LoadImage() test.
Rob Shearman
robertshearman at gmail.com
Thu Nov 27 09:38:12 CST 2008
2008/11/27 Dmitry Timoshkov <dmitry at codeweavers.com>:
> "Andrew Riedi" <andrewriedi at gmail.com> wrote:
>> + /* Test loading an icon as an icon. */
>> + SetLastError(0xdeadbeef);
>> + handle = LoadImageA(NULL, "icon.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
>> + ok(handle != NULL, "LoadImage() failed.\n");
>> + error = GetLastError();
>> + ok(error == 0 ||
>> + broken(error == 0xdeadbeef) || /* Win9x */
>> + broken(error == ERROR_BAD_PATHNAME), /* Win98, WinMe */
>> + "Last error: %u\n", error);
>
> There is no point in testing last error value if the API didn't fail.
There is in this case - if the test is correct it shows that we expect
the last error to be set to 0 on success on, not left at its previous
value (0xdeadbeef).
--
Rob Shearman
More information about the wine-devel
mailing list