Commit Graph

273 Commits

Author SHA1 Message Date
Michael Stefaniuc 962b31c80b include: Add a generic available ARRAY_SIZE().
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-04 10:39:15 +02: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 4a78b4da41 xmllite: Use ARRAY_SIZE macro for reader too.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-22 09:43:13 +01:00
Michael Stefaniuc c9f1ada8e5 xmllite: Use the global HeapAlloc() wrappers.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-08 21:09:10 +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 4b6d8fb063 xmllite/tests: Added a test for output with code page 1200.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-03 11:50:51 +02:00
Nikolay Sivov 49a57bcaba xmllite/writer: Improve handling of the output with invalid encoding.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-03 11:50:49 +02:00
Nikolay Sivov a6d6bebede xmllite/writer: Do not indent after just BOM has been written.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-24 09:45:12 +02:00
Nikolay Sivov 5773a5d3b4 xmllite/writer: Fix indentation on WriteElementString().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-24 09:45:10 +02:00
Nikolay Sivov 5f4ed88ee8 xmllite/writer: Fix empty element and state handling in WriteElementString().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-24 09:45:08 +02:00
Nikolay Sivov b06dd7d804 xmllite/reader: Added a helper for setting current attribute cursor.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-21 14:59:54 +02: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 707ab559e5 xmllite/writer: Fix IID argument handling in CreateXmlWriter().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-11 14:59:33 +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
Nikolay Sivov a68e51ce63 xmllite/writer: Preserve original encoding name spelling in writer output.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-03 10:52:41 +02:00
Nikolay Sivov ef023c3fd6 xmllite: Recognize us-ascii encoding.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-03 10:52:39 +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 004d615f83 xmllite: Don't use StringValue_LocalName for element nodes.
It's not used anyway.

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:10 +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 6917e2aa3c xmllite: Clear all parser values in SetInput.
Not clearing namespaces was problematic for tests, but clearing other
values also looks like a good idea.

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 536ed3f3fb xmllite: Return empty value for end element and none nodes.
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 253f233e52 xmllite/reader: Return same string for local and qualified names for attributes when appropriate.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-17 15:54:19 +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 1e015f1e14 xmllite/reader: Always return local name from element structure.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-17 15:54:13 +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