user32: Add additional tests for scroll state, make them pass under Wine
Alex Villacís Lasso
a_villacis at palosanto.com
Mon Jun 30 17:25:16 CDT 2008
>
> Why in the world would you implement Win98 behavior over WinXP,
> especially since the WinXP behavior is more logical and (probably,
> haven't looked) stated on msdn?
I did not implement Win98 behavior - it was already implemented that way
in Wine, except for one difference that was found and changed to be
consistent. Having said that, I agree that it is better to implement the
WinXP behavior. I will do that in a future patch.
Reece Dunn escribió:
> 2008/6/30 James Hawkins <truiken at gmail.com>:
>
>> On Mon, Jun 30, 2008 at 3:34 PM, Alex Villacís Lasso
>> <a_villacis at palosanto.com> wrote:
>>
>>> ...
>>>
>> + ok(si.nMin == 0xdeadbeef, "si.nMin == 0x%x, expected
>> 0xdeadbeef\n", si.nMin);
>> + ok(si.nMax == 0xdeadbeef, "si.nMax == 0x%x, expected
>> 0xdeadbeef\n", si.nMax);
>> + ok(si.nPos == 0xdeadbeef, "si.nPos == 0x%x, expected
>> 0xdeadbeef\n", si.nPos);
>> + ok(si.nPage == 0xdeadbeef, "si.nPage == 0x%x, expected
>> 0xdeadbeef\n", si.nPage);
>> +
>> + if (r == ERROR_NO_SCROLLBARS) behavior_winxp = TRUE;
>> + if (r == 0xdeadbeef) behavior_win98 = TRUE;
>> + } else {
>> + if (r2) {
>> + ok(si.nMin == 0, "si.nMin == %d, expected 0\n", si.nMin);
>> + ok(si.nMax == 100, "si.nMax == %d, expected 100\n", si.nMax);
>> + ok(si.nPos == 0, "si.nPos == %d, expected 0\n", si.nPos);
>> + ok(si.nPage == 0, "si.nPage == %d, expected 0\n", si.nPage);
>> +
>> + behavior_winxp = TRUE;
>> + } else {
>> + ok(r == 0xdeadbeef, "GetScrollInfo failed, error is %ld
>> (0x%08lx) expected 0xdeadbeef\n", r, r);
>> +
>> + behavior_win98 = TRUE;
>> + }
>> + }
>>
>> This is seriously complex (in a bad way). I think you've tried to
>> factor too much into one function. You don't need to set and check
>> the version, just test for both cases that are expected, like all the
>> other tests:
>>
>> ok(si.nMin == 0 ||
>> si.nMin == 0xdeadbeef, "si.nMin == 0x%x, expected 0 or
>> 0xdeadbeef\n", si.nMin);
>>
>
> Francois Gouget also implemented a broken() method so you can get Wine
> to do the right thing, something like:
>
> ok(si.nMin == 0 /* XP */ ||
> broken(si.nMin == 0xdeadbeef) /* 98 */ ,
> "si.nMin == 0x%x, expected 0 or 0xdeadbeef\n", si.nMin);
>
> - Reece
>
Thanks for the reminder. I will use it.
--
perl -e '$x=2.4;print sprintf("%.0f + %.0f = %.0f\n",$x,$x,$x+$x);'
More information about the wine-devel
mailing list