twain_32/tests: Generate an error and skip instead of assert()-ing when the setup fails.
Francois Gouget
fgouget at free.fr
Wed Jul 3 05:11:01 CDT 2013
---
dlls/twain_32/tests/dsm.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/twain_32/tests/dsm.c b/dlls/twain_32/tests/dsm.c
index f3b6f95..96381e6 100644
--- a/dlls/twain_32/tests/dsm.c
+++ b/dlls/twain_32/tests/dsm.c
@@ -18,7 +18,7 @@
*
*/
#include <stdarg.h>
-#include <assert.h>
+
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
@@ -33,6 +33,7 @@ static DSMENTRYPROC pDSM_Entry;
static BOOL dsm_RegisterWindowClasses(void)
{
WNDCLASSA cls;
+ BOOL rc;
cls.style = 0;
cls.lpfnWndProc = DefWindowProc;
@@ -44,9 +45,10 @@ static BOOL dsm_RegisterWindowClasses(void)
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = "TWAIN_dsm_class";
- if (!RegisterClassA(&cls)) return FALSE;
- return TRUE;
+ rc = RegisterClassA(&cls);
+ ok(rc, "RegisterClassA failed: le=%u\n", GetLastError());
+ return rc;
}
@@ -832,7 +834,11 @@ START_TEST(dsm)
HANDLE hwnd;
HMODULE htwain;
- if (!dsm_RegisterWindowClasses()) assert(0);
+ if (!dsm_RegisterWindowClasses())
+ {
+ skip("Could not register the test class, skipping tests\n");
+ return;
+ }
htwain = LoadLibraryA("twain_32.dll");
if (! htwain)
--
1.7.10.4
More information about the wine-patches
mailing list