From e030b1d56785405cb35531758d603be88af9b487 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 29 Jul 2022 11:16:28 +1000 Subject: 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. --- test/unit/testPartitioning.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/unit/testPartitioning.cxx') 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 s; + Partitioning s2; + + // Copy constructor + Partitioning sa(s); + // Copy assignment + Partitioning sb; + sb = s; + + // Move constructor + Partitioning sc(std::move(s)); + // Move assignment + Partitioning sd; + sd = (std::move(s2)); + } + +} + TEST_CASE("Partitioning") { Partitioning part; -- cgit v1.2.3