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
8a0d8683
Commit
8a0d8683
authored
Feb 24, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3/tests: Some tests for IMXAttributes::addAttribute().
parent
813d0432
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
129 additions
and
8 deletions
+129
-8
saxreader.c
dlls/msxml3/tests/saxreader.c
+129
-8
No files found.
dlls/msxml3/tests/saxreader.c
View file @
8a0d8683
...
...
@@ -327,7 +327,6 @@ static HRESULT WINAPI contentHandler_putDocumentLocator(
ISAXContentHandler
*
iface
,
ISAXLocator
*
pLocator
)
{
ISAXAttributes
*
attr
,
*
attr1
;
HRESULT
hr
;
if
(
!
test_expect_call
(
CH_PUTDOCUMENTLOCATOR
))
...
...
@@ -338,6 +337,9 @@ static HRESULT WINAPI contentHandler_putDocumentLocator(
msxml_version
>=
6
?
expectCall
->
column_v6
:
expectCall
->
column
);
if
(
msxml_version
>=
6
)
{
ISAXAttributes
*
attr
,
*
attr1
;
IMXAttributes
*
mxattr
;
EXPECT_REF
(
pLocator
,
1
);
hr
=
ISAXLocator_QueryInterface
(
pLocator
,
&
IID_ISAXAttributes
,
(
void
**
)
&
attr
);
EXPECT_HR
(
hr
,
S_OK
);
...
...
@@ -346,6 +348,10 @@ static HRESULT WINAPI contentHandler_putDocumentLocator(
EXPECT_HR
(
hr
,
S_OK
);
EXPECT_REF
(
pLocator
,
3
);
ok
(
attr
==
attr1
,
"got %p, %p
\n
"
,
attr
,
attr1
);
hr
=
ISAXAttributes_QueryInterface
(
attr
,
&
IID_IMXAttributes
,
(
void
**
)
&
mxattr
);
EXPECT_HR
(
hr
,
E_NOINTERFACE
);
ISAXAttributes_Release
(
attr
);
ISAXAttributes_Release
(
attr1
);
}
...
...
@@ -1678,7 +1684,7 @@ struct msxmlsupported_data_t
BOOL
supported
;
};
static
struct
msxmlsupported_data_t
m
sxmlsupported
_data
[]
=
static
struct
msxmlsupported_data_t
m
xwriter_support
_data
[]
=
{
{
&
CLSID_MXXMLWriter
,
"MXXMLWriter"
},
{
&
CLSID_MXXMLWriter30
,
"MXXMLWriter30"
},
...
...
@@ -1687,7 +1693,16 @@ static struct msxmlsupported_data_t msxmlsupported_data[] =
{
NULL
}
};
static
BOOL
is_mxwriter_supported
(
const
GUID
*
clsid
,
const
struct
msxmlsupported_data_t
*
table
)
static
struct
msxmlsupported_data_t
mxattributes_support_data
[]
=
{
{
&
CLSID_SAXAttributes
,
"SAXAttributes"
},
{
&
CLSID_SAXAttributes30
,
"SAXAttributes30"
},
{
&
CLSID_SAXAttributes40
,
"SAXAttributes40"
},
{
&
CLSID_SAXAttributes60
,
"SAXAttributes60"
},
{
NULL
}
};
static
BOOL
is_clsid_supported
(
const
GUID
*
clsid
,
const
struct
msxmlsupported_data_t
*
table
)
{
while
(
table
->
clsid
)
{
...
...
@@ -1728,7 +1743,7 @@ static void test_mxwriter_default_properties(const struct mxwriter_props_t *tabl
BSTR
encoding
;
HRESULT
hr
;
if
(
!
is_
mxwriter_supported
(
table
->
clsid
,
msxmlsupported
_data
))
if
(
!
is_
clsid_supported
(
table
->
clsid
,
mxwriter_support
_data
))
{
table
++
;
i
++
;
...
...
@@ -2205,7 +2220,7 @@ static const struct writer_startendelement_t writer_startendelement[] = {
{
NULL
}
};
static
void
get_
supported_mxwriter
_data
(
struct
msxmlsupported_data_t
*
table
)
static
void
get_
mxwriter_support
_data
(
struct
msxmlsupported_data_t
*
table
)
{
while
(
table
->
clsid
)
{
...
...
@@ -2223,6 +2238,24 @@ static void get_supported_mxwriter_data(struct msxmlsupported_data_t *table)
}
}
static
void
get_mxattributes_support_data
(
struct
msxmlsupported_data_t
*
table
)
{
while
(
table
->
clsid
)
{
IMXAttributes
*
attr
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
table
->
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMXAttributes
,
(
void
**
)
&
attr
);
if
(
hr
==
S_OK
)
IMXAttributes_Release
(
attr
);
table
->
supported
=
hr
==
S_OK
;
if
(
hr
!=
S_OK
)
skip
(
"class %s not supported
\n
"
,
table
->
name
);
table
++
;
}
}
static
void
test_mxwriter_startendelement_batch
(
const
struct
writer_startendelement_t
*
table
)
{
int
i
=
0
;
...
...
@@ -2233,7 +2266,7 @@ static void test_mxwriter_startendelement_batch(const struct writer_startendelem
IMXWriter
*
writer
;
HRESULT
hr
;
if
(
!
is_
mxwriter_supported
(
table
->
clsid
,
msxmlsupported
_data
))
if
(
!
is_
clsid_supported
(
table
->
clsid
,
mxwriter_support
_data
))
{
table
++
;
i
++
;
...
...
@@ -3044,6 +3077,85 @@ static void test_mxwriter_dtd(void)
free_bstrs
();
}
typedef
struct
{
const
CLSID
*
clsid
;
const
char
*
uri
;
const
char
*
local
;
const
char
*
qname
;
const
char
*
type
;
const
char
*
value
;
HRESULT
hr
;
}
addattribute_test_t
;
static
const
addattribute_test_t
addattribute_data
[]
=
{
{
&
CLSID_SAXAttributes
,
NULL
,
NULL
,
"ns:qname"
,
NULL
,
"value"
,
E_INVALIDARG
},
{
&
CLSID_SAXAttributes30
,
NULL
,
NULL
,
"ns:qname"
,
NULL
,
"value"
,
E_INVALIDARG
},
{
&
CLSID_SAXAttributes40
,
NULL
,
NULL
,
"ns:qname"
,
NULL
,
"value"
,
E_INVALIDARG
},
{
&
CLSID_SAXAttributes60
,
NULL
,
NULL
,
"ns:qname"
,
NULL
,
"value"
,
S_OK
},
{
NULL
}
};
static
void
test_mxattr_addAttribute
(
void
)
{
const
addattribute_test_t
*
table
=
addattribute_data
;
int
i
=
0
;
while
(
table
->
clsid
)
{
ISAXAttributes
*
saxattr
;
IMXAttributes
*
mxattr
;
HRESULT
hr
;
int
len
;
if
(
!
is_clsid_supported
(
table
->
clsid
,
mxattributes_support_data
))
{
table
++
;
i
++
;
continue
;
}
hr
=
CoCreateInstance
(
table
->
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMXAttributes
,
(
void
**
)
&
mxattr
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IMXAttributes_QueryInterface
(
mxattr
,
&
IID_ISAXAttributes
,
(
void
**
)
&
saxattr
);
EXPECT_HR
(
hr
,
S_OK
);
/* SAXAttributes30 and SAXAttributes60 both crash on this test */
if
(
IsEqualGUID
(
table
->
clsid
,
&
CLSID_SAXAttributes
)
||
IsEqualGUID
(
table
->
clsid
,
&
CLSID_SAXAttributes30
))
{
hr
=
ISAXAttributes_getLength
(
saxattr
,
NULL
);
EXPECT_HR
(
hr
,
E_POINTER
);
}
len
=
-
1
;
hr
=
ISAXAttributes_getLength
(
saxattr
,
&
len
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
len
==
0
,
"got %d
\n
"
,
len
);
hr
=
IMXAttributes_addAttribute
(
mxattr
,
_bstr_
(
table
->
uri
),
_bstr_
(
table
->
local
),
_bstr_
(
table
->
qname
),
_bstr_
(
table
->
type
),
_bstr_
(
table
->
value
));
ok
(
hr
==
table
->
hr
,
"%d: got 0x%08x, expected 0x%08x
\n
"
,
i
,
hr
,
table
->
hr
);
len
=
-
1
;
hr
=
ISAXAttributes_getLength
(
saxattr
,
&
len
);
EXPECT_HR
(
hr
,
S_OK
);
if
(
table
->
hr
==
S_OK
)
ok
(
len
==
1
,
"%d: got %d length, expected 0
\n
"
,
i
,
len
);
else
ok
(
len
==
0
,
"%d: got %d length, expected 1
\n
"
,
i
,
len
);
ISAXAttributes_Release
(
saxattr
);
IMXAttributes_Release
(
mxattr
);
table
++
;
i
++
;
}
free_bstrs
();
}
START_TEST
(
saxreader
)
{
ISAXXMLReader
*
reader
;
...
...
@@ -3072,8 +3184,8 @@ START_TEST(saxreader)
test_dispex
();
/* MXXMLWriter tests */
get_
supported_mxwriter_data
(
msxmlsupported
_data
);
if
(
is_
mxwriter_supported
(
&
CLSID_MXXMLWriter
,
msxmlsupported
_data
))
get_
mxwriter_support_data
(
mxwriter_support
_data
);
if
(
is_
clsid_supported
(
&
CLSID_MXXMLWriter
,
mxwriter_support
_data
))
{
test_mxwriter_handlers
();
test_mxwriter_startenddocument
();
...
...
@@ -3091,5 +3203,14 @@ START_TEST(saxreader)
else
win_skip
(
"MXXMLWriter not supported
\n
"
);
/* SAXAttributes tests */
get_mxattributes_support_data
(
mxattributes_support_data
);
if
(
is_clsid_supported
(
&
CLSID_SAXAttributes
,
mxattributes_support_data
))
{
test_mxattr_addAttribute
();
}
else
skip
(
"SAXAttributes not supported
\n
"
);
CoUninitialize
();
}
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