[PATCH] stop tests from crashing

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Mon Jun 9 07:12:25 CDT 2008


---
 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 076d1fe..b444b06 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 61a2300..5c80f7c 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");
 }
-- 
1.5.4.1


--------------000209090302020202080607--




More information about the wine-patches mailing list