static const RECT *current_bounds;
static const char *dst_format;
-static inline DWORD get_stride(BITMAPINFO *bmi)
+static inline DWORD get_stride(const BITMAPINFO *bmi)
{
return ((bmi->bmiHeader.biBitCount * bmi->bmiHeader.biWidth + 31) >> 3) & ~3;
}
-static inline DWORD get_dib_size(BITMAPINFO *bmi)
+static inline DWORD get_dib_size(const BITMAPINFO *bmi)
{
return get_stride(bmi) * abs(bmi->bmiHeader.biHeight);
}
-static char *hash_dib(BITMAPINFO *bmi, void *bits)
+static char *hash_dib(const BITMAPINFO *bmi, const void *bits)
{
DWORD dib_size = get_dib_size(bmi);
HCRYPTHASH hash;
current_bounds->right == -1 &&
current_bounds->bottom == -1)
{
- ok( 0, "missing bounds, got { %d, %d, %d, %d },\n", rect.left, rect.top, rect.right, rect.bottom );
+ ok( 0, "missing bounds, got %s,\n", wine_dbgstr_rect( &rect ));
return;
}
- ok( !memcmp( current_bounds, &rect, sizeof(RECT) ),
- "%s: %s: expected bounds %d,%d,%d,%d got %d,%d,%d,%d\n", dst_format, info,
- current_bounds->left, current_bounds->top, current_bounds->right, current_bounds->bottom,
- rect.left, rect.top, rect.right, rect.bottom );
+ ok( EqualRect( current_bounds, &rect ), "%s: %s: expected bounds %s got %s\n", dst_format, info,
+ wine_dbgstr_rect( current_bounds ), wine_dbgstr_rect( &rect ));
current_bounds++;
}
current_bounds++;
}
-static void compare_hash_broken_todo(HDC hdc, BITMAPINFO *bmi, BYTE *bits, const char *info, int num_broken, BOOL todo)
+static void compare_hash_broken_todo(HDC hdc, const BITMAPINFO *bmi, BYTE *bits, const char *info, int num_broken, BOOL todo)
{
char *hash = hash_dib(bmi, bits);
BOOL ok_cond;
for(i = 1; i <= num_broken; i++)
ok_cond = ok_cond || broken( !strcmp(hash, current_sha1[i]) );
- if(todo)
- todo_wine ok( ok_cond, "%s: %s: expected hash %s got %s\n",
- dst_format, info, *current_sha1, hash );
- else
+ todo_wine_if(todo)
ok( ok_cond, "%s: %s: expected hash %s got %s\n",
dst_format, info, *current_sha1, hash );
compare_bounds( hdc, info );
}
-static void compare_hash(HDC hdc, BITMAPINFO *bmi, BYTE *bits, const char *info)
+static void compare_hash(HDC hdc, const BITMAPINFO *bmi, BYTE *bits, const char *info)
{
compare_hash_broken_todo(hdc, bmi, bits, info, 0, FALSE);
}
DeleteObject( SelectObject( hdc, brush ) );
}
-static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits)
+static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
{
char pal_buffer[sizeof(LOGPALETTE) + 255 * sizeof(PALETTEENTRY)];
LOGPALETTE *pal = (LOGPALETTE *)pal_buffer;
static const BYTE masks[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
-static void draw_text_2( HDC hdc, BITMAPINFO *bmi, BYTE *bits, BOOL aa )
+static void draw_text_2( HDC hdc, const BITMAPINFO *bmi, BYTE *bits, BOOL aa )
{
DWORD dib_size = get_dib_size(bmi), ret;
LOGFONTA lf;
DeleteObject( font );
}
-static void draw_text( HDC hdc, BITMAPINFO *bmi, BYTE *bits )
+static void draw_text( HDC hdc, const BITMAPINFO *bmi, BYTE *bits )
{
draw_text_2( hdc, bmi, bits, FALSE );