atlthunk/tests: Add tests.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
89ef868e5e
commit
2f9922903e
1
configure
vendored
1
configure
vendored
@ -19359,6 +19359,7 @@ wine_fn_config_makefile dlls/atl80 enable_atl80
|
||||
wine_fn_config_makefile dlls/atl80/tests enable_tests
|
||||
wine_fn_config_makefile dlls/atl90 enable_atl90
|
||||
wine_fn_config_makefile dlls/atlthunk enable_atlthunk
|
||||
wine_fn_config_makefile dlls/atlthunk/tests enable_tests
|
||||
wine_fn_config_makefile dlls/atmlib enable_atmlib
|
||||
wine_fn_config_makefile dlls/authz enable_authz
|
||||
wine_fn_config_makefile dlls/avicap32 enable_avicap32
|
||||
|
@ -3094,6 +3094,7 @@ WINE_CONFIG_MAKEFILE(dlls/atl80)
|
||||
WINE_CONFIG_MAKEFILE(dlls/atl80/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/atl90)
|
||||
WINE_CONFIG_MAKEFILE(dlls/atlthunk)
|
||||
WINE_CONFIG_MAKEFILE(dlls/atlthunk/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/atmlib)
|
||||
WINE_CONFIG_MAKEFILE(dlls/authz)
|
||||
WINE_CONFIG_MAKEFILE(dlls/avicap32)
|
||||
|
6
dlls/atlthunk/tests/Makefile.in
Normal file
6
dlls/atlthunk/tests/Makefile.in
Normal file
@ -0,0 +1,6 @@
|
||||
TESTDLL = atlthunk.dll
|
||||
IMPORTS = atlthunk
|
||||
|
||||
|
||||
C_SRCS = \
|
||||
atlthunk.c
|
62
dlls/atlthunk/tests/atlthunk.c
Normal file
62
dlls/atlthunk/tests/atlthunk.c
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2019 Jacek Caban for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "atlthunk.h"
|
||||
#include "wine/test.h"
|
||||
|
||||
static LRESULT WINAPI test_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
{
|
||||
ok(msg == 1, "msg = %u\n", msg);
|
||||
ok(wparam == 2, "wparam = %lu\n", wparam);
|
||||
ok(lparam == 3, "lparam = %lu\n", lparam);
|
||||
return (LRESULT)hwnd | 0x1000;
|
||||
}
|
||||
|
||||
static void test_thunk_proc(void)
|
||||
{
|
||||
AtlThunkData_t *thunks[513];
|
||||
WNDPROC thunk_proc;
|
||||
LRESULT res;
|
||||
int i;
|
||||
|
||||
for(i=0; i < ARRAY_SIZE(thunks); i++)
|
||||
{
|
||||
thunks[i] = AtlThunk_AllocateData();
|
||||
ok(thunks[i] != NULL, "thunk = NULL\n");
|
||||
|
||||
AtlThunk_InitData(thunks[i], test_proc, i);
|
||||
}
|
||||
|
||||
for(i=0; i < ARRAY_SIZE(thunks); i++)
|
||||
{
|
||||
thunk_proc = AtlThunk_DataToCode(thunks[i]);
|
||||
ok(thunk_proc != NULL, "thunk_proc = NULL\n");
|
||||
|
||||
res = thunk_proc((HWND)0x1234, 1, 2, 3);
|
||||
ok(res == (i | 0x1000), "res = %lu\n", res);
|
||||
}
|
||||
|
||||
for(i=0; i < ARRAY_SIZE(thunks); i++)
|
||||
AtlThunk_FreeData(thunks[i]);
|
||||
}
|
||||
|
||||
START_TEST(atlthunk)
|
||||
{
|
||||
test_thunk_proc();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user