msxml3/test: Add test for ISAXXMLReader_parse (passing XMLDOMDocument as argument).

This commit is contained in:
Piotr Caban 2008-09-19 16:01:24 +02:00 committed by Alexandre Julliard
parent eb72aa05db
commit 0532df61be
1 changed files with 21 additions and 0 deletions

View File

@ -479,6 +479,9 @@ static void test_saxreader(void)
HANDLE file;
static const CHAR testXmlA[] = "test.xml";
static const WCHAR testXmlW[] = {'t','e','s','t','.','x','m','l',0};
IXMLDOMDocument *domDocument;
BSTR bstrData;
VARIANT_BOOL vBool;
hr = CoCreateInstance(&CLSID_SAXXMLReader, NULL, CLSCTX_INPROC_SERVER,
&IID_ISAXXMLReader, (LPVOID*)&reader);
@ -576,6 +579,24 @@ static void test_saxreader(void)
DeleteFileA(testXmlA);
hr = CoCreateInstance(&CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
&IID_IXMLDOMDocument, (LPVOID*)&domDocument);
if(FAILED(hr))
{
skip("Failed to create DOMDocument instance\n");
return;
}
bstrData = SysAllocString(szSimpleXML);
hr = IXMLDOMDocument_loadXML(domDocument, bstrData, &vBool);
V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)domDocument;
expectCall = contentHandlerTest2;
hr = ISAXXMLReader_parse(reader, var);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
test_expect_call(CH_ENDTEST);
IXMLDOMDocument_Release(domDocument);
ISAXXMLReader_Release(reader);
}