From: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> --- dlls/msxml6/tests/saxreader.c | 249 +++++++++++++++++----------------- 1 file changed, 121 insertions(+), 128 deletions(-) diff --git a/dlls/msxml6/tests/saxreader.c b/dlls/msxml6/tests/saxreader.c index 4ce074a266b..70965a98728 100644 --- a/dlls/msxml6/tests/saxreader.c +++ b/dlls/msxml6/tests/saxreader.c @@ -1491,7 +1491,7 @@ static void test_mxwriter_flush(void) hr = ISAXContentHandler_startDocument(content); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, _bstr_("a"), 1, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, L"a", 1, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* internal buffer is flushed automatically on certain threshold */ @@ -1539,7 +1539,7 @@ static void test_mxwriter_flush(void) hr = ISAXContentHandler_startDocument(content); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, _bstr_("a"), 1, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, L"a", 1, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); pos.QuadPart = 0; @@ -1570,7 +1570,7 @@ static void test_mxwriter_flush(void) hr = ISAXContentHandler_startDocument(content); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, _bstr_("a"), 1, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, L"a", 1, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); memset(buff, 'A', len); @@ -1627,8 +1627,8 @@ static void test_mxwriter_startenddocument(void) hr = IMXWriter_get_output(writer, &dest); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); - ok(!lstrcmpW(_bstr_("<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"no\"?>\r\n" - "<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"no\"?>\r\n"), V_BSTR(&dest)), + ok(!lstrcmpW(L"<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"no\"?>\r\n" + "<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"no\"?>\r\n", V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); VariantClear(&dest); @@ -1675,39 +1675,39 @@ enum startendtype struct writer_startendelement_t { enum startendtype type; - const char *uri; - const char *local_name; - const char *qname; - const char *output; + const WCHAR *uri; + const WCHAR *local_name; + const WCHAR *qname; + const WCHAR *output; HRESULT hr; ISAXAttributes *attr; }; -static const char startelement_xml[] = "<uri:local a:attr1=\"a1\" attr2=\"a2\" attr3=\"<&">\'\">"; -static const char startendelement_xml[] = "<uri:local a:attr1=\"a1\" attr2=\"a2\" attr3=\"<&">\'\"/>"; +static const WCHAR startelement_xml[] = L"<uri:local a:attr1=\"a1\" attr2=\"a2\" attr3=\"<&">\'\">"; +static const WCHAR startendelement_xml[] = L"<uri:local a:attr1=\"a1\" attr2=\"a2\" attr3=\"<&">\'\"/>"; static const struct writer_startendelement_t writer_startendelement[] = { - { StartElement, NULL, NULL, NULL, "<>", S_OK }, - { StartElement, "uri", NULL, NULL, "<>", S_OK }, - { StartElement, NULL, "local", NULL, "<>", S_OK }, - { StartElement, NULL, NULL, "qname", "<qname>", S_OK }, - { StartElement, "uri", "local", "qname", "<qname>", S_OK }, - { StartElement, "uri", "local", NULL, "<>", S_OK }, - { StartElement, "uri", "local", "uri:local", "<uri:local>", S_OK }, - { StartElement, "uri", "local", "uri:local2", "<uri:local2>", S_OK }, - { EndElement, NULL, NULL, NULL, "</>", S_OK }, - { EndElement, "uri", NULL, NULL, "</>", S_OK }, - { EndElement, NULL, "local", NULL, "</>", S_OK }, - { EndElement, NULL, NULL, "qname", "</qname>", S_OK }, - { EndElement, "uri", "local", "qname", "</qname>", S_OK }, - { EndElement, "uri", "local", NULL, "</>", S_OK }, - { EndElement, "uri", "local", "uri:local", "</uri:local>", S_OK }, - { EndElement, "uri", "local", "uri:local2", "</uri:local2>", S_OK }, - { StartElement, "uri", "local", "uri:local", startelement_xml, S_OK, &saxattributes }, - { StartEndElement, "uri", "local", "uri:local", startendelement_xml, S_OK, &saxattributes }, - { StartEndElement, "", "", "", "</>", S_OK }, - { StartEndElement | DisableEscaping, "uri", "local", "uri:local", startendelement_xml, S_OK, &saxattributes }, + { StartElement, NULL, NULL, NULL, L"<>", S_OK }, + { StartElement, L"uri", NULL, NULL, L"<>", S_OK }, + { StartElement, NULL, L"local", NULL, L"<>", S_OK }, + { StartElement, NULL, NULL, L"qname", L"<qname>", S_OK }, + { StartElement, L"uri", L"local", L"qname", L"<qname>", S_OK }, + { StartElement, L"uri", L"local", NULL, L"<>", S_OK }, + { StartElement, L"uri", L"local", L"uri:local", L"<uri:local>", S_OK }, + { StartElement, L"uri", L"local", L"uri:local2", L"<uri:local2>", S_OK }, + { EndElement, NULL, NULL, NULL, L"</>", S_OK }, + { EndElement, L"uri", NULL, NULL, L"</>", S_OK }, + { EndElement, NULL, L"local", NULL, L"</>", S_OK }, + { EndElement, NULL, NULL, L"qname", L"</qname>", S_OK }, + { EndElement, L"uri", L"local", L"qname", L"</qname>", S_OK }, + { EndElement, L"uri", L"local", NULL, L"</>", S_OK }, + { EndElement, L"uri", L"local", L"uri:local", L"</uri:local>", S_OK }, + { EndElement, L"uri", L"local", L"uri:local2", L"</uri:local2>", S_OK }, + { StartElement, L"uri", L"local", L"uri:local", startelement_xml, S_OK, &saxattributes }, + { StartEndElement, L"uri", L"local", L"uri:local", startendelement_xml, S_OK, &saxattributes }, + { StartEndElement, L"", L"", L"", L"</>", S_OK }, + { StartEndElement | DisableEscaping, L"uri", L"local", L"uri:local", startendelement_xml, S_OK, &saxattributes }, }; static void test_mxwriter_startendelement_batch(void) @@ -1741,17 +1741,17 @@ static void test_mxwriter_startendelement_batch(void) if (table->type & StartElement) { - hr = ISAXContentHandler_startElement(content, _bstr_(table->uri), table->uri ? strlen(table->uri) : 0, - _bstr_(table->local_name), table->local_name ? strlen(table->local_name) : 0, _bstr_(table->qname), - table->qname ? strlen(table->qname) : 0, table->attr); + hr = ISAXContentHandler_startElement(content, table->uri, table->uri ? lstrlenW(table->uri) : 0, + table->local_name, table->local_name ? lstrlenW(table->local_name) : 0, table->qname, + table->qname ? lstrlenW(table->qname) : 0, table->attr); ok(hr == table->hr, "test %d: got %#lx, expected %#lx\n", i, hr, table->hr); } if (table->type & EndElement) { - hr = ISAXContentHandler_endElement(content, _bstr_(table->uri), table->uri ? strlen(table->uri) : 0, - _bstr_(table->local_name), table->local_name ? strlen(table->local_name) : 0, _bstr_(table->qname), - table->qname ? strlen(table->qname) : 0); + hr = ISAXContentHandler_endElement(content, table->uri, table->uri ? lstrlenW(table->uri) : 0, + table->local_name, table->local_name ? lstrlenW(table->local_name) : 0, table->qname, + table->qname ? lstrlenW(table->qname) : 0); ok(hr == table->hr, "test %d: got %#lx, expected %#lx\n", i, hr, table->hr); } @@ -1764,8 +1764,8 @@ static void test_mxwriter_startendelement_batch(void) hr = IMXWriter_get_output(writer, &dest); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); - ok(!lstrcmpW(_bstr_(table->output), V_BSTR(&dest)), - "test %d: got wrong content %s, expected %s\n", i, wine_dbgstr_w(V_BSTR(&dest)), table->output); + ok(!lstrcmpW(table->output, V_BSTR(&dest)), + "test %d: got wrong content %s, expected %s\n", i, wine_dbgstr_w(V_BSTR(&dest)), wine_dbgstr_w(table->output)); VariantClear(&dest); } @@ -1779,18 +1779,18 @@ static void test_mxwriter_startendelement_batch(void) /* point of these test is to start/end element with different names and name lengths */ struct writer_startendelement2_t { - const char *qnamestart; + const WCHAR *qnamestart; int qnamestart_len; - const char *qnameend; + const WCHAR *qnameend; int qnameend_len; - const char *output; + const WCHAR *output; HRESULT hr; }; static const struct writer_startendelement2_t writer_startendelement2[] = { - { "a", -1, "b", -1, "<a/>", E_INVALIDARG }, - { "a", 1, "b", 1, "<a/>", S_OK }, + { L"a", -1, L"b", -1, L"<a/>", E_INVALIDARG }, + { L"a", 1, L"b", 1, L"<a/>", S_OK }, }; static void test_mxwriter_startendelement_batch2(void) @@ -1816,12 +1816,10 @@ static void test_mxwriter_startendelement_batch2(void) hr = ISAXContentHandler_startDocument(content); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_startElement(content, _bstr_(""), 0, _bstr_(""), 0, - _bstr_(table->qnamestart), table->qnamestart_len, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, table->qnamestart, table->qnamestart_len, NULL); ok(hr == table->hr, "test %d: got %#lx, expected %#lx\n", i, hr, table->hr); - hr = ISAXContentHandler_endElement(content, _bstr_(""), 0, _bstr_(""), 0, - _bstr_(table->qnameend), table->qnameend_len); + hr = ISAXContentHandler_endElement(content, L"", 0, L"", 0, table->qnameend, table->qnameend_len); ok(hr == table->hr, "test %d: got %#lx, expected %#lx\n", i, hr, table->hr); /* test output */ @@ -1833,8 +1831,8 @@ static void test_mxwriter_startendelement_batch2(void) hr = IMXWriter_get_output(writer, &dest); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); - ok(!lstrcmpW(_bstr_(table->output), V_BSTR(&dest)), - "test %d: got wrong content %s, expected %s\n", i, wine_dbgstr_w(V_BSTR(&dest)), table->output); + ok(!lstrcmpW(table->output, V_BSTR(&dest)), + "test %d: got wrong content %s, expected %s\n", i, wine_dbgstr_w(V_BSTR(&dest)), wine_dbgstr_w(table->output)); VariantClear(&dest); } @@ -1950,7 +1948,7 @@ static void test_mxwriter_startendelement(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* all string pointers should be not null */ - hr = ISAXContentHandler_startElement(content, _bstr_(""), 0, _bstr_("b"), 1, _bstr_(""), 0, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"b", 1, L"", 0, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); V_VT(&dest) = VT_EMPTY; @@ -1960,7 +1958,7 @@ static void test_mxwriter_startendelement(void) ok(!lstrcmpW(L"<>", V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); VariantClear(&dest); - hr = ISAXContentHandler_startElement(content, _bstr_(""), 0, _bstr_(""), 0, _bstr_("b"), 1, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, L"b", 1, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); V_VT(&dest) = VT_EMPTY; @@ -1970,17 +1968,17 @@ static void test_mxwriter_startendelement(void) ok(!lstrcmpW(L"<><b>", V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); VariantClear(&dest); - hr = ISAXContentHandler_endElement(content, NULL, 0, NULL, 0, _bstr_("a:b"), 3); + hr = ISAXContentHandler_endElement(content, NULL, 0, NULL, 0, L"a:b", 3); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_endElement(content, NULL, 0, _bstr_("b"), 1, _bstr_("a:b"), 3); + hr = ISAXContentHandler_endElement(content, NULL, 0, L"b", 1, L"a:b", 3); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* only local name is an error too */ - hr = ISAXContentHandler_endElement(content, NULL, 0, _bstr_("b"), 1, NULL, 0); + hr = ISAXContentHandler_endElement(content, NULL, 0, L"b", 1, NULL, 0); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_endElement(content, _bstr_(""), 0, _bstr_(""), 0, _bstr_("b"), 1); + hr = ISAXContentHandler_endElement(content, L"", 0, L"", 0, L"b", 1); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); V_VT(&dest) = VT_EMPTY; @@ -2007,7 +2005,7 @@ static void test_mxwriter_startendelement(void) hr = ISAXContentHandler_startDocument(content); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_startElement(content, _bstr_(""), 0, _bstr_(""), 0, _bstr_("abcdef"), 3, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, L"abcdef", 3, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); V_VT(&dest) = VT_EMPTY; @@ -2021,7 +2019,7 @@ static void test_mxwriter_startendelement(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); IMXWriter_flush(writer); - hr = ISAXContentHandler_endElement(content, _bstr_(""), 0, _bstr_(""), 0, _bstr_("abdcdef"), 3); + hr = ISAXContentHandler_endElement(content, L"", 0, L"", 0, L"abdcdef", 3); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); V_VT(&dest) = VT_EMPTY; hr = IMXWriter_get_output(writer, &dest); @@ -2035,7 +2033,7 @@ static void test_mxwriter_startendelement(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* length -1 */ - hr = ISAXContentHandler_startElement(content, _bstr_(""), 0, _bstr_(""), 0, _bstr_("a"), -1, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, L"a", -1, NULL); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); ISAXContentHandler_Release(content); @@ -2045,13 +2043,13 @@ static void test_mxwriter_startendelement(void) struct writer_characters_t { - const char *data; - const char *output; + const WCHAR *data; + const WCHAR *output; }; static const struct writer_characters_t writer_characters[] = { - { "< > & \" \'", "< > & \" \'" }, + { L"< > & \" \'", L"< > & \" \'" }, }; static void test_mxwriter_characters(void) @@ -2121,13 +2119,13 @@ static void test_mxwriter_characters(void) hr = ISAXContentHandler_startDocument(content); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_startElement(content, _bstr_(""), 0, _bstr_(""), 0, _bstr_("a"), 1, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, L"a", 1, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = ISAXContentHandler_characters(content, L"TESTCHARDATA .", 0); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_endElement(content, _bstr_(""), 0, _bstr_(""), 0, _bstr_("a"), 1); + hr = ISAXContentHandler_endElement(content, L"", 0, L"", 0, L"a", 1); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); V_VT(&dest) = VT_EMPTY; @@ -2219,7 +2217,7 @@ static void test_mxwriter_characters(void) hr = ISAXContentHandler_startDocument(content); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_characters(content, _bstr_(table->data), strlen(table->data)); + hr = ISAXContentHandler_characters(content, table->data, lstrlenW(table->data)); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* test output */ @@ -2229,8 +2227,8 @@ static void test_mxwriter_characters(void) hr = IMXWriter_get_output(writer, &dest); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); - ok(!lstrcmpW(_bstr_(table->output), V_BSTR(&dest)), - "test %d: got wrong content %s, expected \"%s\"\n", i, wine_dbgstr_w(V_BSTR(&dest)), table->output); + ok(!lstrcmpW(table->output, V_BSTR(&dest)), + "test %d: got wrong content %s, expected \"%s\"\n", i, wine_dbgstr_w(V_BSTR(&dest)), wine_dbgstr_w(table->output)); VariantClear(&dest); } @@ -2242,7 +2240,7 @@ static void test_mxwriter_characters(void) hr = IMXWriter_put_disableOutputEscaping(writer, VARIANT_TRUE); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_characters(content, _bstr_(table->data), strlen(table->data)); + hr = ISAXContentHandler_characters(content, table->data, lstrlenW(table->data)); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* test output */ @@ -2252,8 +2250,8 @@ static void test_mxwriter_characters(void) hr = IMXWriter_get_output(writer, &dest); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); - ok(!lstrcmpW(_bstr_(table->data), V_BSTR(&dest)), - "test %d: got wrong content %s, expected \"%s\"\n", i, wine_dbgstr_w(V_BSTR(&dest)), table->data); + ok(!lstrcmpW(table->data, V_BSTR(&dest)), + "test %d: got wrong content %s, expected \"%s\"\n", i, wine_dbgstr_w(V_BSTR(&dest)), wine_dbgstr_w(table->data)); VariantClear(&dest); } @@ -2523,10 +2521,10 @@ static void test_mxwriter_encoding(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* write empty element */ - hr = ISAXContentHandler_startElement(content, _bstr_(""), 0, _bstr_(""), 0, _bstr_("a"), 1, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, L"a", 1, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_endElement(content, _bstr_(""), 0, _bstr_(""), 0, _bstr_("a"), 1); + hr = ISAXContentHandler_endElement(content, L"", 0, L"", 0, L"a", 1); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* switch */ @@ -2800,7 +2798,7 @@ static void test_mxwriter_cdata(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* all these are escaped for text nodes */ - hr = ISAXContentHandler_characters(content, _bstr_("< > & \""), 7); + hr = ISAXContentHandler_characters(content, L"< > & \"", 7); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = ISAXLexicalHandler_endCDATA(lexical); @@ -3071,9 +3069,8 @@ static void test_mxwriter_dtd(void) hr = IMXWriter_put_output(writer, dest); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXDeclHandler_attributeDecl(decl, _bstr_("element"), strlen("element"), - _bstr_("attribute"), strlen("attribute"), _bstr_("CDATA"), strlen("CDATA"), - _bstr_("#REQUIRED"), strlen("#REQUIRED"), _bstr_("value"), strlen("value")); + hr = ISAXDeclHandler_attributeDecl(decl, L"element", 7, + L"attribute", 9, L"CDATA", 5, L"#REQUIRED", 9, L"value", 5); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); V_VT(&dest) = VT_EMPTY; @@ -3085,14 +3082,12 @@ static void test_mxwriter_dtd(void) V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); VariantClear(&dest); - hr = ISAXDeclHandler_attributeDecl(decl, _bstr_("element"), strlen("element"), - _bstr_("attribute2"), strlen("attribute2"), _bstr_("CDATA"), strlen("CDATA"), - _bstr_("#REQUIRED"), strlen("#REQUIRED"), _bstr_("value2"), strlen("value2")); + hr = ISAXDeclHandler_attributeDecl(decl, L"element", 7, + L"attribute2", 10, L"CDATA", 5, L"#REQUIRED", 9, L"value2", 6); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXDeclHandler_attributeDecl(decl, _bstr_("element2"), strlen("element2"), - _bstr_("attribute3"), strlen("attribute3"), _bstr_("CDATA"), strlen("CDATA"), - _bstr_("#REQUIRED"), strlen("#REQUIRED"), _bstr_("value3"), strlen("value3")); + hr = ISAXDeclHandler_attributeDecl(decl, L"element2", 8, + L"attribute3", 10, L"CDATA", 5, L"#REQUIRED", 9, L"value3", 6); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); V_VT(&dest) = VT_EMPTY; @@ -3120,10 +3115,10 @@ static void test_mxwriter_dtd(void) ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); } - hr = ISAXDeclHandler_internalEntityDecl(decl, _bstr_("name"), -1, NULL, 0); + hr = ISAXDeclHandler_internalEntityDecl(decl, L"name", -1, NULL, 0); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); - hr = ISAXDeclHandler_internalEntityDecl(decl, _bstr_("name"), strlen("name"), _bstr_("value"), strlen("value")); + hr = ISAXDeclHandler_internalEntityDecl(decl, L"name", 4, L"value", 5); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); V_VT(&dest) = VT_EMPTY; @@ -3148,21 +3143,19 @@ static void test_mxwriter_dtd(void) ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); } - hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), 0, NULL, 0, NULL, 0); + hr = ISAXDeclHandler_externalEntityDecl(decl, L"name", 0, NULL, 0, NULL, 0); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); - hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), -1, NULL, 0, NULL, 0); + hr = ISAXDeclHandler_externalEntityDecl(decl, L"name", -1, NULL, 0, NULL, 0); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); - hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), strlen("name"), _bstr_("pubid"), strlen("pubid"), - _bstr_("sysid"), strlen("sysid")); + hr = ISAXDeclHandler_externalEntityDecl(decl, L"name", 4, L"pubid", 5, L"sysid", 5); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), strlen("name"), NULL, 0, _bstr_("sysid"), strlen("sysid")); + hr = ISAXDeclHandler_externalEntityDecl(decl, L"name", 4, NULL, 0, L"sysid", 5); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), strlen("name"), _bstr_("pubid"), strlen("pubid"), - NULL, 0); + hr = ISAXDeclHandler_externalEntityDecl(decl, L"name", 4, L"pubid", 5, NULL, 0); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); V_VT(&dest) = VT_EMPTY; @@ -3187,16 +3180,16 @@ static void test_mxwriter_dtd(void) hr = ISAXDTDHandler_notationDecl(dtd, NULL, 0, NULL, 0, NULL, 0); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); - hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"), strlen("name"), NULL, 0, NULL, 0); + hr = ISAXDTDHandler_notationDecl(dtd, L"name", 4, NULL, 0, NULL, 0); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); - hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"), strlen("name"), _bstr_("pubid"), strlen("pubid"), NULL, 0); + hr = ISAXDTDHandler_notationDecl(dtd, L"name", 4, L"pubid", 5, NULL, 0); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"), strlen("name"), _bstr_("pubid"), strlen("pubid"), _bstr_("sysid"), strlen("sysid")); + hr = ISAXDTDHandler_notationDecl(dtd, L"name", 4, L"pubid", 5, L"sysid", 5); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"), strlen("name"), NULL, 0, _bstr_("sysid"), strlen("sysid")); + hr = ISAXDTDHandler_notationDecl(dtd, L"name", 4, NULL, 0, L"sysid", 5); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IMXWriter_get_output(writer, &dest); @@ -3600,25 +3593,25 @@ static void test_mxwriter_indent(void) hr = ISAXContentHandler_startDocument(content); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, _bstr_("a"), 1, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, L"a", 1, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_characters(content, _bstr_(""), 0); + hr = ISAXContentHandler_characters(content, L"", 0); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, _bstr_("b"), 1, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, L"b", 1, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, _bstr_("c"), 1, NULL); + hr = ISAXContentHandler_startElement(content, L"", 0, L"", 0, L"c", 1, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_endElement(content, L"", 0, L"", 0, _bstr_("c"), 1); + hr = ISAXContentHandler_endElement(content, L"", 0, L"", 0, L"c", 1); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_endElement(content, L"", 0, L"", 0, _bstr_("b"), 1); + hr = ISAXContentHandler_endElement(content, L"", 0, L"", 0, L"b", 1); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - hr = ISAXContentHandler_endElement(content, L"", 0, L"", 0, _bstr_("a"), 1); + hr = ISAXContentHandler_endElement(content, L"", 0, L"", 0, L"a", 1); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = ISAXContentHandler_endDocument(content); @@ -4296,7 +4289,7 @@ static HRESULT WINAPI contentHandler_startElement( attr = calloc(len, sizeof(*attr)); v = VARIANT_TRUE; - hr = ISAXXMLReader_getFeature(g_reader, _bstr_("http://xml.org/sax/features/namespaces"), &v); + hr = ISAXXMLReader_getFeature(g_reader, L"http://xml.org/sax/features/namespaces", &v); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); for (i = 0; i < len; i++) @@ -4709,7 +4702,7 @@ static void test_saxreader(void) ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "xml:space handling", TRUE); /* switch off 'namespaces' feature */ - hr = ISAXXMLReader_putFeature(reader, _bstr_("http://xml.org/sax/features/namespaces"), VARIANT_FALSE); + hr = ISAXXMLReader_putFeature(reader, L"http://xml.org/sax/features/namespaces", VARIANT_FALSE); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); stream = create_test_stream(test_attributes, -1); @@ -4722,11 +4715,11 @@ static void test_saxreader(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "content test attributes", TRUE); IStream_Release(stream); - hr = ISAXXMLReader_putFeature(reader, _bstr_("http://xml.org/sax/features/namespaces"), VARIANT_TRUE); + hr = ISAXXMLReader_putFeature(reader, L"http://xml.org/sax/features/namespaces", VARIANT_TRUE); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* switch off 'namespace-prefixes' feature */ - hr = ISAXXMLReader_putFeature(reader, _bstr_("http://xml.org/sax/features/namespace-prefixes"), VARIANT_FALSE); + hr = ISAXXMLReader_putFeature(reader, L"http://xml.org/sax/features/namespace-prefixes", VARIANT_FALSE); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); stream = create_test_stream(test_attributes, -1); @@ -4740,7 +4733,7 @@ static void test_saxreader(void) ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "content test attributes", FALSE); IStream_Release(stream); - hr = ISAXXMLReader_putFeature(reader, _bstr_("http://xml.org/sax/features/namespace-prefixes"), VARIANT_TRUE); + hr = ISAXXMLReader_putFeature(reader, L"http://xml.org/sax/features/namespace-prefixes", VARIANT_TRUE); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); /* attribute normalization */ @@ -4768,7 +4761,7 @@ static void test_saxreader(void) V_VT(&var) = VT_UNKNOWN; V_UNKNOWN(&var) = (IUnknown*)&lexicalhandler.ISAXLexicalHandler_iface; - hr = ISAXXMLReader_putProperty(reader, _bstr_("http://xml.org/sax/properties/lexical-handler"), var); + hr = ISAXXMLReader_putProperty(reader, L"http://xml.org/sax/properties/lexical-handler", var); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); stream = create_test_stream(test_cdata_xml, -1); @@ -4824,10 +4817,10 @@ static void test_saxreader(void) free_bstrs(); } -static const char *feature_names[] = +static const WCHAR *feature_names[] = { - "http://xml.org/sax/features/namespaces", - "http://xml.org/sax/features/namespace-prefixes", + L"http://xml.org/sax/features/namespaces", + L"http://xml.org/sax/features/namespace-prefixes", 0 }; @@ -4835,54 +4828,54 @@ static void test_saxreader_features(void) { ISAXXMLReader *reader; VARIANT_BOOL value; - const char **name; + const WCHAR **name; HRESULT hr; hr = CoCreateInstance(&CLSID_SAXXMLReader60, NULL, CLSCTX_INPROC_SERVER, &IID_ISAXXMLReader, (void **)&reader); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); value = VARIANT_TRUE; - hr = ISAXXMLReader_getFeature(reader, _bstr_("exhaustive-errors"), &value); + hr = ISAXXMLReader_getFeature(reader, L"exhaustive-errors", &value); ok(hr == S_OK, "Failed to get feature value, hr %#lx.\n", hr); ok(value == VARIANT_FALSE, "Unexpected default feature value.\n"); - hr = ISAXXMLReader_putFeature(reader, _bstr_("exhaustive-errors"), VARIANT_FALSE); + hr = ISAXXMLReader_putFeature(reader, L"exhaustive-errors", VARIANT_FALSE); ok(hr == S_OK, "Failed to put feature value, hr %#lx.\n", hr); value = VARIANT_TRUE; - hr = ISAXXMLReader_getFeature(reader, _bstr_("schema-validation"), &value); + hr = ISAXXMLReader_getFeature(reader, L"schema-validation", &value); ok(hr == S_OK, "Failed to get feature value, hr %#lx.\n", hr); ok(value == VARIANT_FALSE, "Unexpected default feature value.\n"); - hr = ISAXXMLReader_putFeature(reader, _bstr_("exhaustive-errors"), VARIANT_FALSE); + hr = ISAXXMLReader_putFeature(reader, L"exhaustive-errors", VARIANT_FALSE); ok(hr == S_OK, "Failed to put feature value, hr %#lx.\n", hr); name = feature_names; while (*name) { value = 0xc; - hr = ISAXXMLReader_getFeature(reader, _bstr_(*name), &value); + hr = ISAXXMLReader_getFeature(reader, *name, &value); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(value == VARIANT_TRUE, "Unexpected value %#x.\n", value); value = 0xc; - hr = ISAXXMLReader_putFeature(reader, _bstr_(*name), value); + hr = ISAXXMLReader_putFeature(reader, *name, value); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); value = 0xd; - hr = ISAXXMLReader_getFeature(reader, _bstr_(*name), &value); + hr = ISAXXMLReader_getFeature(reader, *name, &value); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(value == VARIANT_TRUE, "Unexpected value %#x.\n", value); - hr = ISAXXMLReader_putFeature(reader, _bstr_(*name), VARIANT_FALSE); + hr = ISAXXMLReader_putFeature(reader, *name, VARIANT_FALSE); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); value = 0xd; - hr = ISAXXMLReader_getFeature(reader, _bstr_(*name), &value); + hr = ISAXXMLReader_getFeature(reader, *name, &value); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(value == VARIANT_FALSE, "Unexpected value %#x.\n", value); - hr = ISAXXMLReader_putFeature(reader, _bstr_(*name), VARIANT_TRUE); + hr = ISAXXMLReader_putFeature(reader, *name, VARIANT_TRUE); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); value = 0xd; - hr = ISAXXMLReader_getFeature(reader, _bstr_(*name), &value); + hr = ISAXXMLReader_getFeature(reader, *name, &value); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(value == VARIANT_TRUE, "Unexpected value %#x.\n", value); @@ -4905,7 +4898,7 @@ static void test_saxreader_properties(void) /* xmldecl-version property */ V_VT(&v) = VT_EMPTY; V_BSTR(&v) = (void*)0xdeadbeef; - hr = ISAXXMLReader_getProperty(reader, _bstr_("xmldecl-version"), &v); + hr = ISAXXMLReader_getProperty(reader, L"xmldecl-version", &v); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(V_VT(&v) == VT_BSTR, "got %d\n", V_VT(&v)); ok(V_BSTR(&v) == NULL, "got %s\n", wine_dbgstr_w(V_BSTR(&v))); @@ -4918,14 +4911,14 @@ static void test_saxreader_properties(void) V_VT(&v) = VT_EMPTY; V_BSTR(&v) = (void*)0xdeadbeef; - hr = ISAXXMLReader_getProperty(reader, _bstr_("xmldecl-version"), &v); + hr = ISAXXMLReader_getProperty(reader, L"xmldecl-version", &v); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(V_VT(&v) == VT_BSTR, "got %d\n", V_VT(&v)); ok(V_BSTR(&v) == NULL, "got %s\n", wine_dbgstr_w(V_BSTR(&v))); V_VT(&v) = VT_EMPTY; V_BSTR(&v) = (void*)0xdeadbeef; - hr = ISAXXMLReader_getProperty(reader, _bstr_("xmldecl-encoding"), &v); + hr = ISAXXMLReader_getProperty(reader, L"xmldecl-encoding", &v); todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); todo_wine @@ -4948,7 +4941,7 @@ static void test_saxreader_properties(void) V_VT(&v) = VT_EMPTY; V_BSTR(&v) = (void*)0xdeadbeef; - hr = ISAXXMLReader_getProperty(reader, _bstr_("xmldecl-version"), &v); + hr = ISAXXMLReader_getProperty(reader, L"xmldecl-version", &v); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(V_VT(&v) == VT_BSTR, "got %d\n", V_VT(&v)); ok(!lstrcmpW(V_BSTR(&v), L"1.0"), "got %s\n", wine_dbgstr_w(V_BSTR(&v))); @@ -4962,7 +4955,7 @@ static void test_saxreader_properties(void) V_VT(&v) = VT_EMPTY; V_BSTR(&v) = (void*)0xdeadbeef; - hr = ISAXXMLReader_getProperty(reader, _bstr_("xmldecl-encoding"), &v); + hr = ISAXXMLReader_getProperty(reader, L"xmldecl-encoding", &v); todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (hr == S_OK) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10157