Commit 25923d2f authored by Wolfram Sang's avatar Wolfram Sang Committed by Alexandre Julliard

user32/tests: Modify proper fields instead of magic offsets.

parent 01ca32ac
...@@ -854,7 +854,7 @@ static void test_LoadImage(void) ...@@ -854,7 +854,7 @@ static void test_LoadImage(void)
DWORD error, bytes_written; DWORD error, bytes_written;
CURSORICONFILEDIR *icon_data; CURSORICONFILEDIR *icon_data;
CURSORICONFILEDIRENTRY *icon_entry; CURSORICONFILEDIRENTRY *icon_entry;
BITMAPINFOHEADER *icon_header; BITMAPINFOHEADER *icon_header, *bitmap_header;
ICONINFO icon_info; ICONINFO icon_info;
#define ICON_WIDTH 32 #define ICON_WIDTH 32
...@@ -981,13 +981,17 @@ static void test_LoadImage(void) ...@@ -981,13 +981,17 @@ static void test_LoadImage(void)
test_LoadImageFile("GIF (2x2 pixel)", gif4pixel, sizeof(gif4pixel), "gif", 0); test_LoadImageFile("GIF (2x2 pixel)", gif4pixel, sizeof(gif4pixel), "gif", 0);
test_LoadImageFile("JPG", jpgimage, sizeof(jpgimage), "jpg", 0); test_LoadImageFile("JPG", jpgimage, sizeof(jpgimage), "jpg", 0);
test_LoadImageFile("PNG", pngimage, sizeof(pngimage), "png", 0); test_LoadImageFile("PNG", pngimage, sizeof(pngimage), "png", 0);
/* Check failure for broken BMP images */ /* Check failure for broken BMP images */
bmpimage[0x14]++; /* biHeight > 65535 */ bitmap_header = (BITMAPINFOHEADER *)(bmpimage + sizeof(BITMAPFILEHEADER));
bitmap_header->biHeight = 65536;
test_LoadImageFile("BMP (too high)", bmpimage, sizeof(bmpimage), "bmp", 0); test_LoadImageFile("BMP (too high)", bmpimage, sizeof(bmpimage), "bmp", 0);
bmpimage[0x14]--; bitmap_header->biHeight = 1;
bmpimage[0x18]++; /* biWidth > 65535 */
bitmap_header->biWidth = 65536;
test_LoadImageFile("BMP (too wide)", bmpimage, sizeof(bmpimage), "bmp", 0); test_LoadImageFile("BMP (too wide)", bmpimage, sizeof(bmpimage), "bmp", 0);
bmpimage[0x18]--; bitmap_header->biWidth = 1;
} }
static void test_CreateIconFromResource(void) static void test_CreateIconFromResource(void)
......
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