mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 15:15:39 +00:00
gdiplus/tests: Introduce helper functions (expect*) to handle integral conversions.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Esme Povirk <esme@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f2b4634c18
commit
eb39c4e4fe
|
@ -25,7 +25,11 @@
|
|||
#include "gdiplus.h"
|
||||
#include "wine/test.h"
|
||||
|
||||
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
|
||||
#define expect(expected,got) expect_(__LINE__, expected, got)
|
||||
static inline void expect_(unsigned line, DWORD expected, DWORD got)
|
||||
{
|
||||
ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got);
|
||||
}
|
||||
#define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)
|
||||
|
||||
static HWND hwnd;
|
||||
|
|
|
@ -25,7 +25,12 @@
|
|||
#include "gdiplus.h"
|
||||
#include "wine/test.h"
|
||||
|
||||
#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
|
||||
#define expect(expected,got) expect_inline(__LINE__, expected, got)
|
||||
static inline void expect_inline(unsigned line, DWORD expected, DWORD got)
|
||||
{
|
||||
ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got);
|
||||
}
|
||||
|
||||
#define expect_(expected, got, precision) ok(abs((expected) - (got)) <= (precision), "Expected %d, got %d\n", (expected), (got))
|
||||
#define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got))
|
||||
#define expectf(expected, got) expectf_((expected), (got), 0.001)
|
||||
|
|
|
@ -25,7 +25,11 @@
|
|||
#include "winspool.h"
|
||||
#include "wine/test.h"
|
||||
|
||||
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
|
||||
#define expect(expected,got) expect_(__LINE__, expected, got)
|
||||
static inline void expect_(unsigned line, DWORD expected, DWORD got)
|
||||
{
|
||||
ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got);
|
||||
}
|
||||
#define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got))
|
||||
#define expectf(expected, got) expectf_((expected), (got), 0.001)
|
||||
|
||||
|
|
|
@ -24,7 +24,11 @@
|
|||
#include "gdiplus.h"
|
||||
#include "wine/test.h"
|
||||
|
||||
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
|
||||
#define expect(expected,got) expect_(__LINE__, expected, got)
|
||||
static inline void expect_(unsigned line, DWORD expected, DWORD got)
|
||||
{
|
||||
ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got);
|
||||
}
|
||||
#define expectf(expected, got) ok(fabs(got - expected) < 0.1, "Expected %.2f, got %.2f\n", expected, got)
|
||||
|
||||
static void test_startup(void)
|
||||
|
|
|
@ -33,7 +33,11 @@
|
|||
#define RGNDATA_MAGIC 0xdbc01001
|
||||
#define RGNDATA_MAGIC2 0xdbc01002
|
||||
|
||||
#define expect(expected, got) ok((got) == (expected), "Expected %.8x, got %.8x\n", (expected), (got))
|
||||
#define expect(expected,got) expect_(__LINE__, expected, got)
|
||||
static inline void expect_(unsigned line, DWORD expected, DWORD got)
|
||||
{
|
||||
ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got);
|
||||
}
|
||||
#define expectf_(expected, got, precision) ok(fabs((expected) - (got)) < (precision), "Expected %f, got %f\n", (expected), (got))
|
||||
#define expectf(expected, got) expectf_((expected), (got), 0.001)
|
||||
|
||||
|
|
Loading…
Reference in a new issue