Nikolay Sivov : scrrun/tests: A test for adding BYREF item.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Mar 3 09:42:10 CST 2015


Module: wine
Branch: master
Commit: 2d15758c38b624c7ee67042c972cb63c2589d549
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2d15758c38b624c7ee67042c972cb63c2589d549

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Feb 27 18:26:26 2015 +0300

scrrun/tests: A test for adding BYREF item.

---

 dlls/scrrun/tests/dictionary.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/dlls/scrrun/tests/dictionary.c b/dlls/scrrun/tests/dictionary.c
index 3637356..927ac05 100644
--- a/dlls/scrrun/tests/dictionary.c
+++ b/dlls/scrrun/tests/dictionary.c
@@ -589,6 +589,35 @@ static void test_Item(void)
     IDictionary_Release(dict);
 }
 
+static void test_Add(void)
+{
+    static const WCHAR testW[] = {'t','e','s','t','W',0};
+    VARIANT key, item;
+    IDictionary *dict;
+    HRESULT hr;
+    BSTR str;
+
+    hr = CoCreateInstance(&CLSID_Dictionary, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
+            &IID_IDictionary, (void**)&dict);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+
+    str = SysAllocString(testW);
+    V_VT(&key) = VT_I2;
+    V_I2(&key) = 1;
+    V_VT(&item) = VT_BSTR|VT_BYREF;
+    V_BSTRREF(&item) = &str;
+    hr = IDictionary_Add(dict, &key, &item);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+
+    hr = IDictionary_get_Item(dict, &key, &item);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(V_VT(&item) == VT_BSTR, "got %d\n", V_VT(&item));
+
+    SysFreeString(str);
+
+    IDictionary_Release(dict);
+}
+
 START_TEST(dictionary)
 {
     IDispatch *disp;
@@ -612,6 +641,7 @@ START_TEST(dictionary)
     test_Keys();
     test_Remove();
     test_Item();
+    test_Add();
 
     CoUninitialize();
 }




More information about the wine-cvs mailing list