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

This commit is contained in:
Francois Gouget 2013-07-03 12:11:01 +02:00 committed by Alexandre Julliard
parent 47b56f238d
commit 499eaca38b

View file

@ -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)