[1/5] user32: Added tests for DrawIcon and DrawIconEx

Joel Holdsworth joel at airwebreathe.org.uk
Sat Jun 6 07:13:12 CDT 2009

> GetVersion() is not a problem in itself but we make an effort to decide 
> what to test based on behavior not version. If it absolutely can not be 
> avoided (and you will see some examples in the code) GetVersion() is 
> accepted.

I think this is the case here. DrawIcon[Ex]'s behaviour has evolved over
time, but we want Wine to support the modern behaviour not the 9X

> You reference GdiAlphaBlend(). That's not part of user32. If you are 
> sure Windows uses this for alpha blend support you can always check for 
> the availability of the GdiAlphaBlend() function:

Sorry - that was a mistake in my earlier e-mail. The version of Windows
that introduced GdiAlphaBlend also introduced alpha-channel rendering in
DrawIcon[Ex] as well (which must use GdiAlphaBlend internally). So in
this case it would be better to check version numbers not check for the
presence of GdiAlphaBlend, because that's not what I'm testing.

> This will give you a chance to decide not to run the tests on these 
> platforms. I already ran you tests on NT4 and they pass. This doesn't 
> mean that all tests run on NT4 as you sometimes return() without having 
> done an ok() test or with a trace() or skip()/win_skip(), like here:
> +    hicon = create_test_icon(hdc, 2, 1, bpp, 0, (UINT32*)&color, 
> sizeof(color));
> +    if (!hicon) return;
> Is there a reason this could fail? If not you should add an ok() test 
> for hicon. If yes, you should use skip() or win_skip() to show these 
> tests are skipped but with a correct/expected reason.
> There are more of these "blind" return's in your patch.

Ok - yes these can be fixed. I did the blind thing because I've noticed
other tests do that for the error condition, and I figured that my tests
don't want to test CreateIcon et al; these are already tested. I'm only
testing DrawIcon[Ex], but I suppose extra tests can't hurt.

More information about the wine-devel mailing list