mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 21:27:19 +00:00
twain_32/tests: Generate an error and skip instead of assert()-ing when the setup fails.
This commit is contained in:
parent
47b56f238d
commit
499eaca38b
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue