msxml3: Stop tests crashing under windows 98.

This commit is contained in:
Alistair Leslie-Hughes 2008-06-09 22:12:25 +10:00 committed by Alexandre Julliard
parent 77416b8668
commit 558ae52cc4
2 changed files with 16 additions and 2 deletions

View File

@ -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);

View File

@ -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");
}