diff --git a/source/RobotAPI/libraries/armem/test/ArMemMemoryIDTest.cpp b/source/RobotAPI/libraries/armem/test/ArMemMemoryIDTest.cpp index 1f94d9adb9a2d023a3813c0e09edf8b41367ace1..aad3359b0d57cfed79d463cc27dcced44550ef00 100644 --- a/source/RobotAPI/libraries/armem/test/ArMemMemoryIDTest.cpp +++ b/source/RobotAPI/libraries/armem/test/ArMemMemoryIDTest.cpp @@ -137,3 +137,30 @@ BOOST_AUTO_TEST_CASE(test_MemoryID_from_to_string) } + +BOOST_AUTO_TEST_CASE(test_MemoryID_copy_move_ctors_ops) +{ + const armem::MemoryID id("A/B/C/123/1"), moved("////1"); // int is not moved + { + const armem::MemoryID out(id); + BOOST_CHECK_EQUAL(out, id); + } + { + armem::MemoryID out; + out = id; + BOOST_CHECK_EQUAL(out, id); + } + { + armem::MemoryID in = id; + const armem::MemoryID out(std::move(in)); + BOOST_CHECK_EQUAL(in, moved); + BOOST_CHECK_EQUAL(out, id); + } + { + armem::MemoryID in = id; + armem::MemoryID out; + out = std::move(in); + BOOST_CHECK_EQUAL(in, moved); + BOOST_CHECK_EQUAL(out, id); + } +}