Commit Graph

144 Commits

Author SHA1 Message Date
Nikolay Sivov 5066a67835 xmllite/tests: Get rid of strcmp_wa().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-07 21:28:24 +01:00
Michael Stefaniuc 7b5668a6e7 include: Make ARRAY_SIZE() available in wine/test.h.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-25 12:09:17 +02:00
Nikolay Sivov 4eedecfc61 xmllite/tests: Use ARRAY_SIZE() macro in tests.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-22 09:43:17 +01:00
Nikolay Sivov f826b25019 xmllite/tests: Use the global HeapAlloc() wrappers.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-08 13:11:10 +01:00
Nikolay Sivov b077271cfb xmllite/tests: Fix clang warning.
Reported by Gerald Pfeifer.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-06 12:15:28 +01:00
Nikolay Sivov be5679108c xmllite/reader: Implement MoveToAttributeByName().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-21 14:59:51 +02:00
Nikolay Sivov b1e0f75972 xmllite/tests: Use input stream helper in more tests.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-20 18:55:17 +02:00
Nikolay Sivov d1e14576bb xmllite/reader: Fix IID argument handling in CreateXmlReader().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-11 14:59:29 +02:00
Jacek Caban afaec19469 xmllite/tests: Use reader_value helper in one more place (Coverity).
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-04 16:33:24 +02:00
Jacek Caban 9506e7da5e xmllite: Return local name stored in namespace for prefixed namespace attribute values.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-31 19:13:34 +02:00
Jacek Caban 1b9b791c41 xmllite: Allocate value in reader_add_attr.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-31 19:13:30 +02:00
Jacek Caban daf0504570 xmllite: Allow reading from allocated strings in ReadValueChunk.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-31 19:13:27 +02:00
Jacek Caban f86222268f xmllite: Store allocated copy of local name in attribute struct and use that instead of StringValue_LocalName.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-31 19:13:21 +02:00
Jacek Caban def5587379 xmllite/tests: Added move_to_element helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-31 19:13:15 +02:00
Jacek Caban 261aa667d4 xmllite/tests: Added tests for returned string pointers.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 22:06:30 +02:00
Jacek Caban 82f9583349 xmllite/tests: Added read_value_char helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 22:06:30 +02:00
Jacek Caban e9913db388 xmllite/tests: Added reader_qname helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 22:06:30 +02:00
Jacek Caban a69aa5fc38 xmllite/tests: Added reader_namespace helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 22:06:28 +02:00
Jacek Caban b581c8f68b xmllite/tests: Added reader_prefix helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 15:55:45 +02:00
Jacek Caban c84f494c5f xmllite/tests: Added reader_name helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 15:55:43 +02:00
Jacek Caban 0c91228bb0 xmllite/tests: Added reader_value helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 15:55:41 +02:00
Jacek Caban 99d2d5e44c xmllite/tests: Added next_attribute helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 15:55:39 +02:00
Jacek Caban 8e344469bc xmllite/tests: Added read_node helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 15:55:36 +02:00
Jacek Caban 291ffdd7ff xmllite: Don't fail in readerinput_detectencoding if input buffer has 3 bytes.
3 bytes are enough for detection code and we already have tests for
that, except they (accidentally, I assume) include null byte in the stream.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-28 22:17:27 +02:00
Jacek Caban bbd0ee4391 xmllite/tests: Added set_input_string helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-28 22:17:04 +02:00
Jacek Caban 40a241469e xmllite/tests: Added more value tests.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-22 18:40:30 +01:00
Jacek Caban 48fff1b931 xmllite: Replace crln in input buffer with nl.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-22 18:40:26 +01:00
Jacek Caban 2b5203bdcd xmllite: Fixed ReadValueChunk implementation.
Mostly copy all characters to output buffer, but also minor fixes to
returned values found by tests.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-22 17:05:14 +01:00
Jacek Caban a3d78064d9 xmllite: Fixed buffer handling in reader_parse_reference.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-20 14:03:51 +01:00
Jacek Caban 68aeee4d79 xmllite: Return WC_E_SYNTAX if there is unexpected data in the end of the stream.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-20 14:03:49 +01:00
Nikolay Sivov fc68269a52 xmllite/tests: Added missing return value check (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-20 13:22:49 +01:00
Nikolay Sivov d7057a34b3 xmllite/reader: For elements without a prefix return same string for both local and qualified names.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-17 15:54:16 +01:00
Nikolay Sivov 876de4a73d xmllite/reader: Reset reader nesting depth on error.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-13 19:28:35 +01:00
Nikolay Sivov ec9e05c27c xmllite/reader: Enter error state on parsing error.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-13 19:28:32 +01:00
Nikolay Sivov b115e9675f xmllite/reader: Improve returned position for whitespace text nodes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 10:03:52 +01:00
Nikolay Sivov 9685fec174 xmllite/reader: Improve line number updating when switching to the next line.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 10:03:50 +01:00
Nikolay Sivov 79a65678fc xmllite/reader: Fix position methods return values in closed reader state.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 10:03:48 +01:00
Nikolay Sivov 62a41d035c xmllite/reader: Return correct error for multiple colons in qualified name.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 10:03:46 +01:00
Nikolay Sivov 3b83a44639 xmllite/reader: Explicitly return empty string as qualified name for some node types.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 10:03:44 +01:00
Nikolay Sivov 52f91932ac xmllite/reader: Explicitly return empty static string as local name for nodes without names.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-10 10:03:42 +01:00
Nikolay Sivov 65e62c3308 xmllite/reader: Fix reader position returned for xml declaration node.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-09 10:18:13 +01:00
Nikolay Sivov 6cf9524f07 xmllite/reader: Improve returned reader position for elements and attributes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-09 10:18:11 +01:00
Nikolay Sivov 162353ac8e xmllite/tests: Some tests for reader position.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-09 10:18:07 +01:00
Nikolay Sivov d3319f60ad xmllite/reader: Return prefixes from namespace stack.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-09 10:18:06 +01:00
Nikolay Sivov b57589a32d xmllite/reader: Return qualified element names from the stack, instead of input buffer.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-08 15:30:24 +01:00
Nikolay Sivov 3ae1043fc1 xmllite/reader: Return local element names from the stack, instead of input buffer.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-08 15:30:22 +01:00
Nikolay Sivov 3697bd9acf xmllite/reader: Return empty string for namespace uri for some nodes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-08 15:30:20 +01:00
Nikolay Sivov 63c489fab5 xmllite/reader: Fix GetValue() for comments.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-08 15:30:18 +01:00
Nikolay Sivov 2d3ec1247d xmllite/tests: A couple of newline normalization tests for text nodes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-08 15:30:16 +01:00
Nikolay Sivov 71a0733052 xmllite/reader: Enforce maximum element depth limit.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-07 09:00:51 +01:00