summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2017-06-22tests: Add more XPath out of memory testsArseny Kapoulkine
This fixes missing coverage in translate_table_generate and xpath_node_set_raw::append.
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-22Deprecate xml_document::load(const char*) and xml_node::select_single_nodeArseny Kapoulkine
These functions were deprecated via comments in 1.5 but never got the deprecated attribute; now is the time! Using deprecated functions produces a warning; to silence it, this change moves the relevant tests to a separate translation unit that has deprecation disabled.
2017-06-18Add VS2017 to AppVeyor test runArseny Kapoulkine
This requires moving the list of VS versions out of autotest-appveyor.ps1 and into appveyor.yml.
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-06-16tests: Add even more stream coverage testsArseny Kapoulkine
Apparently only narrow character streams had out of memory coverage - fix that and also split this into a separate test.
2017-06-16tests: Add more stream coverage testsArseny Kapoulkine
Cover both char and wchar_t stream loading in a single run instead of using pugi::char_t.
2017-06-16tests: Add more coverage tests for stream loadingArseny Kapoulkine
Cover more failure cases and simplify the streambuf implementation a bit.
2017-06-16Fix BorlandC compilationArseny Kapoulkine
Rename partition to partition3 to resolve conflicts with std::partition.
2017-06-16tests: Improve XPath test coverageArseny Kapoulkine
Add more memory allocation failure tests.
2017-06-16tests: Expand write_flush coverageArseny Kapoulkine
Adjust the buffer size to be right on the edge of the overflow, make sure we actually output " instead of ".
2017-06-15tests: Add xml_buffered_writer coverage testArseny Kapoulkine
This test triggers flush() condition for each optimized write() method.
2017-06-15tests: Add tests for loading special filesArseny Kapoulkine
New tests try to load a folder as an XML document, and a device. Both are intended to exercise some otherwise non-hittable error paths in load_file implementation.
2017-06-14tests: Increase compact_pointer coverageArseny Kapoulkine
This adds tests that complete branch coverage in compact pointer encoding/decoding code (previously first_attribute was always encoded using compact encoding in the entire test suite).
2017-04-03Move libFuzzer build to MakefileArseny Kapoulkine
Now the only thing fuzz_setup.sh does is installing new clang; if system clang supports -fsanitize-coverage then fuzz_setup.sh is not required.
2017-04-03tests: Fix fuzz_setup.shArseny Kapoulkine
The script only worked if clang folder was already created.
2017-03-21tests: Do not use unsigned underflow in test codeArseny Kapoulkine
This triggers a runtime error under integer sanitizer
2017-03-21tests: Fix invalid buffer sizeArseny Kapoulkine
This was triggering an buffer read overflow with asan.
2017-02-11tests: Fix fuzz_setup.shArseny Kapoulkine
Make the file executable, fix Windows newlines and fix clang setup.
2017-02-11tests: Add fuzzing dictionariesArseny Kapoulkine
Hopefully this will allow for better fuzzing coverage
2017-02-09tests: Add XPath fuzzingArseny Kapoulkine
Only fuzz the parser for now.
2017-02-09tests: Add a script to set up fuzzing toolsArseny Kapoulkine
This downloads a clang build that has support for instrumentation, and also downloads and compiles libFuzzer.a.
2017-02-09fuzz: Use libFuzzer instead of afl-fuzzArseny Kapoulkine
This allows us to have faster fuzz cycles since the fuzzer is in-process.
2017-02-09tests: Increase the number of translate callsArseny Kapoulkine
This should make the test fail on a 32-bit target.
2017-02-09tests: Fix clang buildArseny Kapoulkine
2017-02-09tests: 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-02-02tests: Add more embed_pcdata testsArseny Kapoulkine
2017-02-01tests: Improve parsing coverageArseny Kapoulkine
Add tests for PI erroring exactly at the buffer boundary with non-zero-terminated buffers (so we have to clear the last character which changes the parsing flow slightly) and a test that makes sure parse_embed_pcdata works properly with XML fragments where PCDATA can be at the root level but can't be embedded into the document node.
2017-02-01tests: Remove redundant coverage testArseny Kapoulkine
The only point was to try to test all paths where we can run out of memory while decoding something. It seems like it may be impossible to actually do this given that we can't run all paths as wchar_t size detection is done at runtime...
2017-01-31tests: Add more tests to increase coverageArseny Kapoulkine
This change adds more thorough tests for attribute conversion as well as some assorted tests that fix gaps in coverage.
2017-01-31tests: Add compact hash table reserve testArseny Kapoulkine
This makes sure all .reserve calls failure paths are covered. These tests don't explicitly test if reserve is present on all paths - this is much harder to test since not all modifications require reserve to be called, so we'll have to rely on a combination of automated testing and sanity checking for this. Also add more parsing out of memory coverage tests.
2017-01-31tests: Add coverage tests for encoding detectionArseny Kapoulkine
Enumerate successfull cases and also cases where the detection stops half-way and results in a different detected encoding.
2017-01-31tests: More XPath coverage testsArseny Kapoulkine
2017-01-31tests: Add more DOM coverage testsArseny Kapoulkine
Add tests for various corner cases of DOM inspection and modification routines.
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.
2017-01-30tests: Add an error propagation test for XPathArseny Kapoulkine
This test is supposed to test error coverage in different expressions that are nested in other expressions to reduce the number of never-taken branches in tests (and make sure we aren't missing any).
2017-01-29tests: Add query out of memory testArseny Kapoulkine
2016-11-27scripts: Move archive.py from testsArseny Kapoulkine
2016-11-27Fix archive script to set timestamps properly for .tar.gzv1.8.1Arseny Kapoulkine
By default they are set to Jan 1 1970 which breaks homebrew. Fixes #124.
2016-11-19tests: Fix unused variable warning in some compilersArseny Kapoulkine
The variable is being assigned to but never read when exceptions are disabled.
2016-11-13Change status_end_element_mismatch to point to closing tag nameArseny Kapoulkine
Previously the error offset pointed to the first mismatching character, which can be confusing especially if the start tag name is a prefix of the end tag name. Instead, move the offset to the first character of the name - that way it should be more obvious that the problem is that the entire name mismatches. Fixes #112.
2016-11-13Rewrite archive script into PythonArseny Kapoulkine
Perl version needed Archive::Zip that for some reason is not installed on WSL by default. Use this as an opportunity to remove the last Perl script.
2016-11-09tests: Fix MSVC warningsArseny Kapoulkine
2016-11-09tests: Add a generalized write-roundtrip testArseny Kapoulkine
This test tests two important invariants: - Every combination of write flags has to result in a valid document - Parsing that document and saving the result has to result in identical output We don't test all flags since parse_no_escapes can intentionally result in malformed documents and other flags aren't relevant for node output. Also note that we test both no-whitespace and whitespace version to make sure we don't have unnecessary whitespace added during formatting.
2016-11-09tests: Add a test for format_no_empty_element_tagsArseny Kapoulkine