diff options
Diffstat (limited to 'test/unit/testSplitVector.cxx')
-rw-r--r-- | test/unit/testSplitVector.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/unit/testSplitVector.cxx b/test/unit/testSplitVector.cxx index 8320d5bcb..aa855f1b1 100644 --- a/test/unit/testSplitVector.cxx +++ b/test/unit/testSplitVector.cxx @@ -25,7 +25,7 @@ using namespace Scintilla::Internal; struct StringSetHolder { SplitVector<std::string> sa; - bool Check() { + bool Check() const noexcept { for (int i = 0; i < sa.Length(); i++) { if (sa[i].empty()) { return false; @@ -35,7 +35,7 @@ struct StringSetHolder { } }; -const int lengthTestArray = 4; +constexpr int lengthTestArray = 4; static const int testArray[4] = {3, 4, 5, 6}; TEST_CASE("SplitVector") { @@ -279,7 +279,7 @@ TEST_CASE("SplitVector") { SECTION("ReplaceUp") { // Replace each element by inserting and then deleting the displaced element // This should perform many moves - const int testLength=105; + constexpr int testLength=105; sv.EnsureLength(testLength); for (int i=0; i<testLength; i++) sv.SetValueAt(i, i+2); @@ -295,7 +295,7 @@ TEST_CASE("SplitVector") { SECTION("ReplaceDown") { // From the end, replace each element by inserting and then deleting the displaced element // This should perform many moves - const int testLength=24; + constexpr int testLength=24; sv.EnsureLength(testLength); for (int i=0; i<testLength; i++) sv.SetValueAt(i, i+12); @@ -313,9 +313,9 @@ TEST_CASE("SplitVector") { sv.InsertFromArray(0, testArray, 0, lengthTestArray); sv.Insert(0, 99); // This moves the gap so that BufferPointer() must also move REQUIRE(1 == sv.GapPosition()); - const int lengthAfterInsertion = 1 + lengthTestArray; + constexpr int lengthAfterInsertion = 1 + lengthTestArray; REQUIRE(lengthAfterInsertion == (sv.Length())); - int *retrievePointer = sv.BufferPointer(); + const int *retrievePointer = sv.BufferPointer(); for (int i=1; i<sv.Length(); i++) { REQUIRE((i+3-1) == retrievePointer[i]); } |