Skip to content
Snippets Groups Projects
Commit 8b4fbd21 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Add tests for MemoryID copy/move ctors/ops

parent 22af03e4
No related branches found
No related tags found
2 merge requests!140armem/dev -> master,!139Refactor inheritance in armem/core
......@@ -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);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment