aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--test/unit/testCellBuffer.cxx14
-rw-r--r--test/unit/testContractionState.cxx18
-rw-r--r--test/unit/testRunStyles.cxx12
-rw-r--r--test/unit/testSparseState.cxx10
4 files changed, 27 insertions, 27 deletions
diff --git a/test/unit/testCellBuffer.cxx b/test/unit/testCellBuffer.cxx
index 86ab3a59c..7a13e88b8 100644
--- a/test/unit/testCellBuffer.cxx
+++ b/test/unit/testCellBuffer.cxx
@@ -25,7 +25,7 @@ TEST_CASE("CellBuffer") {
SECTION("InsertOneLine") {
bool startSequence = false;
- const char *cpChange = cb.InsertString(0, sText, sLength, startSequence);
+ const char *cpChange = cb.InsertString(0, sText, static_cast<int>(sLength), startSequence);
REQUIRE(startSequence);
REQUIRE(sLength == cb.Length());
REQUIRE(memcmp(cpChange, sText, sLength) == 0);
@@ -33,7 +33,7 @@ TEST_CASE("CellBuffer") {
REQUIRE(0 == cb.LineStart(0));
REQUIRE(0 == cb.LineFromPosition(0));
REQUIRE(sLength == cb.LineStart(1));
- REQUIRE(0 == cb.LineFromPosition(sLength));
+ REQUIRE(0 == cb.LineFromPosition(static_cast<int>(sLength)));
REQUIRE(cb.CanUndo());
REQUIRE(!cb.CanRedo());
}
@@ -42,7 +42,7 @@ TEST_CASE("CellBuffer") {
const char sText2[] = "Two\nLines";
const size_t sLength2 = strlen(sText2);
bool startSequence = false;
- const char *cpChange = cb.InsertString(0, sText2, sLength2, startSequence);
+ const char *cpChange = cb.InsertString(0, sText2, static_cast<int>(sLength), startSequence);
REQUIRE(startSequence);
REQUIRE(sLength2 == cb.Length());
REQUIRE(memcmp(cpChange, sText2, sLength2) == 0);
@@ -52,7 +52,7 @@ TEST_CASE("CellBuffer") {
REQUIRE(4 == cb.LineStart(1));
REQUIRE(1 == cb.LineFromPosition(5));
REQUIRE(sLength2 == cb.LineStart(2));
- REQUIRE(1 == cb.LineFromPosition(sLength2));
+ REQUIRE(1 == cb.LineFromPosition(static_cast<int>(sLength)));
REQUIRE(cb.CanUndo());
REQUIRE(!cb.CanRedo());
}
@@ -62,7 +62,7 @@ TEST_CASE("CellBuffer") {
cb.SetUndoCollection(false);
REQUIRE(!cb.IsCollectingUndo());
bool startSequence = false;
- const char *cpChange = cb.InsertString(0, sText, sLength, startSequence);
+ const char *cpChange = cb.InsertString(0, sText, static_cast<int>(sLength), startSequence);
REQUIRE(!startSequence);
REQUIRE(sLength == cb.Length());
REQUIRE(memcmp(cpChange, sText, sLength) == 0);
@@ -74,7 +74,7 @@ TEST_CASE("CellBuffer") {
const char sTextDeleted[] = "ci";
const char sTextAfterDeletion[] = "Sntilla";
bool startSequence = false;
- const char *cpChange = cb.InsertString(0, sText, sLength, startSequence);
+ const char *cpChange = cb.InsertString(0, sText, static_cast<int>(sLength), startSequence);
REQUIRE(startSequence);
REQUIRE(sLength == cb.Length());
REQUIRE(memcmp(cpChange, sText, sLength) == 0);
@@ -134,7 +134,7 @@ TEST_CASE("CellBuffer") {
cb.SetReadOnly(true);
REQUIRE(cb.IsReadOnly());
bool startSequence = false;
- cb.InsertString(0, sText, sLength, startSequence);
+ cb.InsertString(0, sText, static_cast<int>(sLength), startSequence);
REQUIRE(cb.Length() == 0);
}
diff --git a/test/unit/testContractionState.cxx b/test/unit/testContractionState.cxx
index 58466426d..2bf4854c3 100644
--- a/test/unit/testContractionState.cxx
+++ b/test/unit/testContractionState.cxx
@@ -67,10 +67,10 @@ TEST_CASE("ContractionState") {
cs.SetVisible(1, 1, false);
REQUIRE(true == cs.GetVisible(0));
- REQUIRE(0 == cs.GetVisible(1));
+ REQUIRE(false == cs.GetVisible(1));
REQUIRE(true == cs.GetVisible(2));
REQUIRE(4 == cs.LinesDisplayed());
- REQUIRE(1 == cs.HiddenLines());
+ REQUIRE(true == cs.HiddenLines());
cs.SetVisible(1, 2, true);
for (int l=0;l<4;l++) {
@@ -78,12 +78,12 @@ TEST_CASE("ContractionState") {
}
cs.SetVisible(1, 1, false);
- REQUIRE(0 == cs.GetVisible(1));
+ REQUIRE(false == cs.GetVisible(1));
cs.ShowAll();
for (int l=0;l<4;l++) {
REQUIRE(true == cs.GetVisible(0));
}
- REQUIRE(0 == cs.HiddenLines());
+ REQUIRE(false == cs.HiddenLines());
}
SECTION("Hidden") {
@@ -91,18 +91,18 @@ TEST_CASE("ContractionState") {
for (int l=0;l<2;l++) {
REQUIRE(true == cs.GetVisible(0));
}
- REQUIRE(0 == cs.HiddenLines());
+ REQUIRE(false == cs.HiddenLines());
cs.SetVisible(1, 1, false);
REQUIRE(true == cs.GetVisible(0));
- REQUIRE(0 == cs.GetVisible(1));
- REQUIRE(1 == cs.HiddenLines());
+ REQUIRE(false == cs.GetVisible(1));
+ REQUIRE(true == cs.HiddenLines());
cs.SetVisible(1, 1, true);
for (int l=0;l<2;l++) {
REQUIRE(true == cs.GetVisible(0));
}
- REQUIRE(0 == cs.HiddenLines());
+ REQUIRE(false == cs.HiddenLines());
}
SECTION("Contracting") {
@@ -113,7 +113,7 @@ TEST_CASE("ContractionState") {
cs.SetExpanded(2, false);
REQUIRE(true == cs.GetExpanded(1));
- REQUIRE(0 == cs.GetExpanded(2));
+ REQUIRE(false == cs.GetExpanded(2));
REQUIRE(true == cs.GetExpanded(3));
REQUIRE(2 == cs.ContractedNext(0));
diff --git a/test/unit/testRunStyles.cxx b/test/unit/testRunStyles.cxx
index 250b5c044..09a5b1cae 100644
--- a/test/unit/testRunStyles.cxx
+++ b/test/unit/testRunStyles.cxx
@@ -116,7 +116,7 @@ TEST_CASE("RunStyles") {
int startFill2 = 2;
int lengthFill2 = 1;
// Compiler warnings if 'false' used instead of '0' as expected value:
- REQUIRE(0 == rs.FillRange(startFill2, 99, lengthFill2));
+ REQUIRE(false == rs.FillRange(startFill2, 99, lengthFill2));
REQUIRE(2 == startFill2);
REQUIRE(1 == lengthFill2);
REQUIRE(0 == rs.ValueAt(0));
@@ -202,17 +202,17 @@ TEST_CASE("RunStyles") {
REQUIRE(true == rs.AllSame());
rs.InsertSpace(0, 5);
REQUIRE(true == rs.AllSame());
- REQUIRE(0 == rs.AllSameAs(88));
+ REQUIRE(false == rs.AllSameAs(88));
REQUIRE(true == rs.AllSameAs(0));
int startFill = 1;
int lengthFill = 3;
REQUIRE(true == rs.FillRange(startFill, 99, lengthFill));
- REQUIRE(0 == rs.AllSame());
- REQUIRE(0 == rs.AllSameAs(88));
- REQUIRE(0 == rs.AllSameAs(0));
+ REQUIRE(false == rs.AllSame());
+ REQUIRE(false == rs.AllSameAs(88));
+ REQUIRE(false == rs.AllSameAs(0));
REQUIRE(true == rs.FillRange(startFill, 0, lengthFill));
REQUIRE(true == rs.AllSame());
- REQUIRE(0 == rs.AllSameAs(88));
+ REQUIRE(false == rs.AllSameAs(88));
REQUIRE(true == rs.AllSameAs(0));
}
diff --git a/test/unit/testSparseState.cxx b/test/unit/testSparseState.cxx
index bcc7d5552..64bdf64a5 100644
--- a/test/unit/testSparseState.cxx
+++ b/test/unit/testSparseState.cxx
@@ -102,7 +102,7 @@ TEST_CASE("SparseState") {
ssAdditions.Set(4, 34);
REQUIRE(1u == ssAdditions.size());
bool mergeChanged = ss.Merge(ssAdditions,5);
- REQUIRE(0 == mergeChanged);
+ REQUIRE(false == mergeChanged);
ssAdditions.Set(4, 44);
REQUIRE(1u == ssAdditions.size());
@@ -122,7 +122,7 @@ TEST_CASE("SparseState") {
ssAdditions.Set(4, 34);
REQUIRE(1u == ssAdditions.size());
bool mergeChanged = ss.Merge(ssAdditions,5);
- REQUIRE(0 == mergeChanged);
+ REQUIRE(false == mergeChanged);
ssAdditions.Set(4, 44);
REQUIRE(1u == ssAdditions.size());
@@ -157,7 +157,7 @@ TEST_CASE("SparseState") {
ssAdditions.Set(2, 32);
bool mergeChanged = ss.Merge(ssAdditions,3);
- REQUIRE(0 == mergeChanged);
+ REQUIRE(false == mergeChanged);
REQUIRE(2u == ss.size());
REQUIRE(32 == ss.ValueAt(2));
}
@@ -171,7 +171,7 @@ TEST_CASE("SparseState") {
ssAdditions.Set(2, 32);
bool mergeChanged = ss.Merge(ssAdditions,2);
- REQUIRE(0 == mergeChanged);
+ REQUIRE(false == mergeChanged);
REQUIRE(2u == ss.size());
REQUIRE(32 == ss.ValueAt(2));
}
@@ -186,7 +186,7 @@ TEST_CASE("SparseState") {
ssAdditions.Set(5, 34);
bool mergeChanged = ss.Merge(ssAdditions,6);
- REQUIRE(0 == mergeChanged);
+ REQUIRE(false == mergeChanged);
REQUIRE(3u == ss.size());
REQUIRE(34 == ss.ValueAt(4));
}