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
864f1701
Commit
864f1701
authored
Sep 21, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Fix putProperty() for lexical handler case.
parent
be0d2944
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
295 additions
and
85 deletions
+295
-85
saxreader.c
dlls/msxml3/saxreader.c
+118
-85
saxreader.c
dlls/msxml3/tests/saxreader.c
+177
-0
No files found.
dlls/msxml3/saxreader.c
View file @
864f1701
This diff is collapsed.
Click to expand it.
dlls/msxml3/tests/saxreader.c
View file @
864f1701
...
@@ -711,6 +711,99 @@ static const ISAXAttributesVtbl SAXAttributesVtbl =
...
@@ -711,6 +711,99 @@ static const ISAXAttributesVtbl SAXAttributesVtbl =
static
ISAXAttributes
saxattributes
=
{
&
SAXAttributesVtbl
};
static
ISAXAttributes
saxattributes
=
{
&
SAXAttributesVtbl
};
static
int
lexicalhandler_addrefcalled
;
static
HRESULT
WINAPI
isaxlexical_QueryInterface
(
ISAXLexicalHandler
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
*
ppvObject
=
NULL
;
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_ISAXLexicalHandler
))
{
*
ppvObject
=
iface
;
}
else
{
return
E_NOINTERFACE
;
}
return
S_OK
;
}
static
ULONG
WINAPI
isaxlexical_AddRef
(
ISAXLexicalHandler
*
iface
)
{
lexicalhandler_addrefcalled
++
;
return
2
;
}
static
ULONG
WINAPI
isaxlexical_Release
(
ISAXLexicalHandler
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
isaxlexical_startDTD
(
ISAXLexicalHandler
*
iface
,
const
WCHAR
*
pName
,
int
nName
,
const
WCHAR
*
pPublicId
,
int
nPublicId
,
const
WCHAR
*
pSystemId
,
int
nSystemId
)
{
ok
(
0
,
"call not expected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxlexical_endDTD
(
ISAXLexicalHandler
*
iface
)
{
ok
(
0
,
"call not expected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxlexical_startEntity
(
ISAXLexicalHandler
*
iface
,
const
WCHAR
*
pName
,
int
nName
)
{
ok
(
0
,
"call not expected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxlexical_endEntity
(
ISAXLexicalHandler
*
iface
,
const
WCHAR
*
pName
,
int
nName
)
{
ok
(
0
,
"call not expected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxlexical_startCDATA
(
ISAXLexicalHandler
*
iface
)
{
ok
(
0
,
"call not expected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxlexical_endCDATA
(
ISAXLexicalHandler
*
iface
)
{
ok
(
0
,
"call not expected
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
isaxlexical_comment
(
ISAXLexicalHandler
*
iface
,
const
WCHAR
*
pChars
,
int
nChars
)
{
ok
(
0
,
"call not expected
\n
"
);
return
E_NOTIMPL
;
}
static
const
ISAXLexicalHandlerVtbl
SAXLexicalHandlerVtbl
=
{
isaxlexical_QueryInterface
,
isaxlexical_AddRef
,
isaxlexical_Release
,
isaxlexical_startDTD
,
isaxlexical_endDTD
,
isaxlexical_startEntity
,
isaxlexical_endEntity
,
isaxlexical_startCDATA
,
isaxlexical_endCDATA
,
isaxlexical_comment
};
static
ISAXLexicalHandler
saxlexicalhandler
=
{
&
SAXLexicalHandlerVtbl
};
typedef
struct
mxwriter_write_test_t
{
typedef
struct
mxwriter_write_test_t
{
BOOL
last
;
BOOL
last
;
const
BYTE
*
data
;
const
BYTE
*
data
;
...
@@ -1001,6 +1094,89 @@ static void test_saxreader(void)
...
@@ -1001,6 +1094,89 @@ static void test_saxreader(void)
SysFreeString
(
bstrData
);
SysFreeString
(
bstrData
);
}
}
static
void
test_saxreader_properties
(
void
)
{
ISAXXMLReader
*
reader
;
VARIANT
v
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_SAXXMLReader
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_ISAXXMLReader
,
(
void
**
)
&
reader
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
ISAXXMLReader_getProperty
(
reader
,
_bstr_
(
"http://xml.org/sax/properties/lexical-handler"
),
NULL
);
EXPECT_HR
(
hr
,
E_POINTER
);
/* set/remove lexical handler */
V_VT
(
&
v
)
=
VT_EMPTY
;
V_UNKNOWN
(
&
v
)
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
ISAXXMLReader_getProperty
(
reader
,
_bstr_
(
"http://xml.org/sax/properties/lexical-handler"
),
&
v
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
V_VT
(
&
v
)
==
VT_UNKNOWN
,
"got %d
\n
"
,
V_VT
(
&
v
));
ok
(
V_UNKNOWN
(
&
v
)
==
NULL
,
"got %p
\n
"
,
V_UNKNOWN
(
&
v
));
V_VT
(
&
v
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
v
)
=
(
IUnknown
*
)
&
saxlexicalhandler
;
hr
=
ISAXXMLReader_putProperty
(
reader
,
_bstr_
(
"http://xml.org/sax/properties/lexical-handler"
),
v
);
EXPECT_HR
(
hr
,
S_OK
);
V_VT
(
&
v
)
=
VT_EMPTY
;
V_UNKNOWN
(
&
v
)
=
(
IUnknown
*
)
0xdeadbeef
;
lexicalhandler_addrefcalled
=
0
;
hr
=
ISAXXMLReader_getProperty
(
reader
,
_bstr_
(
"http://xml.org/sax/properties/lexical-handler"
),
&
v
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
V_VT
(
&
v
)
==
VT_UNKNOWN
,
"got %d
\n
"
,
V_VT
(
&
v
));
ok
(
V_UNKNOWN
(
&
v
)
==
(
IUnknown
*
)
&
saxlexicalhandler
,
"got %p
\n
"
,
V_UNKNOWN
(
&
v
));
ok
(
lexicalhandler_addrefcalled
==
1
,
"AddRef called %d times
\n
"
,
lexicalhandler_addrefcalled
);
VariantClear
(
&
v
);
V_VT
(
&
v
)
=
VT_EMPTY
;
V_UNKNOWN
(
&
v
)
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
ISAXXMLReader_putProperty
(
reader
,
_bstr_
(
"http://xml.org/sax/properties/lexical-handler"
),
v
);
EXPECT_HR
(
hr
,
S_OK
);
V_VT
(
&
v
)
=
VT_EMPTY
;
V_UNKNOWN
(
&
v
)
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
ISAXXMLReader_getProperty
(
reader
,
_bstr_
(
"http://xml.org/sax/properties/lexical-handler"
),
&
v
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
V_VT
(
&
v
)
==
VT_UNKNOWN
,
"got %d
\n
"
,
V_VT
(
&
v
));
ok
(
V_UNKNOWN
(
&
v
)
==
NULL
,
"got %p
\n
"
,
V_UNKNOWN
(
&
v
));
V_VT
(
&
v
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
v
)
=
(
IUnknown
*
)
&
saxlexicalhandler
;
hr
=
ISAXXMLReader_putProperty
(
reader
,
_bstr_
(
"http://xml.org/sax/properties/lexical-handler"
),
v
);
EXPECT_HR
(
hr
,
S_OK
);
/* only VT_EMPTY seems to be valid to reset property */
V_VT
(
&
v
)
=
VT_I4
;
V_UNKNOWN
(
&
v
)
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
ISAXXMLReader_putProperty
(
reader
,
_bstr_
(
"http://xml.org/sax/properties/lexical-handler"
),
v
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
V_VT
(
&
v
)
=
VT_EMPTY
;
V_UNKNOWN
(
&
v
)
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
ISAXXMLReader_getProperty
(
reader
,
_bstr_
(
"http://xml.org/sax/properties/lexical-handler"
),
&
v
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
V_VT
(
&
v
)
==
VT_UNKNOWN
,
"got %d
\n
"
,
V_VT
(
&
v
));
ok
(
V_UNKNOWN
(
&
v
)
==
(
IUnknown
*
)
&
saxlexicalhandler
,
"got %p
\n
"
,
V_UNKNOWN
(
&
v
));
VariantClear
(
&
v
);
V_VT
(
&
v
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
v
)
=
NULL
;
hr
=
ISAXXMLReader_putProperty
(
reader
,
_bstr_
(
"http://xml.org/sax/properties/lexical-handler"
),
v
);
EXPECT_HR
(
hr
,
S_OK
);
V_VT
(
&
v
)
=
VT_EMPTY
;
V_UNKNOWN
(
&
v
)
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
ISAXXMLReader_getProperty
(
reader
,
_bstr_
(
"http://xml.org/sax/properties/lexical-handler"
),
&
v
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
V_VT
(
&
v
)
==
VT_UNKNOWN
,
"got %d
\n
"
,
V_VT
(
&
v
));
ok
(
V_UNKNOWN
(
&
v
)
==
NULL
,
"got %p
\n
"
,
V_UNKNOWN
(
&
v
));
ISAXXMLReader_Release
(
reader
);
free_bstrs
();
}
/* UTF-8 data with UTF-8 BOM and UTF-16 in prolog */
/* UTF-8 data with UTF-8 BOM and UTF-16 in prolog */
static
const
CHAR
UTF8BOMTest
[]
=
static
const
CHAR
UTF8BOMTest
[]
=
"
\xEF\xBB\xBF
<?xml version =
\"
1.0
\"
encoding =
\"
UTF-16
\"
?>
\n
"
"
\xEF\xBB\xBF
<?xml version =
\"
1.0
\"
encoding =
\"
UTF-16
\"
?>
\n
"
...
@@ -2050,6 +2226,7 @@ START_TEST(saxreader)
...
@@ -2050,6 +2226,7 @@ START_TEST(saxreader)
ISAXXMLReader_Release
(
reader
);
ISAXXMLReader_Release
(
reader
);
test_saxreader
();
test_saxreader
();
test_saxreader_properties
();
test_encoding
();
test_encoding
();
/* MXXMLWriter tests */
/* MXXMLWriter tests */
...
...
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