[PATCH 2/2] user32: add tests for valid cbSize in GetMonitorInfoA

Alexandre Julliard julliard at winehq.org
Fri Apr 18 06:47:25 CDT 2014


Patrick Rudolph <siro at das-labor.org> writes:

> @@ -362,6 +363,21 @@ static void test_monitors(void)
>          monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
>      }
>  
> +    /* sanity check */
> +    monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONEAREST );
> +    mi.cbSize = sizeof(mi);
> +    ret = pGetMonitorInfoA( monitor, &mi );
> +    ok( ret, "GetMonitorInfo failed\n" );
> +
> +    miex.cbSize = sizeof(miex);
> +    ret = pGetMonitorInfoA( monitor, (LPMONITORINFO)&miex );
> +    ok( ret, "GetMonitorInfo failed\n" );
> +
> +    /* specify invalid cbSize */
> +    mi.cbSize = 0xdeadbeef;
> +    ret = pGetMonitorInfoA( monitor, &mi );
> +    ok( !ret, "GetMonitorInfo succeded\n" );

That's not a very convincing test.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list