Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
cab04351
Commit
cab04351
authored
Aug 12, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some msxml3 tests.
parent
8c375c7f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
224 additions
and
0 deletions
+224
-0
configure
configure
+0
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/msxml3/Makefile.in
+2
-0
.cvsignore
dlls/msxml3/tests/.cvsignore
+3
-0
Makefile.in
dlls/msxml3/tests/Makefile.in
+14
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+204
-0
No files found.
configure
View file @
cab04351
This diff is collapsed.
Click to expand it.
configure.ac
View file @
cab04351
...
...
@@ -1571,6 +1571,7 @@ dlls/msvidc32/Makefile
dlls/msvideo/Makefile
dlls/mswsock/Makefile
dlls/msxml3/Makefile
dlls/msxml3/tests/Makefile
dlls/netapi32/Makefile
dlls/netapi32/tests/Makefile
dlls/newdev/Makefile
...
...
dlls/msxml3/Makefile.in
View file @
cab04351
...
...
@@ -16,6 +16,8 @@ C_SRCS = \
node.c
\
nodemap.c
SUBDIRS
=
tests
@MAKE_DLL_RULES@
### Dependencies:
dlls/msxml3/tests/.cvsignore
0 → 100644
View file @
cab04351
Makefile
domdoc.ok
testlist.c
dlls/msxml3/tests/Makefile.in
0 → 100644
View file @
cab04351
TOPSRCDIR
=
@top_srcdir@
TOPOBJDIR
=
../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
msxml3.dll
IMPORTS
=
oleaut32 ole32 kernel32
EXTRALIBS
=
-luuid
CTESTS
=
\
domdoc.c
@MAKE_TEST_RULES@
### Dependencies:
dlls/msxml3/tests/domdoc.c
0 → 100644
View file @
cab04351
/*
* XML test
*
* Copyright 2005 Mike McCormack for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define COBJMACROS
#include "windows.h"
#include "ole2.h"
#include "msxml.h"
#include "xmldom.h"
#include <stdio.h>
#include "wine/test.h"
void
test_domdoc
(
void
)
{
HRESULT
r
;
IXMLDOMDocument
*
doc
=
NULL
;
IXMLDOMElement
*
element
=
NULL
;
static
const
GUID
CLSID_DOMDocument
=
{
0x2933BF90
,
0x7B36
,
0x11d2
,
{
0xB2
,
0x0E
,
0x00
,
0xC0
,
0x4F
,
0x98
,
0x3E
,
0x60
}};
static
const
GUID
IID_IXMLDOMDocument
=
{
0x2933BF81
,
0x7B36
,
0x11d2
,
{
0xB2
,
0x0E
,
0x00
,
0xC0
,
0x4F
,
0x98
,
0x3E
,
0x60
}};
VARIANT_BOOL
b
;
BSTR
str
;
static
const
WCHAR
szEmpty
[]
=
{
0
};
static
const
WCHAR
szIncomplete
[]
=
{
'<'
,
'?'
,
'x'
,
'm'
,
'l'
,
' '
,
'v'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'='
,
'\''
,
'1'
,
'.'
,
'0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
'3'
,
'4'
,
'\''
,
'>'
,
'f'
,
'n'
,
'1'
,
'.'
,
't'
,
'x'
,
't'
,
'<'
,
'/'
,
'b'
,
's'
,
'>'
,
'<'
,
'p'
,
'r'
,
' '
,
'i'
,
'd'
,
'='
,
'\''
,
's'
,
't'
,
'r'
,
'3'
,
'\''
,
' '
,
'v'
,
'r'
,
'='
,
'\''
,
'1'
,
'.'
,
'2'
,
'.'
,
'3'
,
'\''
,
' '
,
'p'
,
'n'
,
'='
,
'\''
,
'w'
,
'i'
,
'n'
,
'e'
,
' '
,
'2'
,
'0'
,
'0'
,
'5'
,
'0'
,
'8'
,
'0'
,
'4'
,
'\''
,
'>'
,
'f'
,
'n'
,
'2'
,
'.'
,
't'
,
'x'
,
't'
,
'<'
,
'/'
,
'p'
,
'r'
,
'>'
,
'<'
,
'/'
,
'l'
,
'c'
,
'>'
,
'\n'
,
0
};
static
const
WCHAR
szOpen
[]
=
{
'o'
,
'p'
,
'e'
,
'n'
,
0
};
r
=
CoInitialize
(
NULL
);
ok
(
r
==
S_OK
,
"failed to init com
\n
"
);
r
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument
,
(
LPVOID
*
)
&
doc
);
/* ok( r == S_OK, "failed to create an xml dom doc\n" ); */
if
(
r
!=
S_OK
)
return
;
/* try some stupid things */
r
=
IXMLDOMDocument_loadXML
(
doc
,
NULL
,
NULL
);
ok
(
r
==
S_FALSE
,
"loadXML failed
\n
"
);
b
=
VARIANT_TRUE
;
r
=
IXMLDOMDocument_loadXML
(
doc
,
NULL
,
&
b
);
ok
(
r
==
S_FALSE
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_FALSE
,
"failed to load XML string
\n
"
);
/* try load an empty document */
b
=
VARIANT_TRUE
;
str
=
SysAllocString
(
szEmpty
);
r
=
IXMLDOMDocument_loadXML
(
doc
,
str
,
&
b
);
ok
(
r
==
S_FALSE
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_FALSE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
/* check that there's no document element */
element
=
NULL
;
r
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
element
);
ok
(
r
==
S_FALSE
,
"should be no document element
\n
"
);
b
=
VARIANT_TRUE
;
str
=
SysAllocString
(
szIncomplete
);
r
=
IXMLDOMDocument_loadXML
(
doc
,
str
,
&
b
);
ok
(
r
==
S_FALSE
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_FALSE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
/* check that there's no document element */
element
=
(
IXMLDOMElement
*
)
1
;
r
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
element
);
ok
(
r
==
S_FALSE
,
"should be no document element
\n
"
);
ok
(
element
==
NULL
,
"Element should be NULL
\n
"
);
/* try to load something valid */
b
=
VARIANT_FALSE
;
str
=
SysAllocString
(
szComplete1
);
r
=
IXMLDOMDocument_loadXML
(
doc
,
str
,
&
b
);
ok
(
r
==
S_OK
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
/* try with a null out pointer - crashes */
if
(
0
)
{
r
=
IXMLDOMDocument_get_documentElement
(
doc
,
NULL
);
ok
(
r
==
S_OK
,
"should be no document element
\n
"
);
}
/* check that there's no document element */
element
=
NULL
;
r
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
element
);
ok
(
r
==
S_OK
,
"should be a document element
\n
"
);
if
(
element
)
{
BSTR
tag
=
NULL
;
/* check if the tag is correct */
r
=
IXMLDOMElement_get_tagName
(
element
,
&
tag
);
ok
(
r
==
S_OK
,
"couldn't get tag name
\n
"
);
ok
(
tag
!=
NULL
,
"tag was null
\n
"
);
ok
(
!
lstrcmpW
(
tag
,
szOpen
),
"incorrect tag name
\n
"
);
SysFreeString
(
tag
);
/* figure out what happens if we try to reload the document */
str
=
SysAllocString
(
szComplete2
);
r
=
IXMLDOMDocument_loadXML
(
doc
,
str
,
&
b
);
ok
(
r
==
S_OK
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
/* check if the tag is still correct */
tag
=
NULL
;
r
=
IXMLDOMElement_get_tagName
(
element
,
&
tag
);
ok
(
r
==
S_OK
,
"couldn't get tag name
\n
"
);
ok
(
tag
!=
NULL
,
"tag was null
\n
"
);
ok
(
!
lstrcmpW
(
tag
,
szOpen
),
"incorrect tag name
\n
"
);
SysFreeString
(
tag
);
IXMLDOMElement_Release
(
element
);
element
=
NULL
;
}
/* as soon as we call loadXML again, the document element will disappear */
b
=
2
;
r
=
IXMLDOMDocument_loadXML
(
doc
,
NULL
,
NULL
);
ok
(
r
==
S_FALSE
,
"loadXML failed
\n
"
);
ok
(
b
==
2
,
"variant modified
\n
"
);
r
=
IXMLDOMDocument_get_documentElement
(
doc
,
&
element
);
ok
(
r
==
S_FALSE
,
"should be no document element
\n
"
);
/* try to load something else simple and valid */
b
=
VARIANT_FALSE
;
str
=
SysAllocString
(
szComplete3
);
r
=
IXMLDOMDocument_loadXML
(
doc
,
str
,
&
b
);
ok
(
r
==
S_OK
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
/* try something a little more complicated */
b
=
FALSE
;
str
=
SysAllocString
(
szComplete4
);
r
=
IXMLDOMDocument_loadXML
(
doc
,
str
,
&
b
);
ok
(
r
==
S_OK
,
"loadXML failed
\n
"
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
r
=
IXMLDocument_Release
(
doc
);
ok
(
r
==
0
,
"document ref count incorrect
\n
"
);
CoUninitialize
();
ok
(
r
==
S_OK
,
"failed to uninit com
\n
"
);
}
START_TEST
(
domdoc
)
{
test_domdoc
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment