diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-03-21 21:47:22 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-03-21 21:47:22 -0700 |
commit | acfe47ba52c6fca355b87d15a462a2e09807f5fe (patch) | |
tree | 92f8293683e34cda0eeab6ceb7b4aec65baa2be4 /tests | |
parent | c29940ca72ef114880317061d054ab97ffb87639 (diff) |
tests: Do not use unsigned underflow in test code
This triggers a runtime error under integer sanitizer
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_document.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_document.cpp b/tests/test_document.cpp index 95bd873..9860737 100644 --- a/tests/test_document.cpp +++ b/tests/test_document.cpp @@ -1101,7 +1101,7 @@ TEST(document_progressive_truncation) bool result = doc.load_buffer_inplace(truncated_data, i, parse_default | parse_fragment); // some truncate locations are parseable - those that come after declaration, declaration + doctype, declaration + doctype + comment and eof - CHECK(((i - 21) < 3 || (i - 66) < 3 || (i - 95) < 3 || i == original_size) ? result : !result); + CHECK(((i >= 21 && i <= 23) || (i >= 66 && i <= 68) || (i >= 95 && i <= 97) || i == original_size) ? result : !result); } } |