Commit 858c07f6 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

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

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