0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-29 07:19:43 +08:00

58 Commits

Author SHA1 Message Date
Arseny Kapoulkine
e9956ae3a6 Rename xml_document::load to load_string
This should completely eliminate the confusion between load and load_file.
Of course, for compatibility reasons we have to preserve the old variant -
it will be deprecated in a future version and subsequently removed.
2014-11-17 19:52:23 -08:00
Arseny Kapoulkine
79ed320f89 tests: Don't use /dev/tty
The behavior on OSX is different - we don't get a I/O error so the test is
useless.
2014-11-17 08:35:34 -08:00
Arseny Kapoulkine
f68a320a02 tests: Improve test coverage 2014-11-01 11:45:13 +01:00
Arseny Kapoulkine
903db8682a tests: Add more tests for better coverage
More tests for out-of-memory and other edge conditions

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1075 99668b35-9821-0410-8761-19e4c4f06640
2014-10-23 07:41:07 +00:00
Arseny Kapoulkine
bbd75fda46 tests: Improve test coverage
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1074 99668b35-9821-0410-8761-19e4c4f06640
2014-10-23 05:46:44 +00:00
Arseny Kapoulkine
4d39ae9e45 tests: Add a test to verify that xml_document object works with any valid pointer alignment
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1039 99668b35-9821-0410-8761-19e4c4f06640
2014-10-02 03:07:08 +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
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
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
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@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
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
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
f6c8613229 tests: Use mkstemp on Unix and QNX (BlackBerry) to avoid tmpnam deprecation warning
git-svn-id: http://pugixml.googlecode.com/svn/trunk@843 99668b35-9821-0410-8761-19e4c4f06640
2012-03-06 07:03:09 +00:00
arseny.kapoulkine@gmail.com
fdc03d39ab tests: Fixed compilation errors for BadaSDK
git-svn-id: http://pugixml.googlecode.com/svn/trunk@839 99668b35-9821-0410-8761-19e4c4f06640
2012-03-06 06:13:10 +00:00
arseny.kapoulkine@gmail.com
9133322c4c tests: Minor fixes for WinCE compilation
git-svn-id: http://pugixml.googlecode.com/svn/trunk@834 99668b35-9821-0410-8761-19e4c4f06640
2012-02-19 09:05:23 +00:00
arseny.kapoulkine
a0769dfe38 Introduced encoding_latin1 support (conversion on loading, conversion on saving, encoding name in declaration in document::save)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@829 99668b35-9821-0410-8761-19e4c4f06640
2011-12-20 09:45:10 +00:00
arseny.kapoulkine
39e6b2701d tests: Added tests for non-seekable streams
git-svn-id: http://pugixml.googlecode.com/svn/trunk@810 99668b35-9821-0410-8761-19e4c4f06640
2011-07-19 15:20:39 +00:00
arseny.kapoulkine
d99745be21 Enabled many additional GCC warnings (most notably -Wshadow and -Wold-style-cast), fixed the code accordingly
git-svn-id: http://pugixml.googlecode.com/svn/trunk@800 99668b35-9821-0410-8761-19e4c4f06640
2010-12-19 10:16:37 +00:00
arseny.kapoulkine
0a96b552d6 tests: Added document reset-self test
git-svn-id: http://pugixml.googlecode.com/svn/trunk@787 99668b35-9821-0410-8761-19e4c4f06640
2010-10-31 07:37:37 +00:00
arseny.kapoulkine
4920e4fec9 Added xml_document::reset() function with document parameter
git-svn-id: http://pugixml.googlecode.com/svn/trunk@786 99668b35-9821-0410-8761-19e4c4f06640
2010-10-31 07:33:01 +00:00
arseny.kapoulkine
09b5dfdcb0 Added xml_document::reset, added append/prepend/insert child overloads for elements (with explicit name)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@779 99668b35-9821-0410-8761-19e4c4f06640
2010-10-26 17:09:34 +00:00
arseny.kapoulkine
e3bbc9c40e tests: Fixed WCHAR mode compilation
git-svn-id: http://pugixml.googlecode.com/svn/trunk@774 99668b35-9821-0410-8761-19e4c4f06640
2010-10-22 19:01:50 +00:00
arseny.kapoulkine
d8c19b201f Added xml_document::document_element function
git-svn-id: http://pugixml.googlecode.com/svn/trunk@768 99668b35-9821-0410-8761-19e4c4f06640
2010-10-18 18:27:13 +00:00
arseny.kapoulkine
f725ff1170 tests: Fixed XPath OOM tests, added parsing exception test
git-svn-id: http://pugixml.googlecode.com/svn/trunk@760 99668b35-9821-0410-8761-19e4c4f06640
2010-10-03 14:28:18 +00:00
arseny.kapoulkine
b84eb7bdba tests: Added load_file/save_file tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@742 99668b35-9821-0410-8761-19e4c4f06640
2010-09-20 20:14:38 +00:00
arseny.kapoulkine
0868f83deb tests: Removed some deprecated tests, minor coverage improvements
git-svn-id: http://pugixml.googlecode.com/svn/trunk@687 99668b35-9821-0410-8761-19e4c4f06640
2010-08-29 15:45:36 +00:00
arseny.kapoulkine
7fab1bf757 tests: Reduced allocation count
git-svn-id: http://pugixml.googlecode.com/svn/trunk@662 99668b35-9821-0410-8761-19e4c4f06640
2010-08-29 15:26:06 +00:00
arseny.kapoulkine
8d39e54f49 tests: Added tests for short buffers (they duplicate the progressive truncation test, but it's better to have explicit tests)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@632 99668b35-9821-0410-8761-19e4c4f06640
2010-08-09 11:24:26 +00:00
arseny.kapoulkine
a9bc2d8873 tests: Fixed tests for wchar_t mode, added dummy std::cout/wcout usage for MSVC in order to create locales beforehand (avoids memory leaks during tests), minor additional test fixes
git-svn-id: http://pugixml.googlecode.com/svn/trunk@629 99668b35-9821-0410-8761-19e4c4f06640
2010-08-04 20:10:10 +00:00
arseny.kapoulkine
05c651d87f tests: Added more tests for better code coverage
git-svn-id: http://pugixml.googlecode.com/svn/trunk@626 99668b35-9821-0410-8761-19e4c4f06640
2010-08-04 10:01:16 +00:00
arseny.kapoulkine
085584aa30 tests: Preparations for custom new/delete (leak detection)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@620 99668b35-9821-0410-8761-19e4c4f06640
2010-08-03 08:03:23 +00:00
arseny.kapoulkine
958ee27e7f tests: Miscellaneous test fixes
git-svn-id: http://pugixml.googlecode.com/svn/trunk@618 99668b35-9821-0410-8761-19e4c4f06640
2010-07-22 17:22:44 +00:00
arseny.kapoulkine
0363bccfc9 tests: Fixed warning
git-svn-id: http://pugixml.googlecode.com/svn/trunk@612 99668b35-9821-0410-8761-19e4c4f06640
2010-07-22 05:17:54 +00:00
arseny.kapoulkine
2ac60c851e tests: Added stream exception test
git-svn-id: http://pugixml.googlecode.com/svn/trunk@611 99668b35-9821-0410-8761-19e4c4f06640
2010-07-22 05:09:50 +00:00
arseny.kapoulkine
7d24b9b565 Set svn:eol-style to native for all text files
git-svn-id: http://pugixml.googlecode.com/svn/trunk@607 99668b35-9821-0410-8761-19e4c4f06640
2010-07-19 09:57:32 +00:00
arseny.kapoulkine
2dec6dd505 tests: Added Xbox360 and PS3 toolset support
git-svn-id: http://pugixml.googlecode.com/svn/trunk@602 99668b35-9821-0410-8761-19e4c4f06640
2010-07-15 09:29:32 +00:00
arseny.kapoulkine
aeaa1da161 Renamed encoding_t to xml_encoding, renamed xpath_type_t to xpath_value_type
git-svn-id: http://pugixml.googlecode.com/svn/trunk@544 99668b35-9821-0410-8761-19e4c4f06640
2010-06-27 20:05:06 +00:00
arseny.kapoulkine
a562014cc2 Declaration nodes improvements (they now automatically get name "xml", they can't be inserted as a non-document child, document saving prints declaration only if there is none present in the document)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@517 99668b35-9821-0410-8761-19e4c4f06640
2010-06-12 09:04:52 +00:00
arseny.kapoulkine
47c17a25d9 tests: Added C++0x support
git-svn-id: http://pugixml.googlecode.com/svn/trunk@505 99668b35-9821-0410-8761-19e4c4f06640
2010-06-07 16:07:03 +00:00
arseny.kapoulkine
95dd352eca tests: Temporary file name is obtained via mkstemp on Unix systems
git-svn-id: http://pugixml.googlecode.com/svn/trunk@499 99668b35-9821-0410-8761-19e4c4f06640
2010-06-02 17:59:37 +00:00
arseny.kapoulkine
bef9439b01 tests: Fixed test race condition (a better way would be to use argv[0]-relative path, but let's leave it like that till it breaks)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@494 99668b35-9821-0410-8761-19e4c4f06640
2010-06-02 06:37:29 +00:00
arseny.kapoulkine
4878d937d9 tests: Added progressive truncation test
git-svn-id: http://pugixml.googlecode.com/svn/trunk@436 99668b35-9821-0410-8761-19e4c4f06640
2010-05-20 18:06:58 +00:00
arseny.kapoulkine
b47b4905a6 Added more tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@407 99668b35-9821-0410-8761-19e4c4f06640
2010-05-10 17:14:48 +00:00
arseny.kapoulkine
9441757ef6 Internal iterator constructors are now private, added empty document test
git-svn-id: http://pugixml.googlecode.com/svn/trunk@403 99668b35-9821-0410-8761-19e4c4f06640
2010-05-10 13:31:38 +00:00
arseny.kapoulkine
464d0f4ff9 Added empty stream/buffer tests, fixed null buffer parsing in wchar_t mode
git-svn-id: http://pugixml.googlecode.com/svn/trunk@397 99668b35-9821-0410-8761-19e4c4f06640
2010-05-09 17:53:59 +00:00
arseny.kapoulkine
6706a3f8ba Deprecated all wildcard functions and parse_wnorm_attribute
git-svn-id: http://pugixml.googlecode.com/svn/trunk@389 99668b35-9821-0410-8761-19e4c4f06640
2010-05-08 20:30:29 +00:00
arseny.kapoulkine
f542c5ebb8 Integrated changes from unicode branch to trunk
git-svn-id: http://pugixml.googlecode.com/svn/trunk@383 99668b35-9821-0410-8761-19e4c4f06640
2010-05-06 20:28:36 +00:00
arseny.kapoulkine
516e4d63ce unicode: Fixed tests for Linux
git-svn-id: http://pugixml.googlecode.com/svn/trunk@280 99668b35-9821-0410-8761-19e4c4f06640
2010-04-20 20:46:42 +00:00