aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/unit/testDecoration.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/testDecoration.cxx')
-rw-r--r--test/unit/testDecoration.cxx60
1 files changed, 30 insertions, 30 deletions
diff --git a/test/unit/testDecoration.cxx b/test/unit/testDecoration.cxx
index d2fbc7df2..b8e880c2c 100644
--- a/test/unit/testDecoration.cxx
+++ b/test/unit/testDecoration.cxx
@@ -26,27 +26,27 @@ using namespace Scintilla;
TEST_CASE("Decoration") {
- Decoration deco(indicator);
+ std::unique_ptr<IDecoration> deco = DecorationCreate(indicator);
SECTION("HasCorrectIndicator") {
- REQUIRE(indicator == deco.Indicator());
+ REQUIRE(indicator == deco->Indicator());
}
SECTION("IsEmptyInitially") {
- REQUIRE(0 == deco.rs.Length());
- REQUIRE(1 == deco.rs.Runs());
- REQUIRE(deco.Empty());
+ REQUIRE(0 == deco->Length());
+ REQUIRE(1 == deco->Runs());
+ REQUIRE(deco->Empty());
}
SECTION("SimpleSpace") {
- deco.rs.InsertSpace(0, 1);
- REQUIRE(deco.Empty());
+ deco->InsertSpace(0, 1);
+ REQUIRE(deco->Empty());
}
SECTION("SimpleRun") {
- deco.rs.InsertSpace(0, 1);
- deco.rs.SetValueAt(0, 2);
- REQUIRE(!deco.Empty());
+ deco->InsertSpace(0, 1);
+ deco->SetValueAt(0, 2);
+ REQUIRE(!deco->Empty());
}
}
@@ -54,41 +54,41 @@ TEST_CASE("Decoration") {
TEST_CASE("DecorationList") {
- DecorationList decol;
+ std::unique_ptr<IDecorationList> decol = DecorationListCreate();
SECTION("HasCorrectIndicator") {
- decol.SetCurrentIndicator(indicator);
- REQUIRE(indicator == decol.GetCurrentIndicator());
+ decol->SetCurrentIndicator(indicator);
+ REQUIRE(indicator == decol->GetCurrentIndicator());
}
SECTION("HasCorrectCurrentValue") {
const int value = 55;
- decol.SetCurrentValue(value);
- REQUIRE(value == decol.GetCurrentValue());
+ decol->SetCurrentValue(value);
+ REQUIRE(value == decol->GetCurrentValue());
}
SECTION("ExpandSetValues") {
- decol.SetCurrentIndicator(indicator);
- decol.InsertSpace(0, 9);
+ decol->SetCurrentIndicator(indicator);
+ decol->InsertSpace(0, 9);
const int value = 59;
- Sci::Position position = 4;
- Sci::Position fillLength = 3;
- auto fr = decol.FillRange(position, value, fillLength);
+ const Sci::Position position = 4;
+ const Sci::Position fillLength = 3;
+ auto fr = decol->FillRange(position, value, fillLength);
REQUIRE(fr.changed);
REQUIRE(fr.position == 4);
REQUIRE(fr.fillLength == 3);
- REQUIRE(decol.ValueAt(indicator, 5) == value);
- REQUIRE(decol.AllOnFor(5) == (1 << indicator));
- REQUIRE(decol.Start(indicator, 5) == 4);
- REQUIRE(decol.End(indicator, 5) == 7);
+ REQUIRE(decol->ValueAt(indicator, 5) == value);
+ REQUIRE(decol->AllOnFor(5) == (1 << indicator));
+ REQUIRE(decol->Start(indicator, 5) == 4);
+ REQUIRE(decol->End(indicator, 5) == 7);
const int indicatorB=6;
- decol.SetCurrentIndicator(indicatorB);
- fr = decol.FillRange(position, value, fillLength);
+ decol->SetCurrentIndicator(indicatorB);
+ fr = decol->FillRange(position, value, fillLength);
REQUIRE(fr.changed);
- REQUIRE(decol.AllOnFor(5) == ((1 << indicator) | (1 << indicatorB)));
- decol.DeleteRange(5, 1);
- REQUIRE(decol.Start(indicatorB, 5) == 4);
- REQUIRE(decol.End(indicatorB, 5) == 6);
+ REQUIRE(decol->AllOnFor(5) == ((1 << indicator) | (1 << indicatorB)));
+ decol->DeleteRange(5, 1);
+ REQUIRE(decol->Start(indicatorB, 5) == 4);
+ REQUIRE(decol->End(indicatorB, 5) == 6);
}
}