From acfe47ba52c6fca355b87d15a462a2e09807f5fe Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 21 Mar 2017 21:47:22 -0700 Subject: tests: Do not use unsigned underflow in test code This triggers a runtime error under integer sanitizer --- tests/test_document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } } -- cgit v1.2.3