summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-03-21 21:47:22 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-03-21 21:47:22 -0700
commitacfe47ba52c6fca355b87d15a462a2e09807f5fe (patch)
tree92f8293683e34cda0eeab6ceb7b4aec65baa2be4
parentc29940ca72ef114880317061d054ab97ffb87639 (diff)
tests: Do not use unsigned underflow in test code
This triggers a runtime error under integer sanitizer
-rw-r--r--tests/test_document.cpp2
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);
}
}