wine-staging/patches/user32-DialogBoxParam/0001-user32-tests-Test-DialogBoxParam-using-a-dialog-temp.patch

49 lines
1.7 KiB
Diff

From 2bee693b0105133d7414a6602ce4c0cd155f5cf8 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 13 May 2016 16:13:47 +0800
Subject: user32/tests: Test DialogBoxParam using a dialog template with
invalid control class.
---
dlls/user32/tests/dialog.c | 6 ++++++
dlls/user32/tests/resource.rc | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c
index a6cd1be..470ffdc 100644
--- a/dlls/user32/tests/dialog.c
+++ b/dlls/user32/tests/dialog.c
@@ -1222,6 +1222,12 @@ static void test_DialogBoxParamA(void)
"got %d, expected ERROR_RESOURCE_NAME_NOT_FOUND\n",GetLastError());
SetLastError(0xdeadbeef);
+ ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_DIALOG_INVALID_CLASS", 0, DestroyDlgWinProc, 0);
+todo_wine
+ ok(ret == -1, "DialogBoxParamA returned %ld, expected -1\n", ret);
+ ok(GetLastError() == 0, "got %d\n", GetLastError());
+
+ SetLastError(0xdeadbeef);
ret = DefDlgProcA(0, WM_ERASEBKGND, 0, 0);
ok(ret == 0, "DefDlgProcA returned %ld, expected 0\n", ret);
ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE ||
diff --git a/dlls/user32/tests/resource.rc b/dlls/user32/tests/resource.rc
index f116b85..756e38f 100644
--- a/dlls/user32/tests/resource.rc
+++ b/dlls/user32/tests/resource.rc
@@ -124,6 +124,12 @@ FONT 8, "MS Shell Dlg"
EDITTEXT 200,4,4,50,14
}
+TEST_DIALOG_INVALID_CLASS DIALOG 0, 0, 60, 30
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+{
+ CONTROL "",1,"wine invalid class",WS_CHILD,0,0,40,10
+}
+
IDD_DIALOG DIALOG 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
--
2.8.0