aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/unit/testPartitioning.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2022-07-29 11:16:28 +1000
committerNeil <nyamatongwe@gmail.com>2022-07-29 11:16:28 +1000
commite030b1d56785405cb35531758d603be88af9b487 (patch)
tree9a428393f7963d50a0b7557e7c77ac1be37c7bb3 /test/unit/testPartitioning.cxx
parent6e6641d4733903d3c365fd9348f3656ff7000ddf (diff)
downloadscintilla-mirror-e030b1d56785405cb35531758d603be88af9b487.tar.gz
Apply rule-of-zero to delete standard methods where possible as handled by
contained types. This allows flexibility as most lower-level data types can be moved and SplitVector and Partitioning of non-move-only types may be copied. CellBuffer still needs destructor due to incomplete type so retains all standard operations.
Diffstat (limited to 'test/unit/testPartitioning.cxx')
-rw-r--r--test/unit/testPartitioning.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/testPartitioning.cxx b/test/unit/testPartitioning.cxx
index fc55b4da1..5eef60c39 100644
--- a/test/unit/testPartitioning.cxx
+++ b/test/unit/testPartitioning.cxx
@@ -27,6 +27,30 @@ static const int testArray[lengthTestArray] = {3, 4, 5, 6, 7, 8, 9, 10};
// Test Partitioning.
+TEST_CASE("CompileCopying Partitioning") {
+
+ // These are compile-time tests to check that basic copy and move
+ // operations are defined correctly.
+
+ SECTION("CopyingMoving") {
+ Partitioning<int> s;
+ Partitioning<int> s2;
+
+ // Copy constructor
+ Partitioning<int> sa(s);
+ // Copy assignment
+ Partitioning<int> sb;
+ sb = s;
+
+ // Move constructor
+ Partitioning<int> sc(std::move(s));
+ // Move assignment
+ Partitioning<int> sd;
+ sd = (std::move(s2));
+ }
+
+}
+
TEST_CASE("Partitioning") {
Partitioning<Sci::Position> part;