[2/3] scrrun: Implement IDictionary RemoveAll (try 2)

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Tue Oct 9 04:26:20 CDT 2012


Hi,


Changelog:
      scrrun: Implement IDictionary RemoveAll


Best Regards
   Alistair Leslie-Hughes

-------------- next part --------------
>From ef56d1bf59eea94736dc567ea4135817def89f96 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Fri, 5 Oct 2012 11:29:55 +1000
Subject: [PATCH] Implement IDictionary RemoveAll
To: wine-patches <wine-patches at winehq.org>

---
 dlls/scrrun/dictionary.c       |    7 +++++--
 dlls/scrrun/tests/dictionary.c |    7 +++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/dlls/scrrun/dictionary.c b/dlls/scrrun/dictionary.c
index 62abb7f..df5e886 100644
--- a/dlls/scrrun/dictionary.c
+++ b/dlls/scrrun/dictionary.c
@@ -330,9 +330,12 @@ static HRESULT WINAPI dictionary_RemoveAll(IDictionary *iface)
 {
     dictionary *This = impl_from_IDictionary(iface);
 
-    FIXME("(%p)->()\n", This);
+    TRACE("(%p)->()\n", This);
 
-    return E_NOTIMPL;
+    remove_all_items(This);
+    This->count = 0;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI dictionary_put_CompareMode(IDictionary *iface, CompareMethod pcomp)
diff --git a/dlls/scrrun/tests/dictionary.c b/dlls/scrrun/tests/dictionary.c
index 7df76e9..d32d8a1 100644
--- a/dlls/scrrun/tests/dictionary.c
+++ b/dlls/scrrun/tests/dictionary.c
@@ -96,6 +96,13 @@ static void test_interfaces(void)
     ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
     ok(count == 1, "got %d, expected 1\n", count);
 
+    hr = IDictionary_RemoveAll(dict);
+    ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
+
+    hr = IDictionary_get_Count(dict, &count);
+    ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
+    ok(count == 0, "got %d, expected 0\n", count);
+
     IDictionary_Release(dict);
     IDispatch_Release(disp);
 }
-- 
1.7.9.5



More information about the wine-patches mailing list