From 558ae52cc464269457833cfb08879550a63a5d13 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 9 Jun 2008 22:12:25 +1000 Subject: [PATCH] msxml3: Stop tests crashing under windows 98. --- dlls/msxml3/tests/xmldoc.c | 9 ++++++++- dlls/msxml3/tests/xmlelem.c | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/msxml3/tests/xmldoc.c b/dlls/msxml3/tests/xmldoc.c index 076d1fe9a06..b444b06db60 100644 --- a/dlls/msxml3/tests/xmldoc.c +++ b/dlls/msxml3/tests/xmldoc.c @@ -28,6 +28,9 @@ #include "wine/test.h" +/* Deprecated Error Code */ +#define XML_E_INVALIDATROOTLEVEL 0xc00ce556 + static void append_str(char **str, const char *data) { sprintf(*str, data); @@ -113,7 +116,10 @@ static void test_xmldoc(void) ok(element == NULL, "Expected NULL element\n"); hr = IPersistStreamInit_Load(psi, stream); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + ok(hr == S_OK || hr == XML_E_INVALIDATROOTLEVEL, "Expected S_OK, got %08x\n", hr); + if(hr == XML_E_INVALIDATROOTLEVEL) + goto cleanup; + ok(stream != NULL, "Expected non-NULL stream\n"); hr = IXMLDocument_get_root(doc, &element); @@ -234,6 +240,7 @@ static void test_xmldoc(void) IXMLElement_Release(child); IXMLElementCollection_Release(collection); IXMLElement_Release(element); +cleanup: IStream_Release(stream); IPersistStreamInit_Release(psi); IXMLDocument_Release(doc); diff --git a/dlls/msxml3/tests/xmlelem.c b/dlls/msxml3/tests/xmlelem.c index 61a2300c272..5c80f7c5ca0 100644 --- a/dlls/msxml3/tests/xmlelem.c +++ b/dlls/msxml3/tests/xmlelem.c @@ -30,6 +30,8 @@ #include "wine/test.h" +#define ERROR_URL_NOT_FOUND 0x800c0006 + static void test_xmlelem(void) { HRESULT hr; @@ -281,9 +283,13 @@ static void test_xmlelem_collection(void) url = SysAllocString(path); hr = IXMLDocument_put_URL(doc, url); - ok(hr == S_OK, "Expected S_OK, got %d\n", hr); + /* Win98 returns ERROR_URL_NOT_FOUND */ + ok(hr == S_OK || hr == ERROR_URL_NOT_FOUND, "Expected S_OK, got 0x%08x\n", hr); SysFreeString(url); + if(hr == ERROR_URL_NOT_FOUND) + goto cleanup; + hr = IXMLDocument_get_root(doc, &element); ok(hr == S_OK, "Expected S_OK, got %d\n", hr); ok(element != NULL, "Expected non-NULL element\n"); @@ -434,6 +440,7 @@ static void test_xmlelem_collection(void) IEnumVARIANT_Release(enumVar); IXMLElement_Release(element); IXMLElementCollection_Release(collection); +cleanup: IXMLDocument_Release(doc); DeleteFileA("bank.xml"); }