#include <stdio.h>
#include <assert.h>
#include "windows.h"
#include "initguid.h"
#include "msxml6.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_DOMDocument60,
NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument2, (
void **)&doc);
334 {
335 win_skip(
"class &CLSID_DOMDocument60 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_DOMDocument60,
NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument2, (
void **)&doc);
88 ok(
hr ==
S_OK,
"Failed to create DOMDocument60, hr %#lx.\n",
hr);
89
91 {
96
100 {
104 }
105 else
106 {
109 }
111
113 hr = IXMLDOMNode_get_namespaceURI(
node, &
str);
119
120 IXMLDOMNode_Release(
node);
122
125 }
126
131
132 hr = IXMLDOMNode_QueryInterface(
node, &IID_IXMLDOMElement, (
void**)&el);
134 IXMLDOMNode_Release(
node);
135
138 hr = IXMLDOMDocument2_createNode(doc,
var,
_bstr_(
L"xmlns:a"),
141
144
145
146 hr = IXMLDOMNode_get_namespaceURI(
node, &
str);
152
153 IXMLDOMNode_Release(
node);
154 IXMLDOMElement_Release(el);
155 IXMLDOMDocument2_Release(doc);
157}
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 160 of file domdoc.c.
161{
163 {
165 int explen;
168 const WCHAR *basenames[3];
169 const WCHAR *uris[3];
170 const WCHAR *texts[3];
171 const WCHAR *xmls[3];
172 };
174 {
175 {
176 L"<a ns:b=\"b attr\" d=\"d attr\" xmlns:ns=\"nshref\" />", 3,
177 {
L"ns:b",
L"d",
L"xmlns:ns" },
178 {
L"ns",
NULL,
L"xmlns" },
179 {
L"b",
L"d",
L"ns" },
181 {
L"b attr",
L"d attr",
L"nshref" },
182 {
L"ns:b=\"b attr\"",
L"d=\"d attr\"",
L"xmlns:ns=\"nshref\"" },
183 },
184
185 {
186 L"<a d=\"d attr\" />", 1,
193 },
194
195 {
196 L"<a xmlns:ns=\"nshref\" />", 1,
202 {
L"xmlns:ns=\"nshref\"" },
203 },
204
205 {
206 L"<a xmlns=\"nshref\" />", 1,
210 {
L"http://www.w3.org/2000/xmlns/" },
212 {
L"xmlns=\"nshref\"" },
213 },
214
215 {
217 },
218
220 };
229
232 {
233 hr =
CoCreateInstance(&CLSID_DOMDocument60,
NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument2, (
void **)&doc);
235
238
240 hr = IXMLDOMDocument2_get_firstChild(doc, &
node);
242
243 hr = IXMLDOMNode_get_attributes(
node, &
map);
245
247 hr = IXMLDOMNamedNodeMap_get_length(
map, &
len);
250
252 hr = IXMLDOMNamedNodeMap_get_item(
map,
test->explen+1, &
item);
254 ok(!
item,
"Item should be NULL\n");
255
257 {
259 hr = IXMLDOMNamedNodeMap_get_item(
map,
i, &
item);
261
263 hr = IXMLDOMNode_get_nodeName(
item, &
str);
267
270 if (
test->prefixes[
i])
271 {
275 }
276 else
278
280 hr = IXMLDOMNode_get_baseName(
item, &
str);
284
286 hr = IXMLDOMNode_get_namespaceURI(
item, &
str);
288 {
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/",
NULL,
L"http://www.w3.org/2000/xmlns/" },
{
L"xmlns",
L"nondefaulturi",
NULL,
L"http://www.w3.org/2000/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"http://www.w3.org/2000/xmlns/" },
{
L"xmlns:c",
L"nondefaulturi",
L"xmlns",
L"http://www.w3.org/2000/xmlns/" },
{ 0 }
}
Definition at line 64 of file domdoc.c.