aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/unit/testSparseVector.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2017-05-21 10:26:10 +1000
committerNeil <nyamatongwe@gmail.com>2017-05-21 10:26:10 +1000
commit8ef4f3d54de1328a1d9753f4317a5d7692a72ae8 (patch)
treed0fb1e0c6cbd0a0256066ccb9e1541d3adbdf41c /test/unit/testSparseVector.cxx
parent632801dae9d844bd73891a314e99161add3f47fc (diff)
downloadscintilla-mirror-8ef4f3d54de1328a1d9753f4317a5d7692a72ae8.tar.gz
Make SplitVector work with move-only types like unique_ptr.
Provide InsertEmpty and both const and non-const reference returning operator[]. Add and fix comments.
Diffstat (limited to 'test/unit/testSparseVector.cxx')
-rw-r--r--test/unit/testSparseVector.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/unit/testSparseVector.cxx b/test/unit/testSparseVector.cxx
index ad0110ae0..16498397a 100644
--- a/test/unit/testSparseVector.cxx
+++ b/test/unit/testSparseVector.cxx
@@ -4,6 +4,7 @@
#include <cstring>
#include <stdexcept>
+#include <vector>
#include <algorithm>
#include <memory>
@@ -45,9 +46,9 @@ TEST_CASE("SparseVector") {
SECTION("InsertSpace") {
st.InsertSpace(0, 5);
REQUIRE(1 == st.Elements());
- REQUIRE(static_cast<const char *>(NULL) == st.ValueAt(0));
- REQUIRE(static_cast<const char *>(NULL) == st.ValueAt(1));
- REQUIRE(static_cast<const char *>(NULL) == st.ValueAt(4));
+ REQUIRE(static_cast<const char *>(nullptr) == st.ValueAt(0));
+ REQUIRE(static_cast<const char *>(nullptr) == st.ValueAt(1));
+ REQUIRE(static_cast<const char *>(nullptr) == st.ValueAt(4));
st.Check();
}
@@ -119,7 +120,7 @@ TEST_CASE("SparseVector") {
st.SetValueAt(4, "5");
REQUIRE(2 == st.Elements());
REQUIRE("----5" == Representation(st));
- st.SetValueAt(4, NULL);
+ st.SetValueAt(4, nullptr);
REQUIRE(1 == st.Elements());
REQUIRE("-----" == Representation(st));
st.Check();