[PATCH] Skip tests if we cannot create a document

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Wed Dec 17 04:11:58 CST 2008


---
 dlls/msxml3/tests/domdoc.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index bac7e3f..8cda276 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -3870,10 +3870,22 @@ static void test_NodeTypeValue(void)
 START_TEST(domdoc)
 {
     HRESULT r;
+    IXMLDOMDocument *doc;
 
     r = CoInitialize( NULL );
     ok( r == S_OK, "failed to init com\n");
 
+    /* If we cannot create an XML document, skip all tests */
+    r = CoCreateInstance( &CLSID_DOMDocument, NULL,
+        CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (LPVOID*)&doc );
+    if( r != S_OK )
+    {
+        skip("Cannot create XML Document. Assuming libxml2 not installed.\n");
+        goto END;
+    }
+
+    IXMLDOMDocument_Release(doc);
+
     test_domdoc();
     test_domnode();
     test_refs();
@@ -3897,5 +3909,6 @@ START_TEST(domdoc)
     test_FormattingXML();
     test_NodeTypeValue();
 
+END:
     CoUninitialize();
 }
-- 
1.5.4.3


--------------020900090302060407020900--



More information about the wine-patches mailing list