Age | Commit message (Collapse) | Author |
|
When using format_raw the space in the empty tag (<node />) is the only
character that does not have to be there; so format_raw almost results in
a minimal XML but not quite.
It's pretty unlikely that this is crucial for any users - the formatting
change should be benign, and it's better to improve format_raw than to add
yet another flag.
Fixes #87.
|
|
|
|
Git warns when it finds "whitespace errors". This commit gets
rid of these whitespace errors for code and adoc files.
|
|
The tests now compile fine but crash on the first floating-point exception
despite our attempts to disable them in main()...
|
|
|
|
|
|
|
|
Also fix test in wchar_t mode.
|
|
|
|
|
|
Previously attributes that were copied with their node used string sharing,
but standalone attributes that were copied using xml_node::*_copy(xml_attribute)
were not.
|
|
|
|
Previously there was no guarantee that the tests that check for out of memory
handling behavior are actually correct - e.g. that they correctly simulate out
of memory conditions.
Now every simulated out of memory condition has to be "guarded" using
CHECK_ALLOC_FAIL. It makes sure that every piece of code that is supposed to
cause out-of-memory does so, and that no other code runs out of memory
unnoticed.
|
|
|
|
This provides more coverage for #17.
|
|
|
|
|
|
Disable/change some tests for some compilers; use binary float comparison
for early MSVC versions.
|
|
|
|
Also include math.h to fix issues on some compilers.
|
|
|
|
We test min/max and several different mantissas for the entire exponent range
for both float and double.
It's not clear whether all supported compilers provide an implementation of
sprintf/strtod that supports roundtripping so we may need to disable some of
these tests in the future.
|
|
These only do basic testing to make sure the paths are covered and trivial
values work.
|
|
|
|
|
|
node_copy_string relied on the fact that target node had an empty name and
value. Normally this is a safe assumption (and a good one to make since it
makes copying faster), however it was not checked and there was one case when
it did not hold.
Since we're reusing the logic for inserting nodes, newly inserted declaration
nodes had the name set automatically to xml, which in our case violates the
assumption and is counter-productive since we'll override the name right after
setting it.
For now the best solution is to do the same insertion manually - that results
in some code duplication that we can refactor later (same logic is partially
shared by _move variants anyway so on a level duplicating is not that bad).
|
|
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.
|
|
Memory allocation behavior is different in compact mode so tests that rely
on current behavior have to be adjusted.
|
|
Calling memcpy(x, 0, 0) is technically undefined (although it should usually
be a no-op).
|
|
A page can fail to allocate during attribute creation; this case was not
previously handled.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1080 99668b35-9821-0410-8761-19e4c4f06640
|
|
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
|
|
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1074 99668b35-9821-0410-8761-19e4c4f06640
|
|
Also fixes PUGIXML_NO_STL compilation and makes it possible to build with
any version of new Windows SDK.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1044 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1040 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1038 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1033 99668b35-9821-0410-8761-19e4c4f06640
|
|
This test has previously caused a stack overflow on x86/MSVC.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1028 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1003 99668b35-9821-0410-8761-19e4c4f06640
|
|
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
|
|
(autodetection is not implemented yet)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@962 99668b35-9821-0410-8761-19e4c4f06640
|
|
msvc6)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@939 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@937 99668b35-9821-0410-8761-19e4c4f06640
|
|
-Wold-style-cast), fixed the code accordingly
git-svn-id: http://pugixml.googlecode.com/svn/trunk@800 99668b35-9821-0410-8761-19e4c4f06640
|
|
elements (with explicit name)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@779 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@769 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@757 99668b35-9821-0410-8761-19e4c4f06640
|
|
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
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@627 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@620 99668b35-9821-0410-8761-19e4c4f06640
|
|
git-svn-id: http://pugixml.googlecode.com/svn/trunk@619 99668b35-9821-0410-8761-19e4c4f06640
|