comctl32/tests: Add a test for passing dialog template with bad control class to PropertySheet.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2018-12-18 18:45:42 +03:00 committed by Alexandre Julliard
parent 53375be47c
commit ca41fd8904
3 changed files with 50 additions and 0 deletions

View file

@ -1143,6 +1143,47 @@ static void test_CreatePropertySheetPage(void)
}
}
static void test_bad_control_class(void)
{
PROPSHEETPAGEA psp;
PROPSHEETHEADERA psh;
HPROPSHEETPAGE hpsp;
INT_PTR ret;
memset(&psp, 0, sizeof(psp));
psp.dwSize = sizeof(psp);
psp.hInstance = GetModuleHandleA(NULL);
U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_BAD_CONTROL);
psp.pfnDlgProc = page_dlg_proc;
hpsp = pCreatePropertySheetPageA(&psp);
ok(hpsp != 0, "CreatePropertySheetPage failed\n");
memset(&psh, 0, sizeof(psh));
psh.dwSize = PROPSHEETHEADERA_V1_SIZE;
psh.nPages = 1;
psh.hwndParent = GetDesktopWindow();
U3(psh).phpage = &hpsp;
if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once Wine is fixed */
{
ret = pPropertySheetA(&psh);
ok(ret == 0, "got %ld\n", ret);
}
/* Need to recreate hpsp otherwise the test fails under Windows */
hpsp = pCreatePropertySheetPageA(&psp);
ok(hpsp != 0, "CreatePropertySheetPage failed\n");
U3(psh).phpage = &hpsp;
psh.dwFlags = PSH_MODELESS;
ret = pPropertySheetA(&psh);
ok(ret != 0, "got %ld\n", ret);
ok(IsWindow((HWND)ret), "bad window handle %#lx\n", ret);
DestroyWindow((HWND)ret);
}
static void init_functions(void)
{
HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
@ -1168,6 +1209,7 @@ START_TEST(propsheet)
init_functions();
test_bad_control_class();
test_title();
test_nopage();
test_disableowner();

View file

@ -39,6 +39,7 @@
#define IDD_PROP_PAGE_WITH_CUSTOM_DEFAULT_BUTTON 34
#define IDD_PROP_PAGE_MESSAGE_TEST 35
#define IDD_PROP_PAGE_ERROR 36
#define IDD_PROP_PAGE_BAD_CONTROL 37
#define IDC_PS_EDIT1 1000
#define IDC_PS_EDIT2 1001

View file

@ -78,6 +78,13 @@ FONT 8, "MS Shell Dlg"
{
}
IDD_PROP_PAGE_BAD_CONTROL DIALOG 0, 0, 100, 100
STYLE WS_POPUP | WS_CAPTION | WS_CLIPSIBLINGS | WS_VISIBLE
FONT 8, "MS Shell Dlg"
{
CONTROL "", -1, "invalid class", 0, 0, 0, 0, 0
}
STRINGTABLE
{
IDS_TBADD1 "abc"