=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3dx9/tests: Improve test failure messages for check_{ref, release}.
Alexandre Julliard
julliard at winehq.org
Mon Jun 11 15:08:07 CDT 2012
Module: wine
Branch: master
Commit: cda4738f52152a805138b607726466836a73d22f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=cda4738f52152a805138b607726466836a73d22f
Author: Józef Kucia <joseph.kucia at gmail.com>
Date: Sun Jun 10 21:39:47 2012 +0200
d3dx9/tests: Improve test failure messages for check_{ref, release}.
---
dlls/d3dx9_36/tests/core.c | 10 ++++++----
dlls/d3dx9_36/tests/surface.c | 10 ++++++----
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/dlls/d3dx9_36/tests/core.c b/dlls/d3dx9_36/tests/core.c
index fa259ab..7f9ab44 100644
--- a/dlls/d3dx9_36/tests/core.c
+++ b/dlls/d3dx9_36/tests/core.c
@@ -29,16 +29,18 @@ static inline int get_ref(IUnknown *obj)
return IUnknown_Release(obj);
}
-static inline void check_ref(IUnknown *obj, int exp)
+#define check_ref(obj, exp) _check_ref(__LINE__, obj, exp)
+static inline void _check_ref(unsigned int line, IUnknown *obj, int exp)
{
int ref = get_ref(obj);
- ok (exp == ref, "Invalid refcount. Expected %d, got %d\n", exp, ref);
+ ok_(__FILE__, line)(exp == ref, "Invalid refcount. Expected %d, got %d\n", exp, ref);
}
-static inline void check_release(IUnknown *obj, int exp)
+#define check_release(obj, exp) _check_release(__LINE__, obj, exp)
+static inline void _check_release(unsigned int line, IUnknown *obj, int exp)
{
int ref = IUnknown_Release(obj);
- ok (ref == exp, "Invalid refcount. Expected %d, got %d\n", exp, ref);
+ ok_(__FILE__, line)(ref == exp, "Invalid refcount. Expected %d, got %d\n", exp, ref);
}
#define admitted_error 0.0001f
diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c
index 4b3b511..72d2509 100644
--- a/dlls/d3dx9_36/tests/surface.c
+++ b/dlls/d3dx9_36/tests/surface.c
@@ -30,16 +30,18 @@ static inline int get_ref(IUnknown *obj)
return IUnknown_Release(obj);
}
-static inline void check_ref(IUnknown *obj, int exp)
+#define check_ref(obj, exp) _check_ref(__LINE__, obj, exp)
+static inline void _check_ref(unsigned int line, IUnknown *obj, int exp)
{
int ref = get_ref(obj);
- ok (exp == ref, "Invalid refcount. Expected %d, got %d\n", exp, ref);
+ ok_(__FILE__, line)(exp == ref, "Invalid refcount. Expected %d, got %d\n", exp, ref);
}
-static inline void check_release(IUnknown *obj, int exp)
+#define check_release(obj, exp) _check_release(__LINE__, obj, exp)
+static inline void _check_release(unsigned int line, IUnknown *obj, int exp)
{
int ref = IUnknown_Release(obj);
- ok (ref == exp, "Invalid refcount. Expected %d, got %d\n", exp, ref);
+ ok_(__FILE__, line)(ref == exp, "Invalid refcount. Expected %d, got %d\n", exp, ref);
}
/* 1x1 bmp (1 bpp) */
More information about the wine-cvs
mailing list