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

2009-06-06 Thread Paul Vriens

Joel Holdsworth wrote:
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
behaviour.

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.


My main idea about those return's is that I thought that they could 
maybe be used to show behavior that could have been used to decide 
whether tests can be run.


--
Cheers,

Paul.




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

2009-06-06 Thread Joel Holdsworth

> 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
behaviour.

> 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.






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

2009-06-06 Thread Rolf Kalbermatter
Joel Holdsworth [mailto:j...@airwebreathe.org.uk] 

> However, you're saying GetVersion is a problem. Why is that? 
> And how else is one supposed to cope with GdiAlphaBlend not 
> being present in pre-XP systems, as well as old-style 
> dithering differences?

Wine tests try to not depend on a particular OS version but instead cope
with differences in APIs directly. For new APIs not present in earlier
OSes this is simple. You need to import them dynamically anyhow in order
to not cause the entire test module load to fail on older OS versions.

It is then simple to test for a valid function pointer from GetProcAddress()
und skip all relevant tests if this is not the case.

Other differences should probably be handled by allowing either result to
be valid and considered as a success for that particular operation. Same
as with testing error return values for instance where sometimes a range
of error codes is accepted as valid result.

Rolf Kalbermatter





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

2009-06-06 Thread Paul Vriens

Joel Holdsworth wrote:

I've run your new tests on Win95, Win98 and NT4 (all VMware):



Is there another way you can detect whether some XP (and up) tests can
be run? We generally try not to use GetVersion() in our tests.



It turns out that the reason for the Win95 errors is that it calculates
true-colour -> 16-bit dithers differently. These tests can be safely
skipped, on these platforms.

In addition to the errors Win95 has, the other Win98 failures seem to be
the product of my interpretation GetVersion returns being wrong. Easily
fixed.

However, you're saying GetVersion is a problem. Why is that? And how
else is one supposed to cope with GdiAlphaBlend not being present in
pre-XP systems, as well as old-style dithering differences?
 


Hi Joel,

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.


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:


static BOOL (WINAPI 
*pGdiAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION);


pGdiAlphaBlend = (void*)GetProcAddress(GetModuleHandle("gdi32.dll"), 
"GdiAlphaBlend");


if (!pGdiAlphaBlend)
{
We are on W95/W98/WinME/NT4
}

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.

--
Cheers,

Paul.




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

2009-06-05 Thread Joel Holdsworth

> I've run your new tests on Win95, Win98 and NT4 (all VMware):

> Is there another way you can detect whether some XP (and up) tests can
> be run? We generally try not to use GetVersion() in our tests.
> 

It turns out that the reason for the Win95 errors is that it calculates
true-colour -> 16-bit dithers differently. These tests can be safely
skipped, on these platforms.

In addition to the errors Win95 has, the other Win98 failures seem to be
the product of my interpretation GetVersion returns being wrong. Easily
fixed.

However, you're saying GetVersion is a problem. Why is that? And how
else is one supposed to cope with GdiAlphaBlend not being present in
pre-XP systems, as well as old-style dithering differences?

Thanks
Joel








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

2009-06-04 Thread Joel Holdsworth
On Thu, 2009-06-04 at 08:43 +0200, Paul Vriens wrote:
> Joel Holdsworth wrote:
> > 
> > 
> > 
> > 
> Hi Joel,
> 
> I've run your new tests on Win95, Win98 and NT4 (all VMware):
> 
> Win95:
> ==
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 00A0B0C0 with
> DrawIcon. Expected 3163. Got 3868 from line 1130
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 00A0B0C0 with
> DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1131
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color FFA0B0C0 with
> DrawIcon. Expected 3163. Got 3868 from line 1133
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color FFA0B0C0 with
> DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1134
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
> DrawIcon. Expected 3163. Got 3868 from line 1135
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
> DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1136
> cursoricon.c:1028: Test failed: Overlaying Mask 0 on Color 00A0B0C0 with
> DrawIconEx flags 0003. Expected 3163. Got 3868 from line 1262
> cursoricon.c:1028: Test failed: Overlaying Mask 1 on Color 00A0B0C0 with
> DrawIconEx flags 0003. Expected 00FFCE9C. Got 00FFD0A0 from line 1263
> cursoricon.c:1028: Test failed: Overlaying Mask 0 on Color FFA0B0C0 with
> DrawIconEx flags 0003. Expected 3163. Got 3868 from line 1265
> cursoricon.c:1028: Test failed: Overlaying Mask 1 on Color FFA0B0C0 with
> DrawIconEx flags 0003. Expected 00FFCE9C. Got 00FFD0A0 from line 1266
> cursoricon.c:1028: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
> DrawIconEx flags 0003. Expected 3163. Got 3868 from line 1267
> cursoricon.c:1028: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
> DrawIconEx flags 0003. Expected 00FFCE9C. Got 00FFD0A0 from line 1268
> 
> Win98:
> ==
> 
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 00A0B0C0 with
> DrawIcon. Expected 3163. Got 3868 from line 1130
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 00A0B0C0 with
> DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1131
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color FFA0B0C0 with
> DrawIcon. Expected 3163. Got 3868 from line 1133
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color FFA0B0C0 with
> DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1134
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
> DrawIcon. Expected 3163. Got 3868 from line 1135
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
> DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1136
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color FFA0B0C0 with
> DrawIcon. Expected 00C0B0A0. Got 003F4F5F from line 1081
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
> DrawIcon. Expected 00605850. Got 00C0B0A0 from line 1083
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
> DrawIcon. Expected 00605850. Got 00C0B0A0 from line 1084
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
> DrawIcon. Expected 00DFD7CF. Got 00C0B0A0 from line 1085
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
> DrawIcon. Expected 00DFD7CF. Got 003F4F5F from line 1086
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 01FF with
> DrawIcon. Expected 00010101. Got 00FF from line 1088
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 01FF with
> DrawIcon. Expected 00010101. Got 00FF from line 1089
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color FEFF with
> DrawIcon. Expected 00FEFEFE. Got 00FF from line 1090
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color FEFF with
> DrawIcon. Expected 00FEFEFE. Got 00FF from line 1091
> cursoricon.c:1056: Test failed: Alpha blending. Expected 00FF with
> DrawIcon. Got 00C0B0A0 from line 1099
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color FFA0B0C0 with
> DrawIcon. Expected 00C0B0A0. Got 003F4F5F from line 1081
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
> DrawIcon. Expected 00605850. Got 00C0B0A0 from line 1083
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
> DrawIcon. Expected 00605850. Got 00C0B0A0 from line 1084
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
> DrawIcon. Expected 00DFD7CF. Got 00C0B0A0 from line 1085
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
> DrawIcon. Expected 00DFD7CF. Got 003F4F5F from line 1086
> cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 01FF with
> DrawIcon. Expected 00010101. Got 00FF from line 1088
> cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 01F

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

2009-06-04 Thread Henri Verbeet
2009/6/4 Paul Vriens :
> Is there another way you can detect whether some XP (and up) tests can
> be run? We generally try not to use GetVersion() in our tests.
>
Just a guess, but XP's screen color depth of 32bpp might be
significant here. If that's the case you'd also expect the tests to
fail on an XP machine configured to e.g. 24bpp.




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

2009-06-03 Thread Paul Vriens

Joel Holdsworth wrote:






Hi Joel,

I've run your new tests on Win95, Win98 and NT4 (all VMware):

Win95:
==
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 00A0B0C0 with
DrawIcon. Expected 3163. Got 3868 from line 1130
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 00A0B0C0 with
DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1131
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color FFA0B0C0 with
DrawIcon. Expected 3163. Got 3868 from line 1133
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color FFA0B0C0 with
DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1134
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
DrawIcon. Expected 3163. Got 3868 from line 1135
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1136
cursoricon.c:1028: Test failed: Overlaying Mask 0 on Color 00A0B0C0 with
DrawIconEx flags 0003. Expected 3163. Got 3868 from line 1262
cursoricon.c:1028: Test failed: Overlaying Mask 1 on Color 00A0B0C0 with
DrawIconEx flags 0003. Expected 00FFCE9C. Got 00FFD0A0 from line 1263
cursoricon.c:1028: Test failed: Overlaying Mask 0 on Color FFA0B0C0 with
DrawIconEx flags 0003. Expected 3163. Got 3868 from line 1265
cursoricon.c:1028: Test failed: Overlaying Mask 1 on Color FFA0B0C0 with
DrawIconEx flags 0003. Expected 00FFCE9C. Got 00FFD0A0 from line 1266
cursoricon.c:1028: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
DrawIconEx flags 0003. Expected 3163. Got 3868 from line 1267
cursoricon.c:1028: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
DrawIconEx flags 0003. Expected 00FFCE9C. Got 00FFD0A0 from line 1268

Win98:
==

cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 00A0B0C0 with
DrawIcon. Expected 3163. Got 3868 from line 1130
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 00A0B0C0 with
DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1131
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color FFA0B0C0 with
DrawIcon. Expected 3163. Got 3868 from line 1133
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color FFA0B0C0 with
DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1134
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
DrawIcon. Expected 3163. Got 3868 from line 1135
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
DrawIcon. Expected 00FFCE9C. Got 00FFD0A0 from line 1136
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color FFA0B0C0 with
DrawIcon. Expected 00C0B0A0. Got 003F4F5F from line 1081
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
DrawIcon. Expected 00605850. Got 00C0B0A0 from line 1083
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
DrawIcon. Expected 00605850. Got 00C0B0A0 from line 1084
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
DrawIcon. Expected 00DFD7CF. Got 00C0B0A0 from line 1085
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
DrawIcon. Expected 00DFD7CF. Got 003F4F5F from line 1086
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 01FF with
DrawIcon. Expected 00010101. Got 00FF from line 1088
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 01FF with
DrawIcon. Expected 00010101. Got 00FF from line 1089
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color FEFF with
DrawIcon. Expected 00FEFEFE. Got 00FF from line 1090
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color FEFF with
DrawIcon. Expected 00FEFEFE. Got 00FF from line 1091
cursoricon.c:1056: Test failed: Alpha blending. Expected 00FF with
DrawIcon. Got 00C0B0A0 from line 1099
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color FFA0B0C0 with
DrawIcon. Expected 00C0B0A0. Got 003F4F5F from line 1081
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
DrawIcon. Expected 00605850. Got 00C0B0A0 from line 1083
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
DrawIcon. Expected 00605850. Got 00C0B0A0 from line 1084
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 80A0B0C0 with
DrawIcon. Expected 00DFD7CF. Got 00C0B0A0 from line 1085
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 80A0B0C0 with
DrawIcon. Expected 00DFD7CF. Got 003F4F5F from line 1086
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color 01FF with
DrawIcon. Expected 00010101. Got 00FF from line 1088
cursoricon.c:1013: Test failed: Overlaying Mask 1 on Color 01FF with
DrawIcon. Expected 00010101. Got 00FF from line 1089
cursoricon.c:1013: Test failed: Overlaying Mask 0 on Color FEFF with
DrawIcon. Expected 00FEFEFE. Got 00FF from line 1090
cursoricon.c:1013: Test failed: O