aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/unit/testSplitVector.cxx
diff options
context:
space:
mode:
authorZufu Liu <unknown>2021-06-21 13:35:09 +1000
committerZufu Liu <unknown>2021-06-21 13:35:09 +1000
commit6de6577e1c9f8fad2852abb3b850f563fb7a04c6 (patch)
tree1d1a35fb028ad5a304afd9447311c60b3ba3f920 /test/unit/testSplitVector.cxx
parent5b3faa208ea29e45c6d845760bb902c3a9f057da (diff)
downloadscintilla-mirror-6de6577e1c9f8fad2852abb3b850f563fb7a04c6.tar.gz
Fix some warnings in unit tests.rel-5-1-0
Diffstat (limited to 'test/unit/testSplitVector.cxx')
-rw-r--r--test/unit/testSplitVector.cxx12
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]);
}