#include <stdio.h>
#include <assert.h>
#include "windows.h"
#include "initguid.h"
#include "msxml2.h"
#include "wine/test.h"
Go to the source code of this file.
◆ COBJMACROS
◆ CONST_VTABLE
◆ _bstr_()
Definition at line 42 of file domdoc.c.
43{
47}
static BSTR alloced_bstrs[256]
static int alloced_bstrs_count
BSTR WINAPI SysAllocString(LPCOLESTR str)
◆ free_bstrs()
Definition at line 49 of file domdoc.c.
50{
55}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
◆ START_TEST()
Definition at line 324 of file domdoc.c.
325{
328
330 ok(
hr ==
S_OK,
"failed to init com\n");
331
332 hr =
CoCreateInstance(&CLSID_DOMDocument40,
NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument2, (
void **)&doc);
334 {
335 win_skip(
"class &CLSID_DOMDocument40 not supported\n");
336 return;
337 }
338 IXMLDOMDocument2_Release(doc);
339
342
344}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
static void test_namespaces_as_attributes(void)
static void test_create_attribute(void)
◆ test_create_attribute()
| static void test_create_attribute |
( |
void |
| ) |
|
|
static |
Definition at line 76 of file domdoc.c.
77{
86
87 hr =
CoCreateInstance(&CLSID_DOMDocument40,
NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument2, (
void **)&doc);
88 ok(
hr ==
S_OK,
"Failed to create DOMDocument40, hr %#lx.\n",
hr);
89
91 {
96
100 {
101
104 }
105 else
106 {
109 }
111
113 hr = IXMLDOMNode_get_namespaceURI(
node, &
str);
118
119 IXMLDOMNode_Release(
node);
121
124 }
125
130
131 hr = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMElement, (
void**)&el);
133 IXMLDOMNode_Release(
node);
134
137 hr = IXMLDOMDocument2_createNode(doc,
var,
_bstr_(
L"xmlns:a"),
140
143
144
145 hr = IXMLDOMNode_get_namespaceURI(
node, &
str);
149
150 IXMLDOMNode_Release(
node);
151 IXMLDOMElement_Release(el);
152 IXMLDOMDocument2_Release(doc);
154}
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
static BSTR _bstr_(const char *str)
static struct attrtest_t attrtests[]
static void free_bstrs(void)
◆ test_namespaces_as_attributes()
| static void test_namespaces_as_attributes |
( |
void |
| ) |
|
|
static |
Definition at line 157 of file domdoc.c.
158{
160 {
162 int explen;
165 const WCHAR *basenames[3];
166 const WCHAR *uris[3];
167 const WCHAR *texts[3];
168 const WCHAR *xmls[3];
169 };
171 {
172 {
173 L"<a ns:b=\"b attr\" d=\"d attr\" xmlns:ns=\"nshref\" />", 3,
174 {
L"ns:b",
L"d",
L"xmlns:ns" },
175 {
L"ns",
NULL,
L"xmlns" },
176 {
L"b",
L"d",
L"ns" },
178 {
L"b attr",
L"d attr",
L"nshref" },
179 {
L"ns:b=\"b attr\"",
L"d=\"d attr\"",
L"xmlns:ns=\"nshref\"" },
180 },
181
182 {
183 L"<a d=\"d attr\" />", 1,
190 },
191
192 {
193 L"<a xmlns:ns=\"nshref\" />", 1,
199 {
L"xmlns:ns=\"nshref\"" },
200 },
201
202 {
203 L"<a xmlns=\"nshref\" />", 1,
209 {
L"xmlns=\"nshref\"" },
210 },
211
212 {
214 },
215
217 };
226
229 {
230 hr =
CoCreateInstance(&CLSID_DOMDocument40,
NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument2, (
void **)&doc);
232
235
237 hr = IXMLDOMDocument2_get_firstChild(doc, &
node);
239
240 hr = IXMLDOMNode_get_attributes(
node, &
map);
242
244 hr = IXMLDOMNamedNodeMap_get_length(
map, &
len);
247
249 hr = IXMLDOMNamedNodeMap_get_item(
map,
test->explen+1, &
item);
251 ok(!
item,
"Item should be NULL\n");
252
254 {
256 hr = IXMLDOMNamedNodeMap_get_item(
map,
i, &
item);
258
260 hr = IXMLDOMNode_get_nodeName(
item, &
str);
264
267 if (
test->prefixes[
i])
268 {
269
274 }
275 else
277
279 hr = IXMLDOMNode_get_baseName(
item, &
str);
280
285
287 hr = IXMLDOMNode_get_namespaceURI(
item, &
str);
289 {
293 else
296 }
297 else
299
305
311
312 IXMLDOMNode_Release(
item);
313 }
314
315 IXMLDOMNamedNodeMap_Release(
map);
316 IXMLDOMNode_Release(
node);
317 IXMLDOMDocument2_Release(doc);
318
320 }
322}
GLboolean GLboolean GLboolean b
static struct test_info tests[]
◆ alloced_bstrs
◆ alloced_bstrs_count
◆ attrtests
Initial value:= {
{
L"xmlns",
L"http://www.w3.org/2000/xmlns/",
L"xmlns",
L"xmlns" },
{
L"xmlns",
L"nondefaulturi",
L"xmlns",
L"xmlns" },
{
L"c",
L"http://www.w3.org/2000/xmlns/",
NULL,
L"http://www.w3.org/2000/xmlns/" },
{
L"c",
L"nsref1",
NULL,
L"nsref1" },
{
L"ns:c",
L"nsref1",
L"ns",
L"nsref1" },
{
L"xmlns:c",
L"http://www.w3.org/2000/xmlns/",
L"xmlns",
L"" },
{
L"xmlns:c",
L"nondefaulturi",
L"xmlns",
L"" },
{ 0 }
}
Definition at line 64 of file domdoc.c.