I don't think you need such a complex test, we don't really care about the exact reason why it's broken.
Agreed. Fielding all the different deviations is getting quite convoluted. The modern/legacy stuff will need to remain because in some of these tests windows has made step changes - e.g. adding alpha support in 2000 and later.
Also I think you should be using the relaxed color matching everywhere, even for the working cases. We may want to round things differently in Wine too, and there's no reason to require exact pixel values, testing a few high bits should be enough to determine that blending has taken place.
I agree with you on this as well, exact pixel values are fragile, and 5-bit accuracy seems an acceptable margin of error. However, this still doesn't deal with the case in old windows, at 8-bit or less, the bitmap is rendered via the logical palette. In this case I found that even 2-bit accuracy sometimes wasn't sufficient - palette matching often caused channel variances of over 25%!
Taking this into account would yield:
ok ((result & 0x00F8F8F8) == (modern_expected & 0x00F8F8F8) || /* Windows 2000 and up */ broken((result & 0x00F8F8F8) == (legacy_expected & 0x00F8F8F8)) || /* Windows NT 4.0, 9X and below */ broken(GetDeviceCaps(hdc, BITSPIXEL) <= 8), ... /* Windows NT 4.0, 9X and below at 8bpp or less*/
What do you think?
Joel