gdi32/tests: Combine the matching macros into a single function.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2017-03-17 08:44:33 +00:00 committed by Alexandre Julliard
parent ba018b5253
commit 858c07f667

View file

@ -30,10 +30,12 @@
#include "wine/test.h"
/* Do not allow more than 1 deviation here */
#define match_off_by_1(a, b, exact) (abs((a) - (b)) <= ((exact) ? 0 : 1))
#define near_match(a, b) (abs((a) - (b)) <= 6)
static inline BOOL match_off_by_n(int a, int b, unsigned int n)
{
return abs(a - b) <= n;
}
#define match_off_by_1(a, b, exact) match_off_by_n((a), (b), (exact) ? 0 : 1)
#define near_match(a, b) match_off_by_n((a), (b), 6)
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
static LONG (WINAPI *pGdiGetCharDimensions)(HDC hdc, LPTEXTMETRICW lptm, LONG *height);