mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Rebase against b510dccecbfe80c26b030b78b903b38350d41012.
This commit is contained in:
parent
b19d0ea3ca
commit
966293c5d3
@ -1,132 +0,0 @@
|
||||
From 1b05fa6764dc8eb220ef9dd349801fa2e76914bd Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 17 Oct 2015 15:38:13 +0200
|
||||
Subject: comctl32/tests: Add tests for PROPSHEET_InsertPage.
|
||||
|
||||
---
|
||||
dlls/comctl32/tests/propsheet.c | 97 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 96 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c
|
||||
index 6594298..8fdbae8 100644
|
||||
--- a/dlls/comctl32/tests/propsheet.c
|
||||
+++ b/dlls/comctl32/tests/propsheet.c
|
||||
@@ -806,7 +806,7 @@ static void test_PSM_ADDPAGE(void)
|
||||
psp.pfnDlgProc = page_dlg_proc_messages;
|
||||
psp.lParam = 0;
|
||||
|
||||
- /* two page with the same data */
|
||||
+ /* multiple pages with the same data */
|
||||
hpsp[0] = CreatePropertySheetPageA(&psp);
|
||||
hpsp[1] = CreatePropertySheetPageA(&psp);
|
||||
hpsp[2] = CreatePropertySheetPageA(&psp);
|
||||
@@ -878,6 +878,100 @@ if (0)
|
||||
DestroyWindow(hdlg);
|
||||
}
|
||||
|
||||
+static void test_PSM_INSERTPAGE(void)
|
||||
+{
|
||||
+ HPROPSHEETPAGE hpsp[5];
|
||||
+ PROPSHEETPAGEA psp;
|
||||
+ PROPSHEETHEADERA psh;
|
||||
+ HWND hdlg, tab;
|
||||
+ BOOL ret;
|
||||
+ DWORD r;
|
||||
+
|
||||
+ memset(&psp, 0, sizeof(psp));
|
||||
+ psp.dwSize = sizeof(psp);
|
||||
+ psp.dwFlags = 0;
|
||||
+ psp.hInstance = GetModuleHandleA(NULL);
|
||||
+ U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_MESSAGE_TEST);
|
||||
+ U2(psp).pszIcon = NULL;
|
||||
+ psp.pfnDlgProc = page_dlg_proc_messages;
|
||||
+ psp.lParam = 0;
|
||||
+
|
||||
+ /* multiple pages with the same data */
|
||||
+ hpsp[0] = CreatePropertySheetPageA(&psp);
|
||||
+ hpsp[1] = CreatePropertySheetPageA(&psp);
|
||||
+ hpsp[2] = CreatePropertySheetPageA(&psp);
|
||||
+
|
||||
+ U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_ERROR);
|
||||
+ hpsp[3] = CreatePropertySheetPageA(&psp);
|
||||
+
|
||||
+ psp.dwFlags = PSP_PREMATURE;
|
||||
+ hpsp[4] = CreatePropertySheetPageA(&psp);
|
||||
+
|
||||
+ memset(&psh, 0, sizeof(psh));
|
||||
+ psh.dwSize = PROPSHEETHEADERA_V1_SIZE;
|
||||
+ psh.dwFlags = PSH_MODELESS;
|
||||
+ psh.pszCaption = "test caption";
|
||||
+ psh.nPages = 1;
|
||||
+ psh.hwndParent = GetDesktopWindow();
|
||||
+ U3(psh).phpage = hpsp;
|
||||
+
|
||||
+ hdlg = (HWND)PropertySheetA(&psh);
|
||||
+ ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle %p\n", hdlg);
|
||||
+
|
||||
+ /* add pages one by one */
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 5, (LPARAM)hpsp[1]);
|
||||
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
|
||||
+
|
||||
+ /* try with invalid values */
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, 0);
|
||||
+ ok(ret == FALSE, "got %d\n", ret);
|
||||
+
|
||||
+if (0)
|
||||
+{
|
||||
+ /* crashes on native */
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)INVALID_HANDLE_VALUE);
|
||||
+}
|
||||
+
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)INVALID_HANDLE_VALUE, (LPARAM)hpsp[2]);
|
||||
+ ok(ret == FALSE, "got %d\n", ret);
|
||||
+
|
||||
+ /* check item count */
|
||||
+ tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);
|
||||
+
|
||||
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
|
||||
+ todo_wine ok(r == 2, "got %d\n", r);
|
||||
+
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)hpsp[1], (LPARAM)hpsp[2]);
|
||||
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
|
||||
+
|
||||
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
|
||||
+ todo_wine ok(r == 3, "got %d\n", r);
|
||||
+
|
||||
+ /* add property sheet page that can't be created */
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 1, (LPARAM)hpsp[3]);
|
||||
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
|
||||
+
|
||||
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
|
||||
+ todo_wine ok(r == 4, "got %d\n", r);
|
||||
+
|
||||
+ /* select page that can't be created */
|
||||
+ ret = SendMessageA(hdlg, PSM_SETCURSEL, 1, 0);
|
||||
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
|
||||
+
|
||||
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
|
||||
+ todo_wine ok(r == 3, "got %d\n", r);
|
||||
+
|
||||
+ /* test PSP_PREMATURE flag with incorrect property sheet page */
|
||||
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)hpsp[4]);
|
||||
+ ok(ret == FALSE, "got %d\n", ret);
|
||||
+
|
||||
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
|
||||
+ todo_wine ok(r == 3, "got %d\n", r);
|
||||
+
|
||||
+ DestroyPropertySheetPage(hpsp[4]);
|
||||
+ DestroyWindow(hdlg);
|
||||
+}
|
||||
+
|
||||
START_TEST(propsheet)
|
||||
{
|
||||
test_title();
|
||||
@@ -888,4 +982,5 @@ START_TEST(propsheet)
|
||||
test_custom_default_button();
|
||||
test_messages();
|
||||
test_PSM_ADDPAGE();
|
||||
+ test_PSM_INSERTPAGE();
|
||||
}
|
||||
--
|
||||
2.6.2
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 746aa2c81af98e890e4db720783de7fce4bc84d3 Mon Sep 17 00:00:00 2001
|
||||
From bbe000942fadd116e85bd64abd6633fa1d9df382 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 4 Mar 2016 22:22:42 +0100
|
||||
Subject: ddraw: Set ddsOldCaps correctly in ddraw7_GetCaps.
|
||||
@ -12,10 +12,10 @@ Subject: ddraw: Set ddsOldCaps correctly in ddraw7_GetCaps.
|
||||
5 files changed, 106 insertions(+)
|
||||
|
||||
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
|
||||
index 1fa88751efe..5c138a5d726 100644
|
||||
index 8bf38ee930f..01a9a904ef5 100644
|
||||
--- a/dlls/ddraw/ddraw.c
|
||||
+++ b/dlls/ddraw/ddraw.c
|
||||
@@ -1533,6 +1533,8 @@ static HRESULT WINAPI ddraw7_GetCaps(IDirectDraw7 *iface, DDCAPS *DriverCaps, DD
|
||||
@@ -1536,6 +1536,8 @@ static HRESULT WINAPI ddraw7_GetCaps(IDirectDraw7 *iface, DDCAPS *DriverCaps, DD
|
||||
caps.dwCaps |= DDCAPS_ALIGNSTRIDE;
|
||||
caps.dwAlignStrideAlign = DDRAW_STRIDE_ALIGNMENT;
|
||||
|
||||
@ -25,11 +25,11 @@ index 1fa88751efe..5c138a5d726 100644
|
||||
|
||||
if(DriverCaps)
|
||||
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
|
||||
index 5b153a62a21..762c1074e79 100644
|
||||
index 5acbee61e00..bb873da220f 100644
|
||||
--- a/dlls/ddraw/tests/ddraw1.c
|
||||
+++ b/dlls/ddraw/tests/ddraw1.c
|
||||
@@ -9793,6 +9793,31 @@ static void test_display_mode_surface_pixel_format(void)
|
||||
DestroyWindow(window);
|
||||
@@ -9953,6 +9953,31 @@ static void test_surface_desc_size(void)
|
||||
ok(!refcount, "DirectDraw has %u references left.\n", refcount);
|
||||
}
|
||||
|
||||
+static void test_caps(void)
|
||||
@ -60,18 +60,18 @@ index 5b153a62a21..762c1074e79 100644
|
||||
START_TEST(ddraw1)
|
||||
{
|
||||
IDirectDraw *ddraw;
|
||||
@@ -9877,4 +9902,5 @@ START_TEST(ddraw1)
|
||||
test_getdc();
|
||||
@@ -10038,4 +10063,5 @@ START_TEST(ddraw1)
|
||||
test_transform_vertices();
|
||||
test_display_mode_surface_pixel_format();
|
||||
test_surface_desc_size();
|
||||
+ test_caps();
|
||||
}
|
||||
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
|
||||
index 422960012af..714d3f0e1a8 100644
|
||||
index dc8801c3e12..9afd5e8e681 100644
|
||||
--- a/dlls/ddraw/tests/ddraw2.c
|
||||
+++ b/dlls/ddraw/tests/ddraw2.c
|
||||
@@ -11247,6 +11247,31 @@ static void test_display_mode_surface_pixel_format(void)
|
||||
DestroyWindow(window);
|
||||
@@ -11444,6 +11444,31 @@ static void test_surface_desc_size(void)
|
||||
ok(!refcount, "DirectDraw has %u references left.\n", refcount);
|
||||
}
|
||||
|
||||
+static void test_caps(void)
|
||||
@ -102,18 +102,18 @@ index 422960012af..714d3f0e1a8 100644
|
||||
START_TEST(ddraw2)
|
||||
{
|
||||
IDirectDraw2 *ddraw;
|
||||
@@ -11340,4 +11365,5 @@ START_TEST(ddraw2)
|
||||
test_edge_antialiasing_blending();
|
||||
@@ -11538,4 +11563,5 @@ START_TEST(ddraw2)
|
||||
test_transform_vertices();
|
||||
test_display_mode_surface_pixel_format();
|
||||
test_surface_desc_size();
|
||||
+ test_caps();
|
||||
}
|
||||
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
|
||||
index e091a6dac5d..70dd79d7a13 100644
|
||||
index f2b3e0cf63b..fbefe8425b3 100644
|
||||
--- a/dlls/ddraw/tests/ddraw4.c
|
||||
+++ b/dlls/ddraw/tests/ddraw4.c
|
||||
@@ -12532,6 +12532,31 @@ static void test_display_mode_surface_pixel_format(void)
|
||||
DestroyWindow(window);
|
||||
@@ -12729,6 +12729,31 @@ static void test_surface_desc_size(void)
|
||||
ok(!refcount, "DirectDraw has %u references left.\n", refcount);
|
||||
}
|
||||
|
||||
+static void test_caps(void)
|
||||
@ -144,18 +144,18 @@ index e091a6dac5d..70dd79d7a13 100644
|
||||
START_TEST(ddraw4)
|
||||
{
|
||||
IDirectDraw4 *ddraw;
|
||||
@@ -12633,4 +12658,5 @@ START_TEST(ddraw4)
|
||||
test_edge_antialiasing_blending();
|
||||
@@ -12831,4 +12856,5 @@ START_TEST(ddraw4)
|
||||
test_transform_vertices();
|
||||
test_display_mode_surface_pixel_format();
|
||||
test_surface_desc_size();
|
||||
+ test_caps();
|
||||
}
|
||||
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
|
||||
index 0b1bdaef6d2..536163e9a5e 100644
|
||||
index 7b88824920e..7957f1733d5 100644
|
||||
--- a/dlls/ddraw/tests/ddraw7.c
|
||||
+++ b/dlls/ddraw/tests/ddraw7.c
|
||||
@@ -12211,6 +12211,31 @@ static void test_display_mode_surface_pixel_format(void)
|
||||
DestroyWindow(window);
|
||||
@@ -12424,6 +12424,31 @@ static void test_surface_desc_size(void)
|
||||
ok(!refcount, "DirectDraw has %u references left.\n", refcount);
|
||||
}
|
||||
|
||||
+static void test_caps(void)
|
||||
@ -186,10 +186,10 @@ index 0b1bdaef6d2..536163e9a5e 100644
|
||||
START_TEST(ddraw7)
|
||||
{
|
||||
HMODULE module = GetModuleHandleA("ddraw.dll");
|
||||
@@ -12322,4 +12347,5 @@ START_TEST(ddraw7)
|
||||
test_draw_primitive();
|
||||
@@ -12536,4 +12561,5 @@ START_TEST(ddraw7)
|
||||
test_edge_antialiasing_blending();
|
||||
test_display_mode_surface_pixel_format();
|
||||
test_surface_desc_size();
|
||||
+ test_caps();
|
||||
}
|
||||
--
|
||||
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "c3e6ecde36692d03dc360200c7a7044a02c4a392"
|
||||
echo "b510dccecbfe80c26b030b78b903b38350d41012"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -3127,10 +3127,8 @@ fi
|
||||
# | * dlls/comctl32/propsheet.c, dlls/comctl32/tests/propsheet.c
|
||||
# |
|
||||
if test "$enable_comctl32_PROPSHEET_InsertPage" -eq 1; then
|
||||
patch_apply comctl32-PROPSHEET_InsertPage/0001-comctl32-tests-Add-tests-for-PROPSHEET_InsertPage.patch
|
||||
patch_apply comctl32-PROPSHEET_InsertPage/0002-comctl32-Implement-PROPSHEET_InsertPage-based-on-PRO.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "comctl32/tests: Add tests for PROPSHEET_InsertPage.", 1 },';
|
||||
echo '+ { "Peter Hater", "comctl32: Implement PROPSHEET_InsertPage based on PROPSHEET_AddPage.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user