From c545852013fd15999112a0413e5c627c9ec9fa00 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 23 Jul 2008 16:39:33 +0200 Subject: [PATCH] msxml3/tests: Add test for parsing from IStream. --- dlls/msxml3/tests/saxreader.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 26f232b9ca6..9c710334fc1 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -444,6 +444,10 @@ static void test_saxreader(void) SAFEARRAY *pSA; SAFEARRAYBOUND SADim[1]; char *pSAData = NULL; + IStream *iStream; + ULARGE_INTEGER liSize; + LARGE_INTEGER liPos; + ULONG bytesWritten; hr = CoCreateInstance(&CLSID_SAXXMLReader, NULL, CLSCTX_INPROC_SERVER, &IID_ISAXXMLReader, (LPVOID*)&reader); @@ -505,6 +509,22 @@ static void test_saxreader(void) SafeArrayDestroy(pSA); + CreateStreamOnHGlobal(NULL, TRUE, &iStream); + liSize.QuadPart = strlen(szTestXML); + IStream_SetSize(iStream, liSize); + IStream_Write(iStream, (void const*)szTestXML, strlen(szTestXML), &bytesWritten); + liPos.QuadPart = 0; + IStream_Seek(iStream, liPos, STREAM_SEEK_SET, NULL); + V_VT(&var) = VT_UNKNOWN|VT_DISPATCH; + V_UNKNOWN(&var) = (IUnknown*)iStream; + + expectCall = contentHandlerTest1; + hr = ISAXXMLReader_parse(reader, var); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + test_expect_call(CH_ENDTEST); + + IStream_Release(iStream); + ISAXXMLReader_Release(reader); } -- 2.11.4.GIT