summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
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
2016-11-09Update version to 1.8 everywhereArseny Kapoulkine
2016-11-06tests: Don't use ranged for loop in move testsArseny Kapoulkine
Some compilers support move semantics but don't support ranged for.
2016-11-06Refactor move semantics support detectionArseny Kapoulkine
Do it in one place and set PUGIXML_HAS_MOVE if it's available.
2016-10-13Add PUGIXML_OVERRIDE to headers of testsPavel Kryukov
2016-07-15tests: Fix clang warningArseny Kapoulkine
2016-07-14tests: Add tests for latin1 detectionArseny Kapoulkine
2016-04-14Remove extra space in an empty tag for format_rawArseny Kapoulkine
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.
2016-02-02tests: Add tests for long settersArseny Kapoulkine
2016-01-24test_parse.cpp: add newline to last lineStephan Beyer
This is necessary in order to comply with the C++03 standard.
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.
2016-01-12tests: Add test for parse_embed_pcdataArseny Kapoulkine
2015-10-25tests: Fix Borland C++ 5.4 compilationArseny Kapoulkine
The tests now compile fine but crash on the first floating-point exception despite our attempts to disable them in main()...
2015-10-17tests: Fix GCC warningArseny Kapoulkine
Fix "this decimal constant is unsigned only in ISO C90".
2015-10-17Fix integer overflow detection with leading zerosArseny Kapoulkine
Since they don't contribute to the resulting value just skip them before parsing. This matches the behavior of strtol/strtoll and results in more intuitive behavior.
2015-10-10tests: Fix version check :)Arseny Kapoulkine
2015-10-09tests: Add a test for empty xpath_query ctorArseny Kapoulkine
2015-10-06tests: Add a copy of header-only testArseny Kapoulkine
This makes sure we get linking errors whenever a symbol is not marked as inline in header-only mode.
2015-09-21Fix parsing of integers that start with +Arseny Kapoulkine
This matches the format strtol supports.
2015-09-20tests: Add tests for integer overflow during conversionArseny Kapoulkine
These tests are only testing attribute as_int in hopes that xml_text uses the same underlying implementation (which it does).
2015-09-19tests: Convert several files to Unix line endingsArseny Kapoulkine
They were still using Windows EOL by mistake
2015-07-25tests: Fix test allocator to provide fundamental alignmentArseny Kapoulkine
Previously test allocator only guaranteed alignment enough for a pointer. On some platforms (e.g. SPARC) double has to be aligned to 8 bytes but pointers can have a size of 4 bytes. This commit increases allocation header to fix that. In practical terms the allocation header is now always 8 bytes.
2015-07-25tests: Only enable page heap on x86/x64Arseny Kapoulkine
This fixes tests in PUGIXML_NO_XPATH mode on SPARC64 (#48). SPARC does not allow unaligned accesses - e.g. you can't read an unaligned int. Normally pugixml does not perform unaligned integer/pointer accesses, but page heap can allocate blocks that are not aligned so that we can detect a single- byte read/write overrun. Additionally, the hardcoded page size we're currently using is really system specific - on SPARC the page size can be 8 Kb instead of 4 Kb so mprotect can fail.
2015-05-22tests: Add newline at the end of fileArseny Kapoulkine
2015-05-22tests: Fix MSVC6 compilationArseny Kapoulkine
2015-05-20tests: Split fp roundtrip test into float and doubleArseny Kapoulkine
2015-05-14Implement xml_node::attribute with a hintArseny Kapoulkine
Extra argument 'hint' is used to start the attribute lookup; if the attribute is not found the lookup is restarted from the beginning of the attriubte list. This allows to optimize attribute lookups if you need to get many attributes from the node and can make assumptions about the likely ordering. The code is correct regardless of the order, but it is faster than using vanilla lookups if the order matches the calling order. Fixes #30.
2015-05-12tests: Fix address sanitizer detection for GCCArseny Kapoulkine
2015-05-12Add Visual Studio 2015 to AppVeyorArseny Kapoulkine
2015-05-12tests: Disable page allocator if address sanitizer is activeArseny Kapoulkine
Address sanitizer can detect underflows so we don't really need the custom allocator. Additionally, custom allocator can return memory that is not pointer-aligned; this causes undefined behavior sanitizer to complain.
2015-05-12tests: Fix clang 3.7 warningArseny Kapoulkine
Work around -Wself-move using ref-deref.
2015-05-03tests: Fix MSVC6 compatibilityArseny Kapoulkine
Apply the usual workaround for for scoping issues. Also fix integer conversion warning for BorlandC.
2015-05-02tests: Add one more page reclamation testArseny Kapoulkine
2015-04-29tests: Fix spurious failures in compact modeArseny Kapoulkine
The memory_large_allocations test sometimes classified hash allocations as page allocations since hash table could reach 512 entries.
2015-04-22Fix node_pi memory leakArseny Kapoulkine
2015-04-21tests: Adjust allocation thresholds to fix testsArseny Kapoulkine
2015-04-21Merge branch 'master' into compactArseny Kapoulkine
2015-04-21tests: Fix MSVC warningsArseny Kapoulkine
2015-04-21tests: Add move semantics testsArseny Kapoulkine
Also test ranged for and copying big xpath_variable_set objects (to make sure we actually handle hash collisions properly)
2015-04-15Implement copy ctor/assignment for xpath_variable_setArseny Kapoulkine
xpath_variable_set is essentially an associative container; it's about time it became copyable. Implementation is slightly tricky due to out of memory handling. Both copy ctor and assignment operator have strong exception guarantee (even if exceptions are disabled! which translates to "roll back on allocation errors").