summaryrefslogtreecommitdiff
path: root/tests/test_xpath.cpp
AgeCommit message (Collapse)Author
2017-06-22tests: Make using namespace more explicitArseny Kapoulkine
Hiding using namespace in common.hpp is somewhat surprising so remove common.hpp and move using namespace into all .cpp files that need it.
2017-06-22tests: Remove redundant pugi:: qualifierArseny Kapoulkine
Most tests have `using namespace pugi` which makes explicit qualifications unnecessary.
2017-06-16tests: Improve XPath coverageArseny Kapoulkine
Add memory allocation failure test for concact with a very large list and make sure we have every single axis covered with and without a predicate, with and without a previous step.
2017-02-08tests: Increase the number of translate callsArseny Kapoulkine
This should make the test fail on a 32-bit target.
2017-02-08tests: Fix clang buildArseny Kapoulkine
2017-02-08tests: Add more XPath out of memory testsArseny Kapoulkine
2017-02-05tests: Add more XPath sorting testsArseny Kapoulkine
Cover empty node case - no XPath query can result in that but it's possible to create a node set with empty nodes manually.
2017-02-02tests: Add more out of memory tests for XPath evaluationArseny Kapoulkine
2017-01-30tests: Add more coverage testsArseny Kapoulkine
Expand out of memory coverage during XPath parsing and evaluation and add some other small tests.
2017-01-30tests: Make predicate out-of-memory test less aggressiveArseny Kapoulkine
Currently this test has very large runtime and relies on the fact that the first memory allocation error causes the test to terminate. This does not work with new behavior of running the query through and reporting the error at the end, so make the runtime reasonable but still generate enough memory to blow past the budget.
2017-01-30tests: Add more tests for branch coverageArseny Kapoulkine
gcov -b surfaced many lines with partial coverage, where branch is only ever taken or not taken, or one of the expressions in a complex conditional is always either true or false. This change adds a series of tests (mostly focusing on XPath) to reduce the number of partially covered lines.
2016-01-24Fix whitespace issuesStephan Beyer
Git warns when it finds "whitespace errors". This commit gets rid of these whitespace errors for code and adoc files.
2015-04-11tests: Improve out-of-memory testsArseny Kapoulkine
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.
2014-11-19tests: Fix tests on various compilersArseny Kapoulkine
Some compilers don't handle NaNs properly. Some compilers don't implement fmod in a IEEE-compatible way. Some compilers have exception handling codegen bugs (DMC...).
2014-11-17Rename xml_document::load to load_stringArseny Kapoulkine
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-10-24tests: Add even more coverage testsArseny Kapoulkine
Also fix MSVC6 compilation (make convertions to function pointers explicit). git-svn-id: https://pugixml.googlecode.com/svn/trunk@1076 99668b35-9821-0410-8761-19e4c4f06640
2014-10-23tests: Add more tests for better coverageArseny Kapoulkine
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-20XPath: Introduce _first/_any set evaluation modesArseny Kapoulkine
Sometimes when evaluating the node set we don't need the entire set and only need the first element in docorder or any element. In the absence of iterator support we can still use this information to short-circuit traversals. This does not have any effect on straightforward node collection queries, but frequently improves performance of complex queries with predicates etc. XMark benchmark gets 15x faster with some queries enjoying 100x speedup on 10 Mb dataset due to a significant complexity improvement. git-svn-id: https://pugixml.googlecode.com/svn/trunk@1067 99668b35-9821-0410-8761-19e4c4f06640
2014-10-05tests: Add XPath sorting tests and a simple test for numeric predicatesArseny Kapoulkine
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1051 99668b35-9821-0410-8761-19e4c4f06640
2014-10-01tests: Add XPath sorting tests for move/append_bufferArseny Kapoulkine
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1035 99668b35-9821-0410-8761-19e4c4f06640
2014-10-01tests: Add tests for copyless copy and related potential bugsArseny Kapoulkine
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1033 99668b35-9821-0410-8761-19e4c4f06640
2014-09-23tests: More XPath testsArseny Kapoulkine
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1020 99668b35-9821-0410-8761-19e4c4f06640
2014-06-01Improve XPath allocator performanceArseny Kapoulkine
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
2013-03-20Fix invalid assertion in XPath: reallocation can result in allocating buffer ↵arseny.kapoulkine@gmail.com
of the same size due to pointer-sized alignment git-svn-id: http://pugixml.googlecode.com/svn/trunk@946 99668b35-9821-0410-8761-19e4c4f06640
2012-11-17XPath: Fix unit test that (incorrectly) relied on right-associativity of ↵arseny.kapoulkine@gmail.com
union operator to trigger out of memory condition git-svn-id: http://pugixml.googlecode.com/svn/trunk@930 99668b35-9821-0410-8761-19e4c4f06640
2010-12-19Enabled many additional GCC warnings (most notably -Wshadow and ↵arseny.kapoulkine
-Wold-style-cast), fixed the code accordingly git-svn-id: http://pugixml.googlecode.com/svn/trunk@800 99668b35-9821-0410-8761-19e4c4f06640
2010-09-14tests: Fixed MSVC 6/7 compilation errorarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@731 99668b35-9821-0410-8761-19e4c4f06640
2010-09-14tests: Improved XPath sort coveragearseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@730 99668b35-9821-0410-8761-19e4c4f06640
2010-09-14tests: Added XPath out of memory testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@728 99668b35-9821-0410-8761-19e4c4f06640
2010-09-13tests: Fixed wchar mode testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@723 99668b35-9821-0410-8761-19e4c4f06640
2010-09-13tests: Added XPath test for large node setsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@721 99668b35-9821-0410-8761-19e4c4f06640
2010-08-29tests: Improved document_order() coveragearseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@693 99668b35-9821-0410-8761-19e4c4f06640
2010-08-29tests: Added new evaluate_string tests, fixed tests for NO_STL modearseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@661 99668b35-9821-0410-8761-19e4c4f06640
2010-08-29tests: Removed redundant includesarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@642 99668b35-9821-0410-8761-19e4c4f06640
2010-08-04tests: Added more XPath testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@628 99668b35-9821-0410-8761-19e4c4f06640
2010-08-02tests: More miscellaneous testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@619 99668b35-9821-0410-8761-19e4c4f06640
2010-07-22tests: Miscellaneous test fixesarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@618 99668b35-9821-0410-8761-19e4c4f06640
2010-07-22tests: Removed invalid document order test, improved document order coverage ↵arseny.kapoulkine
by adding tests that are not subject to document order optimization git-svn-id: http://pugixml.googlecode.com/svn/trunk@615 99668b35-9821-0410-8761-19e4c4f06640
2010-07-19Set svn:eol-style to native for all text filesarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@607 99668b35-9821-0410-8761-19e4c4f06640
2010-06-14XPath: Rewritten number->string conversion using CRT scientific format (much ↵arseny.kapoulkine
better XPath REC compliance) git-svn-id: http://pugixml.googlecode.com/svn/trunk@523 99668b35-9821-0410-8761-19e4c4f06640
2010-05-29tests: Fixed tests for wchar_t mode, disabled some tests on compilers with ↵arseny.kapoulkine
broken NaN behavior git-svn-id: http://pugixml.googlecode.com/svn/trunk@463 99668b35-9821-0410-8761-19e4c4f06640
2010-05-29tests: Added more XPath testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@458 99668b35-9821-0410-8761-19e4c4f06640
2010-05-09Removed document order optimization (it helps on a tiny percentage of ↵arseny.kapoulkine
queries), XPath tests now compute their own order git-svn-id: http://pugixml.googlecode.com/svn/trunk@400 99668b35-9821-0410-8761-19e4c4f06640
2010-05-06Integrated changes from unicode branch to trunkarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@383 99668b35-9821-0410-8761-19e4c4f06640
2009-11-08tests: More coverage testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@225 99668b35-9821-0410-8761-19e4c4f06640
2009-11-04tests: Reduced stack pressure for one of tests (CW/IC8 can't handle it)arseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@207 99668b35-9821-0410-8761-19e4c4f06640
2009-11-04tests: Added allocator coverage testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@206 99668b35-9821-0410-8761-19e4c4f06640
2009-10-29tests: Supported all pugixml compilation modesarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@191 99668b35-9821-0410-8761-19e4c4f06640
2009-10-11tests: Added more node/attribute testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@142 99668b35-9821-0410-8761-19e4c4f06640