aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/unit/testDocument.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2024-01-02 10:08:16 +1100
committerNeil <nyamatongwe@gmail.com>2024-01-02 10:08:16 +1100
commitec0e53dc6711aeb827eccd65b6f0779aa841aad2 (patch)
tree4cba13cd182aac11f6240cd8520e5b46a0d329bf /test/unit/testDocument.cxx
parentdac59d7a985cd4b42096848c02dcc26b55165493 (diff)
downloadscintilla-mirror-ec0e53dc6711aeb827eccd65b6f0779aa841aad2.tar.gz
Fix warnings in test case code mostly by adding const.
Diffstat (limited to 'test/unit/testDocument.cxx')
-rw-r--r--test/unit/testDocument.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/unit/testDocument.cxx b/test/unit/testDocument.cxx
index ab65130e3..147614637 100644
--- a/test/unit/testDocument.cxx
+++ b/test/unit/testDocument.cxx
@@ -273,7 +273,7 @@ TEST_CASE("Document") {
DocPlus doc("_abcdef", 0); // _ a b c d e f
constexpr std::string_view finding = "cd";
Sci::Position lengthFinding = finding.length();
- size_t docLength = doc.document.Length() - 1;
+ const size_t docLength = doc.document.Length() - 1;
Sci::Position location = doc.document.FindText(1, docLength, finding.data(), FindOption::MatchCase, &lengthFinding);
REQUIRE(location == 3);
location = doc.document.FindText(docLength, 1, finding.data(), FindOption::MatchCase, &lengthFinding);
@@ -840,7 +840,7 @@ TEST_CASE("SafeSegment") {
const DocPlus doc("", 0);
// all encoding: break before or after last space
constexpr std::string_view text = "12 ";
- size_t length = doc.document.SafeSegment(text);
+ const size_t length = doc.document.SafeSegment(text);
REQUIRE(length <= text.length());
REQUIRE(text[length - 1] == '2');
REQUIRE(text[length] == ' ');