Commit ca046f9e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: IXMLDOMSchemaCollection::get() is a stub for version 6.

parent 1ec21e32
......@@ -2508,10 +2508,13 @@ static HRESULT WINAPI domdoc_put_onTransformNode(
static HRESULT WINAPI domdoc_get_namespaces(
IXMLDOMDocument3* iface,
IXMLDOMSchemaCollection** schemaCollection )
IXMLDOMSchemaCollection** collection )
{
domdoc *This = impl_from_IXMLDOMDocument3( iface );
FIXME("(%p)->(%p)\n", This, schemaCollection);
FIXME("(%p)->(%p): stub\n", This, collection);
if (!collection) return E_POINTER;
return E_NOTIMPL;
}
......
......@@ -1139,10 +1139,13 @@ static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection2* iface, BSTR uri
IXMLDOMNode** node)
{
schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface);
xmlChar* name;
cache_entry* entry;
xmlChar* name;
TRACE("(%p)->(%s %p)\n", This, wine_dbgstr_w(uri), node);
if (This->version == MSXML6) return E_NOTIMPL;
if (!node)
return E_POINTER;
......@@ -1438,7 +1441,7 @@ HRESULT SchemaCache_create(MSXML_VERSION version, IUnknown* outer, void** obj)
#else
HRESULT SchemaCache_create(MSXML_VERSION version, IUnknown* pUnkOuter, void** ppObj)
HRESULT SchemaCache_create(MSXML_VERSION version, IUnknown* outer, void** obj)
{
MESSAGE("This program tried to use a SchemaCache object, but\n"
"libxml2 support was not present at compile time.\n");
......
......@@ -11140,6 +11140,86 @@ static void test_nodeValue(void)
IXMLDOMDocument_Release(doc);
}
static char namespacesA[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
" <ns1:elem1 xmlns:ns1=\"http://blah.org\">"
" <ns1:elem2/>"
" <ns1:elem3/>"
" <ns1:elem4/>"
" <elem5 xmlns=\"http://blahblah.org\"/>"
" <ns1:elem6>true</ns1:elem6>"
" </ns1:elem1>";
static void test_get_namespaces(void)
{
IXMLDOMSchemaCollection *collection, *collection2;
IXMLDOMDocument2 *doc;
IXMLDOMNode *node;
VARIANT_BOOL b;
HRESULT hr;
LONG len;
doc = create_document(&IID_IXMLDOMDocument2);
if (!doc) return;
/* null pointer */
hr = IXMLDOMDocument2_get_namespaces(doc, NULL);
EXPECT_HR(hr, E_POINTER);
/* no document loaded */
collection = (void*)0xdeadbeef;
hr = IXMLDOMDocument2_get_namespaces(doc, &collection);
todo_wine
EXPECT_HR(hr, S_OK);
if (hr != S_OK)
{
IXMLDOMDocument_Release(doc);
return;
}
EXPECT_REF(collection, 2);
collection2 = (void*)0xdeadbeef;
hr = IXMLDOMDocument2_get_namespaces(doc, &collection2);
EXPECT_HR(hr, S_OK);
ok(collection == collection2, "got %p\n", collection2);
EXPECT_REF(collection, 3);
IXMLDOMSchemaCollection_Release(collection);
len = -1;
hr = IXMLDOMSchemaCollection_get_length(collection, &len);
EXPECT_HR(hr, S_OK);
ok(len == 0, "got %d\n", len);
IXMLDOMSchemaCollection_Release(collection);
/* now with document */
hr = IXMLDOMDocument2_loadXML(doc, _bstr_(namespacesA), &b);
EXPECT_HR(hr, S_OK);
hr = IXMLDOMDocument2_get_namespaces(doc, &collection);
EXPECT_HR(hr, S_OK);
len = -1;
hr = IXMLDOMSchemaCollection_get_length(collection, &len);
EXPECT_HR(hr, S_OK);
ok(len == 2, "got %d\n", len);
/* try to lookup some uris */
node = (void*)0xdeadbeef;
hr = IXMLDOMSchemaCollection_get(collection, _bstr_("http://blah.org"), &node);
EXPECT_HR(hr, S_OK);
ok(node == NULL, "got %p\n", node);
node = (void*)0xdeadbeef;
hr = IXMLDOMSchemaCollection_get(collection, _bstr_("http://blah1.org"), &node);
EXPECT_HR(hr, S_OK);
ok(node == NULL, "got %p\n", node);
IXMLDOMSchemaCollection_Release(collection);
IXMLDOMDocument2_Release(doc);
free_bstrs();
}
START_TEST(domdoc)
{
IXMLDOMDocument *doc;
......@@ -11216,6 +11296,7 @@ START_TEST(domdoc)
test_getAttributeNode();
test_supporterrorinfo();
test_nodeValue();
test_get_namespaces();
test_xsltemplate();
......
......@@ -2061,6 +2061,41 @@ static void test_dispex(void)
IXMLDOMSchemaCollection_Release(cache);
}
static void test_get(void)
{
static const WCHAR uriW[] = {'u','r','i',0};
IXMLDOMSchemaCollection2 *cache;
IXMLDOMNode *node;
HRESULT hr;
BSTR s;
cache = create_cache_version(60, &IID_IXMLDOMSchemaCollection2);
if (!cache) return;
hr = IXMLDOMSchemaCollection2_get(cache, NULL, NULL);
EXPECT_HR(hr, E_NOTIMPL);
s = SysAllocString(uriW);
hr = IXMLDOMSchemaCollection2_get(cache, s, &node);
EXPECT_HR(hr, E_NOTIMPL);
SysFreeString(s);
IXMLDOMSchemaCollection2_Release(cache);
cache = create_cache_version(40, &IID_IXMLDOMSchemaCollection2);
if (!cache) return;
hr = IXMLDOMSchemaCollection2_get(cache, NULL, NULL);
EXPECT_HR(hr, E_POINTER);
s = SysAllocString(uriW);
hr = IXMLDOMSchemaCollection2_get(cache, s, &node);
EXPECT_HR(hr, S_OK);
SysFreeString(s);
IXMLDOMSchemaCollection2_Release(cache);
}
START_TEST(schema)
{
HRESULT r;
......@@ -2076,6 +2111,7 @@ START_TEST(schema)
test_XDR_datatypes();
test_validate_on_load();
test_dispex();
test_get();
CoUninitialize();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment