user32/tests: Fix resource tests compilation with __WINESRC__ defined.

This commit is contained in:
Dmitry Timoshkov 2013-10-23 14:54:06 +09:00 committed by Alexandre Julliard
parent a7219e8c88
commit f26bace5af
1 changed files with 30 additions and 30 deletions

View File

@ -23,7 +23,7 @@
#include "wine/test.h"
static UINT (WINAPI *pPrivateExtractIconsA)(LPCTSTR, int, int, int, HICON *, UINT *, UINT, UINT) = NULL;
static UINT (WINAPI *pPrivateExtractIconsA)(LPCSTR, int, int, int, HICON *, UINT *, UINT, UINT) = NULL;
static void init_function_pointers(void)
{
@ -33,7 +33,7 @@ static void init_function_pointers(void)
static void test_LoadStringW(void)
{
HINSTANCE hInst = GetModuleHandle(NULL);
HINSTANCE hInst = GetModuleHandleA(NULL);
WCHAR copiedstringw[128], returnedstringw[128], *resourcepointer = NULL;
char copiedstring[128], returnedstring[128];
int length1, length2, retvalue;
@ -79,7 +79,7 @@ static void test_LoadStringW(void)
static void test_LoadStringA (void)
{
HINSTANCE hInst = GetModuleHandle (NULL);
HINSTANCE hInst = GetModuleHandleA(NULL);
static const char str[] = "String resource"; /* same in resource.rc */
char buf[128];
struct string_test {
@ -148,7 +148,7 @@ static void test_accel1(void)
ac[n].key = 0;
ac[n++].fVirt = 0;
hAccel = CreateAcceleratorTable( &ac[0], n );
hAccel = CreateAcceleratorTableA( &ac[0], n );
ok( hAccel != NULL, "create accelerator table\n");
r = DestroyAcceleratorTable( hAccel );
@ -176,13 +176,13 @@ static void test_accel1(void)
ac[n].key = 0xffff;
ac[n++].fVirt = 0x0001;
hAccel = CreateAcceleratorTable( &ac[0], n );
hAccel = CreateAcceleratorTableA( &ac[0], n );
ok( hAccel != NULL, "create accelerator table\n");
r = CopyAcceleratorTable( hAccel, NULL, 0 );
r = CopyAcceleratorTableA( hAccel, NULL, 0 );
ok( r == n, "two entries in table %u/%u\n", r, n);
r = CopyAcceleratorTable( hAccel, &ac[0], n );
r = CopyAcceleratorTableA( hAccel, &ac[0], n );
ok( r == n, "still should be two entries in table %u/%u\n", r, n);
n=0;
@ -213,7 +213,7 @@ done:
r = DestroyAcceleratorTable( hAccel );
ok( r, "destroy accelerator table\n");
hAccel = CreateAcceleratorTable( &ac[0], 0 );
hAccel = CreateAcceleratorTableA( &ac[0], 0 );
ok( !hAccel || broken(hAccel != NULL), /* nt4 */ "zero elements should fail\n");
/* these will on crash win2k
@ -246,36 +246,36 @@ static void test_accel2(void)
*/
/* try a zero count */
hac = CreateAcceleratorTable( &ac[0], 0 );
hac = CreateAcceleratorTableA( &ac[0], 0 );
ok( !hac || broken(hac != NULL), /* nt4 */ "fail\n");
if (!hac) ok( !DestroyAcceleratorTable( hac ), "destroy failed\n");
/* creating one accelerator should work */
hac = CreateAcceleratorTable( &ac[0], 1 );
hac = CreateAcceleratorTableA( &ac[0], 1 );
ok( hac != NULL , "fail\n");
ok( 1 == CopyAcceleratorTable( hac, out, 1 ), "copy failed\n");
ok( 1 == CopyAcceleratorTableA( hac, out, 1 ), "copy failed\n");
ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
/* how about two of the same type? */
hac = CreateAcceleratorTable( &ac[0], 2);
hac = CreateAcceleratorTableA( &ac[0], 2);
ok( hac != NULL , "fail\n");
res = CopyAcceleratorTable( hac, NULL, 100 );
res = CopyAcceleratorTableA( hac, NULL, 100 );
ok( res == 2, "copy null failed %d\n", res);
res = CopyAcceleratorTable( hac, NULL, 0 );
res = CopyAcceleratorTableA( hac, NULL, 0 );
ok( res == 2, "copy null failed %d\n", res);
res = CopyAcceleratorTable( hac, NULL, 1 );
res = CopyAcceleratorTableA( hac, NULL, 1 );
ok( res == 2, "copy null failed %d\n", res);
ok( 1 == CopyAcceleratorTable( hac, out, 1 ), "copy 1 failed\n");
ok( 2 == CopyAcceleratorTable( hac, out, 2 ), "copy 2 failed\n");
ok( 1 == CopyAcceleratorTableA( hac, out, 1 ), "copy 1 failed\n");
ok( 2 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n");
ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
/* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */
/* how about two of the same type with a non-zero key? */
ac[0].key = 0x20;
ac[1].key = 0x20;
hac = CreateAcceleratorTable( &ac[0], 2);
hac = CreateAcceleratorTableA( &ac[0], 2);
ok( hac != NULL , "fail\n");
ok( 2 == CopyAcceleratorTable( hac, out, 2 ), "copy 2 failed\n");
ok( 2 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n");
ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
/* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */
@ -284,17 +284,17 @@ static void test_accel2(void)
ac[0].key = 0x40;
ac[1].fVirt = FVIRTKEY;
ac[1].key = 0x40;
hac = CreateAcceleratorTable( &ac[0], 2);
hac = CreateAcceleratorTableA( &ac[0], 2);
ok( hac != NULL , "fail\n");
ok( 2 == CopyAcceleratorTable( hac, out, 2 ), "copy 2 failed\n");
ok( 2 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n");
/* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */
ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
/* how virtual key codes */
ac[0].fVirt = FVIRTKEY;
hac = CreateAcceleratorTable( &ac[0], 1);
hac = CreateAcceleratorTableA( &ac[0], 1);
ok( hac != NULL , "fail\n");
ok( 1 == CopyAcceleratorTable( hac, out, 2 ), "copy 2 failed\n");
ok( 1 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n");
/* ok( !memcmp( ac, out, sizeof ac/2 ), "tables different\n"); */
ok( DestroyAcceleratorTable( hac ), "destroy failed\n");
@ -302,9 +302,9 @@ static void test_accel2(void)
ac[0].cmd = 0xffff;
ac[0].fVirt = 0xff;
ac[0].key = 0xffff;
hac = CreateAcceleratorTable( &ac[0], 1);
hac = CreateAcceleratorTableA( &ac[0], 1);
ok( hac != NULL , "fail\n");
ok( 1 == CopyAcceleratorTable( hac, out, 1 ), "copy 1 failed\n");
ok( 1 == CopyAcceleratorTableA( hac, out, 1 ), "copy 1 failed\n");
/* ok( memcmp( ac, out, sizeof ac/2 ), "tables not different\n"); */
ok( out[0].cmd == ac[0].cmd, "cmd modified\n");
ok( out[0].fVirt == (ac[0].fVirt&0x7f), "fVirt not modified\n");
@ -313,9 +313,9 @@ static void test_accel2(void)
/* how turning on all bits? */
memset( ac, 0xff, sizeof ac );
hac = CreateAcceleratorTable( &ac[0], 2);
hac = CreateAcceleratorTableA( &ac[0], 2);
ok( hac != NULL , "fail\n");
res = CopyAcceleratorTable( hac, out, 2 );
res = CopyAcceleratorTableA( hac, out, 2 );
ok( res == 2, "copy 2 failed %d\n", res);
/* ok( memcmp( ac, out, sizeof ac ), "tables not different\n"); */
ok( out[0].cmd == ac[0].cmd, "cmd modified\n");
@ -365,14 +365,14 @@ static void test_LoadImage(void)
HBITMAP bmp;
HRSRC hres;
bmp = LoadBitmapA(GetModuleHandle(NULL), MAKEINTRESOURCE(100));
bmp = LoadBitmapA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(100));
ok(bmp != NULL, "Could not load a bitmap resource\n");
if (bmp) DeleteObject(bmp);
hres = FindResource(GetModuleHandle(NULL), "#100", RT_BITMAP);
hres = FindResourceA(GetModuleHandleA(NULL), "#100", (LPCSTR)RT_BITMAP);
ok(hres != NULL, "Could not find a bitmap resource with a numeric string\n");
bmp = LoadBitmapA(GetModuleHandle(NULL), "#100");
bmp = LoadBitmapA(GetModuleHandleA(NULL), "#100");
ok(bmp != NULL, "Could not load a bitmap resource with a numeric string\n");
if (bmp) DeleteObject(bmp);
}