Author: akhaldi
Date: Fri Oct 3 11:23:20 2014
New Revision: 64489
URL:
http://svn.reactos.org/svn/reactos?rev=64489&view=rev
Log:
[MSXML3_WINETEST]
* Sync with Wine 1.7.27.
CORE-8540
Modified:
trunk/rostests/winetests/msxml3/domdoc.c
trunk/rostests/winetests/msxml3/httpreq.c
trunk/rostests/winetests/msxml3/saxreader.c
trunk/rostests/winetests/msxml3/schema.c
trunk/rostests/winetests/msxml3/xmldoc.c
Modified: trunk/rostests/winetests/msxml3/domdoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/domdoc.c…
==============================================================================
--- trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] Fri Oct 3 11:23:20 2014
@@ -504,7 +504,7 @@
" </description>\n"
" </elem>\n"
"\n"
-" <elem>\n"
+" <elem a='a'>\n"
" <a>A2 field</a>\n"
" <b>B2 field</b>\n"
" <c type=\"old\">C2 field</c>\n"
@@ -1084,14 +1084,16 @@
static char buf[4096];
char *pos = buf;
LONG len = 0;
+ HRESULT hr;
int i;
if (list == NULL)
{
- lstrcpyA(buf, "(null)");
+ strcpy(buf, "(null)");
return buf;
}
- ole_check(IXMLDOMNodeList_get_length(list, &len));
+ hr = IXMLDOMNodeList_get_length(list, &len);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
for (i = 0; i < len; i++)
{
IXMLDOMNode *node;
@@ -1950,6 +1952,7 @@
ok( r == E_FAIL, "getAttribute ret %08x\n", r );
ok( V_VT(&var) == VT_NULL || V_VT(&var) == VT_EMPTY, "vt =
%x\n", V_VT(&var));
VariantClear(&var);
+ SysFreeString(str);
str = SysAllocString( szdl );
V_VT(&var) = VT_I4;
@@ -3020,8 +3023,24 @@
IXMLDOMDocument_Release( doc );
}
+struct queryresult_t {
+ const char *query;
+ const char *result;
+ int len;
+};
+
+static const struct queryresult_t elementsbytagname[] = {
+ { "", "P1.D1 E2.D1 E1.E2.D1 T1.E1.E2.D1 E2.E2.D1 T1.E2.E2.D1
E3.E2.D1 E4.E2.D1 E1.E4.E2.D1 T1.E1.E4.E2.D1", 10 },
+ { "*", "E2.D1 E1.E2.D1 E2.E2.D1 E3.E2.D1 E4.E2.D1 E1.E4.E2.D1",
6 },
+ { "bs", "E1.E2.D1", 1 },
+ { "dl", "", 0 },
+ { "str1","", 0 },
+ { NULL }
+};
+
static void test_getElementsByTagName(void)
{
+ const struct queryresult_t *ptr = elementsbytagname;
IXMLDOMNodeList *node_list;
IXMLDOMDocument *doc;
IXMLDOMElement *elem;
@@ -3037,22 +3056,24 @@
ok( r == S_OK, "loadXML failed\n");
ok( b == VARIANT_TRUE, "failed to load XML string\n");
- str = SysAllocString( szstar );
-
/* null arguments cases */
r = IXMLDOMDocument_getElementsByTagName(doc, NULL, &node_list);
ok( r == E_INVALIDARG, "ret %08x\n", r );
- r = IXMLDOMDocument_getElementsByTagName(doc, str, NULL);
+ r = IXMLDOMDocument_getElementsByTagName(doc, _bstr_("*"), NULL);
ok( r == E_INVALIDARG, "ret %08x\n", r );
- r = IXMLDOMDocument_getElementsByTagName(doc, str, &node_list);
- ok( r == S_OK, "ret %08x\n", r );
- r = IXMLDOMNodeList_get_length( node_list, &len );
- ok( r == S_OK, "ret %08x\n", r );
- ok( len == 6, "len %d\n", len );
-
- IXMLDOMNodeList_Release( node_list );
- SysFreeString( str );
+ while (ptr->query)
+ {
+ r = IXMLDOMDocument_getElementsByTagName(doc, _bstr_(ptr->query),
&node_list);
+ ok(r == S_OK, "ret %08x\n", r);
+ r = IXMLDOMNodeList_get_length(node_list, &len);
+ ok(r == S_OK, "ret %08x\n", r);
+ ok(len == ptr->len, "%s: got len %d, expected %d\n", ptr->query,
len, ptr->len);
+ expect_list_and_release(node_list, ptr->result);
+
+ free_bstrs();
+ ptr++;
+ }
/* broken query BSTR */
memcpy(&buff[2], szstar, sizeof(szstar));
@@ -3064,33 +3085,6 @@
ok( r == S_OK, "ret %08x\n", r );
ok( len == 6, "len %d\n", len );
IXMLDOMNodeList_Release( node_list );
-
- str = SysAllocString( szbs );
- r = IXMLDOMDocument_getElementsByTagName(doc, str, &node_list);
- ok( r == S_OK, "ret %08x\n", r );
- r = IXMLDOMNodeList_get_length( node_list, &len );
- ok( r == S_OK, "ret %08x\n", r );
- ok( len == 1, "len %d\n", len );
- IXMLDOMNodeList_Release( node_list );
- SysFreeString( str );
-
- str = SysAllocString( szdl );
- r = IXMLDOMDocument_getElementsByTagName(doc, str, &node_list);
- ok( r == S_OK, "ret %08x\n", r );
- r = IXMLDOMNodeList_get_length( node_list, &len );
- ok( r == S_OK, "ret %08x\n", r );
- ok( len == 0, "len %d\n", len );
- IXMLDOMNodeList_Release( node_list );
- SysFreeString( str );
-
- str = SysAllocString( szstr1 );
- r = IXMLDOMDocument_getElementsByTagName(doc, str, &node_list);
- ok( r == S_OK, "ret %08x\n", r );
- r = IXMLDOMNodeList_get_length( node_list, &len );
- ok( r == S_OK, "ret %08x\n", r );
- ok( len == 0, "len %d\n", len );
- IXMLDOMNodeList_Release( node_list );
- SysFreeString( str );
/* test for element */
r = IXMLDOMDocument_get_documentElement(doc, &elem);
@@ -4488,12 +4482,13 @@
{ "child::node()", "E1.E2.D1 E2.E2.D1 E3.E2.D1 E4.E2.D1" },
{ "child::text()", "" },
{ "child::*/..", "E2.D1" },
- { "child::*//@*/..", "E2.E5.E1.E2.D1 E3.E2.E2.D1" },
+ { "child::*//@*/..", "E2.E5.E1.E2.D1 E2.E2.D1 E3.E2.E2.D1" },
{ "self::node()", "E2.D1" },
{ "ancestor::node()", "D1" },
{ "elem[c][last()]/a", "E1.E2.E2.D1"},
{ "ancestor-or-self::node()[1]", "E2.D1" },
{ "((//a)[1])[last()]", "E1.E1.E2.D1" },
+ { "//elem[@*]", "E2.E2.D1" },
{ NULL }
};
@@ -4556,7 +4551,7 @@
str = list_to_string(list);
- ok(strcmp(str, xptest->list)==0, "query=%s, invalid node list: %s,
expected %s\n",
+ ok(!strcmp(str, xptest->list), "query=%s, invalid node list:
\"%s\", expected \"%s\"\n",
xptest->query, str, xptest->list);
if (list)
@@ -6879,6 +6874,7 @@
typedef struct {
const char *query;
const char *list;
+ BOOL todo;
} xslpattern_test_t;
static const xslpattern_test_t xslpattern_test[] = {
@@ -6941,6 +6937,7 @@
{ "root/elem[index()>0 $and$ $not$ end()]", "E2.E2.D1
E3.E2.D1" },
{ "root/elem[index()>0 && $not$ end()]", "E2.E2.D1
E3.E2.D1" },
{ "root/elem[d]", "E1.E2.D1 E2.E2.D1 E4.E2.D1" },
+ { "root/elem[@*]", "E2.E2.D1 E3.E2.D1", TRUE },
{ NULL }
};
@@ -7018,8 +7015,16 @@
len = 0;
hr = IXMLDOMNodeList_get_length(list, &len);
ok(len != 0, "query=%s, empty list\n", ptr->query);
- if (len)
- expect_list_and_release(list, ptr->list);
+ if (len) {
+ if (ptr->todo) {
+ char *str = list_to_string(list);
+ todo_wine
+ ok(!strcmp(str, ptr->list), "Invalid node list: %s, expected
%s\n", str, ptr->list);
+ IXMLDOMNodeList_Release(list);
+ }
+ else
+ expect_list_and_release(list, ptr->list);
+ }
ptr++;
}
@@ -8163,6 +8168,7 @@
EXPECT_HR(hr, S_OK);
ok(!lstrcmpW(str, _bstr_("ABCD")), "%s\n", wine_dbgstr_w(str));
IXMLDOMNode_Release(node);
+ SysFreeString(str);
array = SafeArrayCreateVector(VT_UI1, 0, 7);
hr = SafeArrayAccessData(array, (void*)&ptr);
@@ -8202,6 +8208,7 @@
ok(!lstrcmpW(str, _bstr_("ZEdWemRBPQ==")), "%s\n",
wine_dbgstr_w(str));
IXMLDOMNode_Release(node);
SafeArrayDestroyData(array);
+ SysFreeString(str);
/* bin.hex */
V_VT(&value) = VT_BSTR;
@@ -8250,6 +8257,7 @@
ok(!lstrcmpW(str, _bstr_("000102030405060708090a0b0c0d0e0f")),
"%s\n", wine_dbgstr_w(str));
IXMLDOMNode_Release(node);
SafeArrayDestroyData(array);
+ SysFreeString(str);
IXMLDOMElement_Release(elem);
IXMLDOMDocument_Release(doc);
@@ -9457,6 +9465,7 @@
IEnumVARIANT_Release(enum1);
IEnumVARIANT_Release(enum2);
+ IEnumVARIANT_Release(enum3);
enum1 = NULL;
hr = IXMLDOMSelection_get__newEnum(selection, (IUnknown**)&enum1);
@@ -9550,6 +9559,7 @@
EXPECT_HR(hr, S_OK);
ok(!lstrcmpW(name, _bstr_("c")), "got node name %s\n",
wine_dbgstr_w(name));
IXMLDOMNode_Release(node);
+ SysFreeString(name);
V_VT(&v) = VT_I2;
hr = IEnumVARIANT_Next(enum1, 1, &v, NULL);
@@ -9571,6 +9581,7 @@
EXPECT_HR(hr, S_OK);
ok(!lstrcmpW(name, _bstr_("d")), "got node name %s\n",
wine_dbgstr_w(name));
IXMLDOMNode_Release(node);
+ SysFreeString(name);
IXMLDOMSelection_Release(selection);
IXMLDOMNodeList_Release(list);
@@ -10563,6 +10574,7 @@
EXPECT_HR(hr, S_OK);
ok(did == DISPID_DOM_COLLECTION_BASE, "got 0x%08x\n", did);
IDispatchEx_Release(dispex);
+ IXMLDOMNamedNodeMap_Release(map);
hr = IXMLDOMDocument_selectNodes(doc, _bstr_("root/b"), &node_list);
EXPECT_HR(hr, S_OK);
@@ -10584,7 +10596,7 @@
hr = IDispatchEx_GetDispID(dispex, _bstr_("1"), 0, &did);
EXPECT_HR(hr, S_OK);
ok(did == DISPID_DOM_COLLECTION_BASE+1, "got 0x%08x\n", did);
- IDispatchEx_Release(dispex);
+ IXMLDOMNamedNodeMap_Release(map);
did = -1;
hr = IDispatchEx_GetDispID(dispex, _bstr_("item"), 0, &did);
@@ -10677,7 +10689,7 @@
ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret));
ok(broken(V_I4(&ret) == 1) || (V_I4(&ret) == 0), "got %d\n",
V_I4(&ret));
- IXMLDOMNamedNodeMap_Release(map);
+ IDispatchEx_Release(dispex);
IXMLDOMElement_Release(elem);
/* IXMLDOMImplementation */
@@ -11085,7 +11097,6 @@
hr = IXMLDOMDocument_appendChild(doc, (IXMLDOMNode*)root, NULL);
EXPECT_HR(hr, S_OK);
- str = SysAllocString(szAttribute);
hr = IXMLDOMDocument_createAttribute(doc, _bstr_("xmlns:dt"),
&pAttribute);
ok( hr == S_OK, "returns %08x\n", hr );
@@ -11102,15 +11113,15 @@
hr = IXMLDOMDocument_get_documentElement(doc, &elem);
EXPECT_HR(hr, S_OK);
+ str = NULL;
hr = IXMLDOMElement_get_xml(elem, &str);
ok( hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok( lstrcmpW(str, _bstr_("<Testing
xmlns:dt=\"urn:schemas-microsoft-com:datatypes\"
dt:dt=\"bin.base64\"/>")) == 0,
"got %s\n", wine_dbgstr_w(str));
+ SysFreeString(str);
IXMLDOMElement_Release(elem);
IXMLDOMAttribute_Release( pAttribute);
-
- SysFreeString(str);
IXMLDOMDocument_Release(doc);
@@ -11825,6 +11836,7 @@
ok(hr == S_FALSE, "%d: got 0x%08x\n", i, hr);
ok(str == NULL, "%d: got prefix %s\n", i, wine_dbgstr_w(str));
}
+ SysFreeString(str);
str = NULL;
hr = IXMLDOMNode_get_namespaceURI(node, &str);
Modified: trunk/rostests/winetests/msxml3/httpreq.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/httpreq.…
==============================================================================
--- trunk/rostests/winetests/msxml3/httpreq.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msxml3/httpreq.c [iso-8859-1] Fri Oct 3 11:23:20 2014
@@ -1463,14 +1463,12 @@
hr = IXMLHttpRequest_get_responseBody(xhr, &varbody);
EXPECT_HR(hr, E_PENDING);
ok(V_VT(&varbody) == VT_EMPTY, "got type %d\n", V_VT(&varbody));
- ok(V_I2(&varbody) == 1, "got %d\n", V_I2(&varbody));
V_VT(&varbody) = VT_I2;
V_I2(&varbody) = 1;
hr = IXMLHttpRequest_get_responseStream(xhr, &varbody);
EXPECT_HR(hr, E_PENDING);
ok(V_VT(&varbody) == VT_EMPTY, "got type %d\n", V_VT(&varbody));
- ok(V_I2(&varbody) == 1, "got %d\n", V_I2(&varbody));
/* send before open */
hr = IXMLHttpRequest_send(xhr, dummy);
Modified: trunk/rostests/winetests/msxml3/saxreader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/saxreade…
==============================================================================
--- trunk/rostests/winetests/msxml3/saxreader.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msxml3/saxreader.c [iso-8859-1] Fri Oct 3 11:23:20 2014
@@ -1993,7 +1993,6 @@
static HRESULT WINAPI istream_Stat(IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
{
- ok(0, "unexpected call\n");
return E_NOTIMPL;
}
@@ -2447,6 +2446,7 @@
hr = ISAXXMLReader_parse(reader, var);
EXPECT_HR(hr, S_OK);
ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "attribute value
normalization", TRUE);
+ IStream_Release(stream);
resolver = (void*)0xdeadbeef;
hr = ISAXXMLReader_getEntityResolver(reader, &resolver);
@@ -2479,6 +2479,8 @@
ok(hr == S_OK, "got 0x%08x\n", hr);
sprintf(seqname, "%s: cdata test", table->name);
ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, seqname, TRUE);
+
+ IStream_Release(stream);
/* 2. CDATA sections */
stream = create_test_stream(test2_cdata_xml, -1);
@@ -3301,8 +3303,9 @@
ok(pos2.QuadPart == 0, "expected stream beginning\n");
len = 2048;
- buff = HeapAlloc(GetProcessHeap(), 0, len);
+ buff = HeapAlloc(GetProcessHeap(), 0, len+1);
memset(buff, 'A', len);
+ buff[len] = 0;
hr = ISAXContentHandler_characters(content, _bstr_(buff), len);
EXPECT_HR(hr, S_OK);
@@ -3348,6 +3351,7 @@
ok(pos2.QuadPart == 0, "expected stream beginning\n");
memset(buff, 'A', len);
+ buff[len] = 0;
hr = ISAXContentHandler_characters(content, _bstr_(buff), len - 8);
EXPECT_HR(hr, S_OK);
@@ -3372,6 +3376,7 @@
EXPECT_HR(hr, S_OK);
memset(buff, 'A', len);
+ buff[len] = 0;
hr = ISAXContentHandler_characters(content, _bstr_(buff), len);
EXPECT_HR(hr, S_OK);
@@ -4245,6 +4250,7 @@
EXPECT_HR(hr, S_OK);
ok(pos2.QuadPart == 2, "got wrong position\n");
+ IStream_Release(stream);
ISAXContentHandler_Release(content);
IMXWriter_Release(writer);
@@ -5510,6 +5516,7 @@
ISAXAttributes_Release(saxattr);
IMXAttributes_Release(mxattr);
+ free_bstrs();
}
}
Modified: trunk/rostests/winetests/msxml3/schema.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/schema.c…
==============================================================================
--- trunk/rostests/winetests/msxml3/schema.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msxml3/schema.c [iso-8859-1] Fri Oct 3 11:23:20 2014
@@ -1283,24 +1283,20 @@
while (ptr->query)
{
IXMLDOMNode* node = NULL;
- VARIANT type, testv;
+ VARIANT type;
/* check data types without the schema */
- memset(&testv, -1, sizeof(VARIANT));
- V_VT(&testv) = VT_NULL;
- V_BSTR(&testv) = NULL;
-
hr = IXMLDOMDocument2_selectSingleNode(doc, _bstr_(ptr->query), &node);
EXPECT_HR(hr, S_OK);
ok(node != NULL, "expected node\n");
- memset(&type, -1, sizeof(VARIANT));
V_VT(&type) = VT_EMPTY;
+ V_BSTR(&type) = (void*)-1;
hr = IXMLDOMNode_get_dataType(node, &type);
EXPECT_HR(hr, S_FALSE);
ok(V_VT(&type) == VT_NULL, "got type %i\n", V_VT(&type));
/* when returning VT_NULL, the pointer is set to NULL */
- ok(!memcmp(&testv, &type, sizeof(VARIANT)), "got %p\n",
V_BSTR(&type));
+ ok(V_BSTR(&type) == NULL, "got %p\n", V_BSTR(&type));
VariantClear(&type);
hr = IXMLDOMNode_get_nodeTypedValue(node, &type);
@@ -1531,7 +1527,7 @@
if (!cache) return;
hr = IXMLDOMSchemaCollection2_get(cache, NULL, NULL);
- EXPECT_HR(hr, E_NOTIMPL);
+ ok(hr == E_NOTIMPL || hr == E_POINTER /* win8 */, "got %08x\n", hr);
hr = IXMLDOMSchemaCollection2_get(cache, _bstr_("uri"), &node);
EXPECT_HR(hr, E_NOTIMPL);
Modified: trunk/rostests/winetests/msxml3/xmldoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/xmldoc.c…
==============================================================================
--- trunk/rostests/winetests/msxml3/xmldoc.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msxml3/xmldoc.c [iso-8859-1] Fri Oct 3 11:23:20 2014
@@ -661,7 +661,7 @@
WCHAR path[MAX_PATH];
LONG length, type;
ULONG num_vars;
- VARIANT var, vIndex, vName;
+ VARIANT var, dummy, vIndex, vName;
BSTR url, str;
static const CHAR szBankXML[] = "bank.xml";
static const WCHAR szNumber[] =
{'N','U','M','B','E','R',0};
@@ -771,14 +771,16 @@
ok(num_vars == 1, "Expected 1, got %d\n", num_vars);
/* try advance further, no children left */
- hr = IEnumVARIANT_Next(enumVar, 1, &var, &num_vars);
+ V_VT(&dummy) = VT_I4;
+ hr = IEnumVARIANT_Next(enumVar, 1, &dummy, &num_vars);
ok(hr == S_FALSE, "Expected S_FALSE, got %08x\n", hr);
- ok(V_VT(&var) == 0, "Expected 0, got %d\n", V_VT(&var));
+ ok(V_VT(&dummy) == VT_EMPTY, "Expected 0, got %d\n",
V_VT(&dummy));
ok(num_vars == 0, "Expected 0, got %d\n", num_vars);
- hr = IEnumVARIANT_Next(enumVar, 1, &var, NULL);
+ V_VT(&dummy) = VT_I4;
+ hr = IEnumVARIANT_Next(enumVar, 1, &dummy, NULL);
ok(hr == S_FALSE, "Expected S_FALSE, got %08x\n", hr);
- ok(V_VT(&var) == 0, "Expected 0, got %d\n", V_VT(&var));
+ ok(V_VT(&dummy) == VT_EMPTY, "Expected 0, got %d\n",
V_VT(&dummy));
hr = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IXMLElement, (LPVOID
*)&child);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);