Adam Martinson : msxml3: Implement schema_cache_remove().
Alexandre Julliard
julliard at winehq.org
Thu Oct 21 10:50:47 CDT 2010
Module: wine
Branch: master
Commit: eac6ed018ca96fd73fd8fb5145cd0b5875745d2e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=eac6ed018ca96fd73fd8fb5145cd0b5875745d2e
Author: Adam Martinson <amartinson at codeweavers.com>
Date: Wed Oct 20 16:35:55 2010 -0500
msxml3: Implement schema_cache_remove().
---
dlls/msxml3/schema.c | 9 +++++++--
dlls/msxml3/tests/schema.c | 8 ++++++--
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/msxml3/schema.c b/dlls/msxml3/schema.c
index 9ef08a3..7eadd51 100644
--- a/dlls/msxml3/schema.c
+++ b/dlls/msxml3/schema.c
@@ -448,8 +448,13 @@ static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection *iface, BSTR uri,
static HRESULT WINAPI schema_cache_remove(IXMLDOMSchemaCollection *iface, BSTR uri)
{
- FIXME("stub\n");
- return E_NOTIMPL;
+ schema_cache *This = impl_from_IXMLDOMSchemaCollection(iface);
+ xmlChar* name = xmlChar_from_wchar(uri);
+ TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(uri));
+
+ xmlHashRemoveEntry(This->cache, name, cache_free);
+ heap_free(name);
+ return S_OK;
}
static HRESULT WINAPI schema_cache_get_length(IXMLDOMSchemaCollection *iface, LONG *length)
diff --git a/dlls/msxml3/tests/schema.c b/dlls/msxml3/tests/schema.c
index f889af4..ba99c28 100644
--- a/dlls/msxml3/tests/schema.c
+++ b/dlls/msxml3/tests/schema.c
@@ -461,6 +461,10 @@ static void test_length(void)
ole_expect(IXMLDOMSchemaCollection_get_length(cache, NULL), E_POINTER);
+ /* MSDN lies; removing a non-existant entry produces no error */
+ ole_check(IXMLDOMSchemaCollection_remove(cache, NULL));
+ ole_check(IXMLDOMSchemaCollection_remove(cache, _bstr_(xdr_schema1_uri)));
+
length = -1;
ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
ok(length == 0, "expected length 0, got %i\n", length);
@@ -491,13 +495,13 @@ static void test_length(void)
ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
ok(length == 2, "expected length 2, got %i\n", length);
- ole_check(IXMLDOMSchemaCollection_add(cache, _bstr_(xdr_schema2_uri), v));
+ ole_check(IXMLDOMSchemaCollection_remove(cache, _bstr_(xdr_schema2_uri)));
length = -1;
ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
ok(length == 1, "expected length 1, got %i\n", length);
- ole_check(IXMLDOMSchemaCollection_add(cache, _bstr_(xdr_schema3_uri), v));
+ ole_check(IXMLDOMSchemaCollection_remove(cache, _bstr_(xdr_schema3_uri)));
length = -1;
ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
More information about the wine-cvs
mailing list