Commit 499eaca3 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

twain_32/tests: Generate an error and skip instead of assert()-ing when the setup fails.

parent 47b56f23
......@@ -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)
......
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