https://git.reactos.org/?p=reactos.git;a=commitdiff;h=161232c08bd4272a345e86c50644782cd6435f6b

commit 161232c08bd4272a345e86c50644782cd6435f6b
Author:     Amine Khaldi <[email protected]>
AuthorDate: Sun Jan 21 22:00:27 2018 +0100
Commit:     Amine Khaldi <[email protected]>
CommitDate: Sun Jan 21 22:00:27 2018 +0100

    [WSHOM_WINETEST] Sync with Wine 3.0. CORE-14225
---
 modules/rostests/winetests/wshom/wshom.c | 49 ++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/modules/rostests/winetests/wshom/wshom.c 
b/modules/rostests/winetests/wshom/wshom.c
index 84c97fa4ec..5a9662078a 100644
--- a/modules/rostests/winetests/wshom/wshom.c
+++ b/modules/rostests/winetests/wshom/wshom.c
@@ -569,6 +569,54 @@ static void test_registry(void)
     IWshShell3_Release(sh3);
 }
 
+static void test_popup(void)
+{
+    static const WCHAR textW[] = {'T','e','x','t',0};
+    VARIANT timeout, type, title, optional;
+    IWshShell *sh;
+    int button;
+    HRESULT hr;
+    BSTR text;
+
+    hr = CoCreateInstance(&CLSID_WshShell, NULL, CLSCTX_INPROC_SERVER | 
CLSCTX_INPROC_HANDLER,
+            &IID_IWshShell, (void **)&sh);
+    ok(hr == S_OK, "Failed to create WshShell object, hr %#x.\n", hr);
+
+    button = 123;
+    text = SysAllocString(textW);
+
+    hr = IWshShell_Popup(sh, NULL, NULL, NULL, NULL, &button);
+    ok(hr == E_POINTER, "Unexpected retval %#x.\n", hr);
+    ok(button == 123, "Unexpected button id %d.\n", button);
+
+    hr = IWshShell_Popup(sh, text, NULL, NULL, NULL, &button);
+    ok(hr == E_POINTER, "Unexpected retval %#x.\n", hr);
+    ok(button == 123, "Unexpected button id %d.\n", button);
+
+    V_VT(&optional) = VT_ERROR;
+    V_ERROR(&optional) = DISP_E_PARAMNOTFOUND;
+
+    V_VT(&timeout) = VT_I2;
+    V_I2(&timeout) = 1;
+
+    V_VT(&type) = VT_I2;
+    V_I2(&type) = 1;
+
+    V_VT(&title) = VT_BSTR;
+    V_BSTR(&title) = NULL;
+
+    hr = IWshShell_Popup(sh, text, &timeout, &optional, &type, &button);
+    ok(hr == S_OK, "Unexpected retval %#x.\n", hr);
+    ok(button == -1, "Unexpected button id %d.\n", button);
+
+    hr = IWshShell_Popup(sh, text, &timeout, &title, &optional, &button);
+    ok(hr == S_OK, "Unexpected retval %#x.\n", hr);
+    ok(button == -1, "Unexpected button id %d.\n", button);
+
+    SysFreeString(text);
+    IWshShell_Release(sh);
+}
+
 START_TEST(wshom)
 {
     IUnknown *unk;
@@ -586,6 +634,7 @@ START_TEST(wshom)
 
     test_wshshell();
     test_registry();
+    test_popup();
 
     CoUninitialize();
 }

Reply via email to