2008/11/27 Dmitry Timoshkov <[EMAIL PROTECTED]>: > "Andrew Riedi" <[EMAIL PROTECTED]> 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