diff options
| author | Neil <nyamatongwe@gmail.com> | 2020-05-02 09:01:54 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2020-05-02 09:01:54 +1000 |
| commit | c0c411daf8adbbeeb3a92a57d6e1538e58a49587 (patch) | |
| tree | ffeb0ba0c2ff07018dac09190043816ab67a4655 /test/unit/testSplitVector.cxx | |
| parent | 90ff87db7b368addb01191205570ba71054986e7 (diff) | |
| download | scintilla-mirror-c0c411daf8adbbeeb3a92a57d6e1538e58a49587.tar.gz | |
Backport: InsertEmpty now returns a pointer to the newly added elements to allow caller to
efficiently set those elements.
Backport of changeset 8225:de663ebc1bc6.
Diffstat (limited to 'test/unit/testSplitVector.cxx')
| -rw-r--r-- | test/unit/testSplitVector.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/testSplitVector.cxx b/test/unit/testSplitVector.cxx index 2d9d3607f..2a47c1ae5 100644 --- a/test/unit/testSplitVector.cxx +++ b/test/unit/testSplitVector.cxx @@ -167,6 +167,27 @@ TEST_CASE("SplitVector") { } } + SECTION("InsertEmpty") { + sv.InsertEmpty(0, 0); + REQUIRE(0 == sv.Length()); + int *pi = sv.InsertEmpty(0, 2); + REQUIRE(2 == sv.Length()); + REQUIRE(0 == sv.ValueAt(0)); + REQUIRE(0 == sv.ValueAt(1)); + pi[0] = 4; + pi[1] = 5; + REQUIRE(4 == sv.ValueAt(0)); + REQUIRE(5 == sv.ValueAt(1)); + pi = sv.InsertEmpty(1, 2); + pi[0] = 6; + pi[1] = 7; + REQUIRE(4 == sv.Length()); + REQUIRE(4 == sv.ValueAt(0)); + REQUIRE(6 == sv.ValueAt(1)); + REQUIRE(7 == sv.ValueAt(2)); + REQUIRE(5 == sv.ValueAt(3)); + } + SECTION("SetValue") { sv.InsertValue(0, 10, 0); sv.SetValueAt(5, 3); |
