Commit 9d6a9909 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

gdi32/tests: Fix the SetDeviceGammaRamp() tests on Windows 10 1909.

SetDeviceGammaRamp() checks the specified ramp to prevent applications from setting malicious gamma ramps (e.g. hiding text by remapping its color to match the background). But Windows 10 1909 has fewer checks than later Windows 10 versions. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54593
parent 267f6126
......@@ -1268,12 +1268,14 @@ static void test_gamma(void)
/* set one color ramp to zeros */
memset(ramp[0], 0, sizeof(ramp[0]));
ret = SetDeviceGammaRamp(hdc, &ramp);
ok(!ret, "SetDeviceGammaRamp(zeroes) succeeded\n");
ok(!ret || broken(ret /* win1909 */),
"SetDeviceGammaRamp(zeroes) succeeded\n");
/* set one color ramp to a flat straight rising line */
for (i = 0; i < 256; i++) ramp[0][i] = i;
ret = SetDeviceGammaRamp(hdc, &ramp);
todo_wine ok(!ret, "SetDeviceGammaRamp(low) succeeded\n");
todo_wine ok(!ret || broken(ret /* win1909 */),
"SetDeviceGammaRamp(low) succeeded\n");
/* set one color ramp to a steep straight rising line */
for (i = 0; i < 256; i++) ramp[0][i] = i * 256;
......@@ -1285,7 +1287,8 @@ static void test_gamma(void)
ramp[0][1] = 0x7FFF;
for (i = 2; i < 256; i++) ramp[0][i] = 0xFFFF;
ret = SetDeviceGammaRamp(hdc, &ramp);
ok(!ret, "SetDeviceGammaRam(bright) succeeded\n");
ok(!ret || broken(ret /* win1909 */),
"SetDeviceGammaRam(bright) succeeded\n");
/* try ramps which are not uniform */
for (i = 0; i < 256; i++) ramp[0][i] = 512 * i; /* wraps midway */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment