msxml3: Implement schema_cache_remove().

This commit is contained in:
Adam Martinson 2010-10-20 16:35:55 -05:00 committed by Alexandre Julliard
parent f8bdf8b5af
commit eac6ed018c
2 changed files with 13 additions and 4 deletions

View File

@ -448,8 +448,13 @@ static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection *iface, BSTR uri,
static HRESULT WINAPI schema_cache_remove(IXMLDOMSchemaCollection *iface, BSTR uri) static HRESULT WINAPI schema_cache_remove(IXMLDOMSchemaCollection *iface, BSTR uri)
{ {
FIXME("stub\n"); schema_cache *This = impl_from_IXMLDOMSchemaCollection(iface);
return E_NOTIMPL; 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) static HRESULT WINAPI schema_cache_get_length(IXMLDOMSchemaCollection *iface, LONG *length)

View File

@ -461,6 +461,10 @@ static void test_length(void)
ole_expect(IXMLDOMSchemaCollection_get_length(cache, NULL), E_POINTER); 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; length = -1;
ole_check(IXMLDOMSchemaCollection_get_length(cache, &length)); ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
ok(length == 0, "expected length 0, got %i\n", 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)); ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
ok(length == 2, "expected length 2, got %i\n", 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; length = -1;
ole_check(IXMLDOMSchemaCollection_get_length(cache, &length)); ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));
ok(length == 1, "expected length 1, got %i\n", 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; length = -1;
ole_check(IXMLDOMSchemaCollection_get_length(cache, &length)); ole_check(IXMLDOMSchemaCollection_get_length(cache, &length));