0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-28 14:48:43 +08:00

301 Commits

Author SHA1 Message Date
Arseny Kapoulkine
5b875e8487 tests: Add one more XPath optimization test
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1022 99668b35-9821-0410-8761-19e4c4f06640
2014-09-23 04:40:05 +00:00
Arseny Kapoulkine
89fc7c241c tests: More XPath tests
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1020 99668b35-9821-0410-8761-19e4c4f06640
2014-09-23 04:39:51 +00:00
Arseny Kapoulkine
53550424d9 tests: Fix PUGIXML_WCHAR_MODE build
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1017 99668b35-9821-0410-8761-19e4c4f06640
2014-09-21 21:52:24 +00:00
Arseny Kapoulkine
27109cd626 tests: Add test for custom indentation strings
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1016 99668b35-9821-0410-8761-19e4c4f06640
2014-09-21 21:52:19 +00:00
Arseny Kapoulkine
3abba14e72 tests: Add a test for stackless write.
This test previously caused a stack overflow on x86/MSVC.

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1015 99668b35-9821-0410-8761-19e4c4f06640
2014-09-21 21:52:13 +00:00
Arseny Kapoulkine
fbfe207fe6 tests: Add git-svn reviving script
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1010 99668b35-9821-0410-8761-19e4c4f06640
2014-09-12 15:04:20 +00:00
Arseny Kapoulkine
54b68a32b4 tests: Add tests for node movement
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1003 99668b35-9821-0410-8761-19e4c4f06640
2014-08-10 23:52:52 +00:00
Arseny Kapoulkine
757c494340 Improve XPath allocator performance
When allocating new pages, make sure that the page has at least 1/4 of the
base page size free. This makes sure that we can do small allocations after
big allocations (i.e. huge node lists) without doing a heap alloc.

This is important because XPath stack code always reclaims extra pages after
evaluating sub-expressions, so allocating a small chunk of memory and then
rolling the state back is a common case (filtering a node list using a
predicate usually does this).

A better solution involves smarter allocation rollback strategy, but the
implemented solution is simple and practical.

git-svn-id: https://pugixml.googlecode.com/svn/trunk@999 99668b35-9821-0410-8761-19e4c4f06640
2014-06-01 19:12:36 +00:00
Arseny Kapoulkine
9c5efaa074 tests: Fix Mac OS X compilation.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@997 99668b35-9821-0410-8761-19e4c4f06640
2014-04-02 05:29:19 +00:00
Arseny Kapoulkine
e33e1083ad tests: Fix WinCE compilation
git-svn-id: https://pugixml.googlecode.com/svn/trunk@991 99668b35-9821-0410-8761-19e4c4f06640
2014-02-26 22:37:40 +00:00
Arseny Kapoulkine
5a4cedbe91 tests: Add tests for parse_trim_pcdata.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@988 99668b35-9821-0410-8761-19e4c4f06640
2014-02-25 03:41:57 +00:00
Arseny Kapoulkine
cbd8131d09 Fix clang build.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@986 99668b35-9821-0410-8761-19e4c4f06640
2014-02-23 19:38:24 +00:00
Arseny Kapoulkine
934bddcfa6 Fix gap collapsing during PCDATA parsing for fragment mode.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@985 99668b35-9821-0410-8761-19e4c4f06640
2014-02-23 19:28:27 +00:00
Arseny Kapoulkine
bd960159dd tests: Write temporary files to executable folder.
Temp folder is the root folder on Windows; writing to the folder may require administrator rights.
We can't use current folder for temporaries because tests from different configurations can be running
in parallel, but executable folder is always safe since we only run each executable once.

git-svn-id: https://pugixml.googlecode.com/svn/trunk@984 99668b35-9821-0410-8761-19e4c4f06640
2014-02-19 06:21:51 +00:00
Arseny Kapoulkine
284f56f588 Add MSVC 12 (2013) to autotest list
git-svn-id: https://pugixml.googlecode.com/svn/trunk@982 99668b35-9821-0410-8761-19e4c4f06640
2014-02-12 04:38:54 +00:00
Arseny Kapoulkine
47c15ad949 Implement document fragment parsing.
Introduce a notable behavior change in default parsing mode: documents without a
document element node are now considered invalid. This is technically a breaking change,
however the amount of documents it affects is very small, all parsed data still persists,
and lack of this check results in very confusing behavior in a number of cases.

In order to be able to parse documents without an element node, a fragment parsing flag is
introduced.

Parsing a buffer in fragment mode treats the buffer as a fragment of a valid XML.
As a consequence, top-level PCDATA is added to the tree; additionally, there are no
restrictions on the number of nodes -- so documents without a document element are considered
valid.

Due to the way parsing works internally, load_buffer_inplace occasionally can not preserve
the document contents if it's parsed in a fragment mode. While unfortunate, this problem is
fundamental; since the use case is relatively obscure, hopefully documenting this shortcoming
will be enough.

git-svn-id: https://pugixml.googlecode.com/svn/trunk@980 99668b35-9821-0410-8761-19e4c4f06640
2014-02-11 06:45:27 +00:00
Arseny Kapoulkine
5fa25a878a Fix bogus Clang 3.4 warning
git-svn-id: https://pugixml.googlecode.com/svn/trunk@979 99668b35-9821-0410-8761-19e4c4f06640
2014-02-11 04:55:36 +00:00
Arseny Kapoulkine
f5a5f49802 Fix clang build.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@978 99668b35-9821-0410-8761-19e4c4f06640
2014-02-10 17:04:17 +00:00
Arseny Kapoulkine
79fb68ac41 Use a null-terminated buffer for parsing as often as possible.
Parsing used to work on a non null-terminated buffer, inserting a fake null terminator to increase performance.
This makes it impossible to implement fragment parsing that preserves PCDATA contents (as witnessed by some
tests for boundary conditions that actually depended on this behavior).

Since almost all uses result in us allocating an internal buffer anyway, the new policy is to make sure all buffers
that are allocated by pugixml are null-terminated - the only exception now is external calls to load_buffer_inplace
that don't trigger encoding conversion.

git-svn-id: https://pugixml.googlecode.com/svn/trunk@977 99668b35-9821-0410-8761-19e4c4f06640
2014-02-10 16:57:04 +00:00
Arseny Kapoulkine
9ba26b94c7 Replace memory-management functions before every test.
In case a test sets memory-management functions to perform custom testing and fails midway,
all subsequent tests that rely on custom memory handling (i.e. threshold) can fail unexpectedly.
Setting up the functions before every test fixes this, making all tests self-contained.

git-svn-id: https://pugixml.googlecode.com/svn/trunk@976 99668b35-9821-0410-8761-19e4c4f06640
2014-02-10 16:56:55 +00:00
Arseny Kapoulkine
acf9dee0dd Update PUGIXML_VERSION define
git-svn-id: https://pugixml.googlecode.com/svn/trunk@973 99668b35-9821-0410-8761-19e4c4f06640
2014-02-10 05:11:05 +00:00
Arseny Kapoulkine
543fa8268d Add Makefile for building and running tests.
This expands and replaces the Travis-specific makefile by adding more options and correctly tracking header dependencies.
Also add wchar_t mode test to Travis configuration.



git-svn-id: http://pugixml.googlecode.com/svn/trunk@971 99668b35-9821-0410-8761-19e4c4f06640
2014-02-09 21:56:30 +00:00
Arseny Kapoulkine
09647e2b29 Add scripts for Travis CI
git-svn-id: http://pugixml.googlecode.com/svn/trunk@969 99668b35-9821-0410-8761-19e4c4f06640
2014-02-09 00:05:19 +00:00
Arseny Kapoulkine
0557a06764 Fix test suite stringizing macros to be C++11-compliant
git-svn-id: http://pugixml.googlecode.com/svn/trunk@963 99668b35-9821-0410-8761-19e4c4f06640
2014-02-08 20:39:25 +00:00
Arseny Kapoulkine
f9bbc39bd9 Implement long long support if PUGIXML_HAS_LONG_LONG is defined (autodetection is not implemented yet)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@962 99668b35-9821-0410-8761-19e4c4f06640
2014-02-08 20:36:09 +00:00
Arseny Kapoulkine
0938714fa0 Change xml_named_node_iterator to be bidirectional and to match xml_node_iterator in terms of internals
git-svn-id: http://pugixml.googlecode.com/svn/trunk@960 99668b35-9821-0410-8761-19e4c4f06640
2014-01-27 03:54:05 +00:00
Arseny Kapoulkine
7f6b062e9f Implement automatic hexadecimal decoding for xml_attribute::as_int and xml_text::as_int. This is effectively a form of strtol with base 0, but without octal support.
git-svn-id: http://pugixml.googlecode.com/svn/trunk@958 99668b35-9821-0410-8761-19e4c4f06640
2014-01-15 04:28:10 +00:00
arseny.kapoulkine@gmail.com
cac6b8720a Make sure newlines are consistent for both .zip and .tar.gz archives
git-svn-id: http://pugixml.googlecode.com/svn/trunk@953 99668b35-9821-0410-8761-19e4c4f06640
2013-07-20 05:55:22 +00:00
arseny.kapoulkine@gmail.com
4e1add1a46 Fix invalid assertion in XPath: reallocation can result in allocating buffer of the same size due to pointer-sized alignment
git-svn-id: http://pugixml.googlecode.com/svn/trunk@946 99668b35-9821-0410-8761-19e4c4f06640
2013-03-20 02:44:05 +00:00
arseny.kapoulkine@gmail.com
9b9a414ab6 Compatibility fixes (fixed warnings in gcc, msvc7, fixed errors in bcc, cw, msvc6)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@939 99668b35-9821-0410-8761-19e4c4f06640
2012-12-07 06:35:53 +00:00
arseny.kapoulkine@gmail.com
00d4994f24 tests: Added append_buffer tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@937 99668b35-9821-0410-8761-19e4c4f06640
2012-12-07 04:49:51 +00:00
arseny.kapoulkine@gmail.com
efc634a718 archive.pl now creates a wrapping folder in both .tar.gz and .zip archives
git-svn-id: http://pugixml.googlecode.com/svn/trunk@935 99668b35-9821-0410-8761-19e4c4f06640
2012-11-20 05:34:06 +00:00
arseny.kapoulkine@gmail.com
cee7eca229 XPath: Fix unit test that (incorrectly) relied on right-associativity of union operator to trigger out of memory condition
git-svn-id: http://pugixml.googlecode.com/svn/trunk@930 99668b35-9821-0410-8761-19e4c4f06640
2012-11-17 23:51:43 +00:00
arseny.kapoulkine@gmail.com
48f9343c05 XPath: Add unit test for unary minus and union precedences
git-svn-id: http://pugixml.googlecode.com/svn/trunk@929 99668b35-9821-0410-8761-19e4c4f06640
2012-11-17 22:50:05 +00:00
arseny.kapoulkine@gmail.com
68d533a828 tests: Remove 'con' loading from tests since it stopped working under Windows 8...
git-svn-id: http://pugixml.googlecode.com/svn/trunk@921 99668b35-9821-0410-8761-19e4c4f06640
2012-10-31 04:45:38 +00:00
arseny.kapoulkine@gmail.com
2876af6773 Fix find_child_by_attribute assertion for attributes with null name/value.
git-svn-id: http://pugixml.googlecode.com/svn/trunk@920 99668b35-9821-0410-8761-19e4c4f06640
2012-09-29 06:36:29 +00:00
arseny.kapoulkine@gmail.com
4a2d398a07 tests: Fixed PUGIXML_NO_STL compilation
git-svn-id: http://pugixml.googlecode.com/svn/trunk@898 99668b35-9821-0410-8761-19e4c4f06640
2012-04-04 02:01:22 +00:00
arseny.kapoulkine@gmail.com
bda8e935e9 Updated version number and copyright year everywhere
git-svn-id: http://pugixml.googlecode.com/svn/trunk@897 99668b35-9821-0410-8761-19e4c4f06640
2012-04-03 05:04:07 +00:00
arseny.kapoulkine@gmail.com
a47bd44953 tests: Added tests for as_string and default values in as_*
git-svn-id: http://pugixml.googlecode.com/svn/trunk@894 99668b35-9821-0410-8761-19e4c4f06640
2012-04-03 04:44:54 +00:00
arseny.kapoulkine@gmail.com
f4ac43c549 tests: Added xml_named_node_iterator tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@892 99668b35-9821-0410-8761-19e4c4f06640
2012-03-27 05:46:44 +00:00
arseny.kapoulkine@gmail.com
1cd736905b tests: Added text/binary save_file tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@884 99668b35-9821-0410-8761-19e4c4f06640
2012-03-23 05:38:08 +00:00
arseny.kapoulkine@gmail.com
9269e24a4b tests: Added tests for xml_text mutation operations
git-svn-id: http://pugixml.googlecode.com/svn/trunk@877 99668b35-9821-0410-8761-19e4c4f06640
2012-03-23 03:40:30 +00:00
arseny.kapoulkine@gmail.com
0237fb466e tests: Added tests for read-only xml_text operations
git-svn-id: http://pugixml.googlecode.com/svn/trunk@875 99668b35-9821-0410-8761-19e4c4f06640
2012-03-23 03:25:03 +00:00
arseny.kapoulkine@gmail.com
742a1db2df tests: Added new test for string/istream include interaction (this actually fails on DMC)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@865 99668b35-9821-0410-8761-19e4c4f06640
2012-03-20 05:05:35 +00:00
arseny.kapoulkine@gmail.com
35ea9a6088 tests: Added tests for constant iterator objects
git-svn-id: http://pugixml.googlecode.com/svn/trunk@859 99668b35-9821-0410-8761-19e4c4f06640
2012-03-14 05:34:29 +00:00
arseny.kapoulkine@gmail.com
ca8d43ba03 tests: Added MSVC11 variants to test suite
git-svn-id: http://pugixml.googlecode.com/svn/trunk@851 99668b35-9821-0410-8761-19e4c4f06640
2012-03-07 05:59:09 +00:00
arseny.kapoulkine@gmail.com
199b97a851 tests: Miscellaneous fixes
git-svn-id: http://pugixml.googlecode.com/svn/trunk@850 99668b35-9821-0410-8761-19e4c4f06640
2012-03-06 16:56:45 +00:00
arseny.kapoulkine@gmail.com
8b8cf7977c tests: Added Android to testing (STLport variant is only tested without exceptions because of library issues)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@848 99668b35-9821-0410-8761-19e4c4f06640
2012-03-06 09:14:04 +00:00
arseny.kapoulkine@gmail.com
04629118db tests: Android compilation fixes
git-svn-id: http://pugixml.googlecode.com/svn/trunk@846 99668b35-9821-0410-8761-19e4c4f06640
2012-03-06 08:49:58 +00:00
arseny.kapoulkine@gmail.com
72dd6038a2 tests: Added BlackBerry NDK to test suite
git-svn-id: http://pugixml.googlecode.com/svn/trunk@845 99668b35-9821-0410-8761-19e4c4f06640
2012-03-06 07:13:25 +00:00