Commit Graph

841 Commits

Author SHA1 Message Date
Lee Thomason 949ae37e0a Merge pull request #337 from Dmitry-Me/checkEntityFoundExplicitly
Explicitly check entity was not found
2015-05-22 11:08:31 -07:00
Lee Thomason 03d0f4ea25 Merge branch 'SirR4T-assert-fires-when-calling-XMLDocument--Value' 2015-05-22 11:07:58 -07:00
Lee Thomason 8549202800 clean up Value of XMLDocument 2015-05-22 11:07:45 -07:00
Lee Thomason c52aa55a86 Merge branch 'SirR4T-patch-1' 2015-05-22 11:00:59 -07:00
Lee Thomason 7a93b33160 tighten up the error checks 2015-05-22 11:00:32 -07:00
Lee Thomason 2ecc203835 Merge branch 'patch-1' of https://github.com/SirR4T/tinyxml2 into SirR4T-patch-1 2015-05-22 10:57:00 -07:00
Dmitry-Me 5420e547d3 Get rid of two distinct enum items with same same 2015-05-20 10:51:26 +03:00
Dmitry-Me 764545e02a Explicitly check entity was not found 2015-05-20 10:29:24 +03:00
Sarat Addepalli 3df007ef9d Fix and use correct pointers and types.
Should have been `XMLDeclaration* decl = ...` instead of `XMLElement* ele = ...`
2015-05-20 10:43:51 +05:30
Sarat Addepalli 96b4346660 Remove unnecessary cast in XMLNode::Value() 2015-05-20 10:36:06 +05:30
Sarat Addepalli d608c561e0 Fix up xmltest.cpp
Fixed coding style in XMLTest(), and removed unused variable in testcase.
2015-05-20 10:19:00 +05:30
Lee Thomason ff53d7172c Merge pull request #335 from SirR4T/SirR4T-add-DEBUG-macro-in-CMakeLists_txt
Define the `DEBUG` macro in CMakeLists.txt
2015-05-19 09:37:33 -07:00
Lee Thomason 1bf04fd755 Merge pull request #330 from Dmitry-Me/avoidUnneededPrinterCreation
Avoid unneeded printer object creation
2015-05-19 09:31:41 -07:00
Sarat Addepalli 9afd1d0ceb Clarify meaning of 'empty'
When `XMLDocument::Value()` is called, we intend to return NULL (`( const char* )0`). State that explicitly in the documentation, so as to disambiguate between "empty string" (`""`) and NULL.
2015-05-19 12:56:27 +05:30
Sarat Addepalli 9c3122b89b Bypass asserts for `XMLDocument::Value()`
When the node is an XMLDocument, bypass calling the `_value.GetStr()` function, since we know we have to return `( const char* )0` inevitably.

This fixes #323
2015-05-19 12:49:32 +05:30
Sarat Addepalli 13b2d73427 Add null-checks in `XMLTest()`
When either `expected` or `found` is `NULL`, `XMLTest()` will segfault on `strcmp()`.
This patch adds null-checks, and passes the test if both `expected` and `found` are `NULL`.
2015-05-19 12:44:57 +05:30
Sarat Addepalli a7edb883f0 Add a test case for issue #323
When compiled in "debug mode", this test case verifies that an assert is fired, when `XMLDocument::Value()` is called.
2015-05-19 12:39:27 +05:30
Sarat Addepalli 39a77dd825 Define the `DEBUG` macro in CMakeLists.txt
Fixes #334
2015-05-19 12:27:59 +05:30
Sarat Addepalli 8e85afa406 Fix whitespaces in xmltest.cpp 2015-05-19 09:07:03 +05:30
Sarat Addepalli 2f0d173f94 Fix whitespaces in tinyxml2.cpp 2015-05-19 09:02:16 +05:30
Sarat Addepalli a0f499dda1 Fix ParseDeep() to close issue #332
If the node to be added is an XML Declaration, then check if the document has any children already.
XML Declarations can only be the FirstChild() s of an XML Document.
2015-05-18 09:25:17 +05:30
Sarat Addepalli 2bb6bb5bee Add a test case for issue #332
XML Declarations can occur only at the beginning of an XML Document.
Parse() should throw an error, for not well-formed XML Documents.
2015-05-18 09:16:34 +05:30
Dmitry-Me 67c429e4b4 Avoid unneeded printer object creation 2015-05-08 18:08:18 +03:00
Lee Thomason e5e5541af6 Merge pull request #328 from Dmitry-Me/firstCheckThenConvert
First check, then convert
2015-05-07 13:54:31 -07:00
Dmitry-Me 72801b8b20 First check, then convert 2015-05-07 09:41:39 +03:00
Lee Thomason 89df56c046 Merge pull request #327 from Dmitry-Me/ensureFileSizeFitsInSizeT
Ensure file contents fit into size_t range
2015-05-06 16:40:01 -07:00
Dmitry-Me 2a8b1f5789 Ensure file contents fit into size_t range 2015-04-30 14:58:57 +03:00
Lee Thomason 882e89e601 Merge pull request #326 from Dmitry-Me/cleanupPointersComparison
Unify pointers comparison, consistency asserts
2015-04-27 16:57:37 -07:00
Lee Thomason a295da4302 Merge pull request #324 from Dmitry-Me/checkWithoutClangTautological
Range check without clang "always true" warning
2015-04-27 16:56:24 -07:00
Dmitry-Me 69d521d354 Unify pointers comparison, consistency asserts 2015-04-20 18:05:53 +03:00
Dmitry-Me 2ad4320339 Range check without clang "always true" warning 2015-04-16 12:18:58 +03:00
Lee Thomason 4f0c2ffcab fix 'always true' warning 2015-04-13 13:58:20 -07:00
Lee Thomason 70f2c740c0 Merge pull request #322 from Dmitry-Me/detectParsingErrorEarlier
Detect parsing error earlier when looking at end of tag
2015-04-13 13:43:07 -07:00
Dmitry-Me ccd267a782 Detect parsing error earlier when looking at end of tag 2015-04-10 15:42:54 +03:00
Lee Thomason 9f24acd369 Merge pull request #321 from Dmitry-Me/dontLeakTheElement
Don't leak the element
2015-04-09 14:49:59 -07:00
Lee Thomason e3932d6b7f Merge pull request #319 from Dmitry-Me/getRidOfNull
Get rid of NULL, cleanup formatting
2015-04-09 14:49:25 -07:00
Lee Thomason 5ea4f3cb77 Merge pull request #315 from Dmitry-Me/orderPatternsAsTheyAreSearched
Order patterns the same way they are searched
2015-04-09 14:48:44 -07:00
Lee Thomason 2d39158eaa Merge pull request #317 from Dmitry-Me/moreConsistencyAsserts
More consistency asserts
2015-04-09 14:48:18 -07:00
Dmitry-Me 5daa54cf2b Don't leak the element 2015-04-08 17:45:07 +03:00
Dmitry-Me e76b8519d1 Get rid of NULL, cleanup formatting 2015-04-08 13:41:40 +03:00
Dmitry-Me 9614f8ff74 More consistency asserts 2015-04-08 10:06:06 +03:00
Lee Thomason 4a0392dd9d Merge pull request #314 from Dmitry-Me/ensureEnumIsPrintedProperly
Ensure enum is printed properly
2015-04-07 09:55:18 -07:00
Lee Thomason 0aa957a352 Merge pull request #313 from Dmitry-Me/shouldBeNoErrorInitially
Test there's no error initially, proper swap "found" and "expected"
2015-04-07 09:53:24 -07:00
Dmitry-Me 400f1199ea Ensure enum is printed properly 2015-04-07 11:51:21 +03:00
Dmitry-Me 32533ca9c2 Test there's no error initially, proper swap "found" and "expected" 2015-04-07 10:37:39 +03:00
Lee Thomason a1a4a13825 Merge pull request #312 from Dmitry-Me/newDocumentMustBeEmpty
Document must be initially empty
2015-04-06 14:26:23 -07:00
Lee Thomason 4034395d1a Merge pull request #311 from Dmitry-Me/betterParameterName
Better parameter name
2015-04-06 14:25:57 -07:00
Lee Thomason 2a2ed16ce1 Merge pull request #310 from Dmitry-Me/moreConst
Const qualifiers where access is const, unify formatting
2015-04-06 14:25:37 -07:00
Lee Thomason 1881344cb6 Merge pull request #309 from Dmitry-Me/makeParseDeepProtected
Make ParseDeep() protected
2015-04-06 14:25:00 -07:00
Dmitry-Me 48b5df0b9b Document must be initially empty 2015-04-06 18:20:25 +03:00