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

Add test code

parent 08228568
No related branches found
No related tags found
No related merge requests found
......@@ -26,13 +26,15 @@
#include <RobotAPI/Test.h>
#include "../core/workingmemory/Memory.h"
#include "../core/error.h"
#include <RobotAPI/libraries/armem/core/workingmemory/Memory.h>
#include <RobotAPI/libraries/armem/core/longtermmemory/Memory.h>
#include <RobotAPI/libraries/armem/core/diskmemory/Memory.h>
#include <RobotAPI/libraries/armem/core/error.h>
#include <iostream>
#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h>
namespace armem = armarx::armem;
namespace aron = armarx::aron;
......@@ -75,6 +77,26 @@ BOOST_AUTO_TEST_CASE(test_time_to_string)
BOOST_CHECK_EQUAL(armem::toDateTimeMilliSeconds(time, 6), "1970-01-02 07:51:51.345000");
}
BOOST_AUTO_TEST_CASE(test_ctors)
{
armem::wm::EntityInstance instance(10);
BOOST_CHECK_EQUAL(instance.index(), 10);
armem::wm::EntitySnapshot snapshot(armem::Time::milliSeconds(100));
BOOST_CHECK_EQUAL(snapshot.time(), armem::Time::milliSeconds(100));
armem::wm::Entity entity("entity");
BOOST_CHECK_EQUAL(entity.name(), "entity");
armem::wm::ProviderSegment provSeg("provSeg");
BOOST_CHECK_EQUAL(provSeg.name(), "provSeg");
armem::wm::CoreSegment coreSeg("coreSeg");
BOOST_CHECK_EQUAL(coreSeg.name(), "coreSeg");
armem::wm::Memory memory("memory");
BOOST_CHECK_EQUAL(memory.name(), "memory");
}
BOOST_AUTO_TEST_CASE(test_segment_setup)
{
......@@ -265,3 +287,43 @@ BOOST_AUTO_TEST_CASE(test_history_size_in_provider_segment)
BOOST_CHECK_EQUAL(providerSegment.getEntity(name).history().size(), 3);
}
}
template <class T>
void test_the_copy_move_ctors_ops()
{
T t1;
{
T t2 { t1 };
t2 = t1;
}
{
T t2 { std::move(t1) };
t2 = std::move(t1);
}
}
BOOST_AUTO_TEST_CASE(test_copy_move_ctors_ops)
{
test_the_copy_move_ctors_ops<armem::wm::EntityInstance>();
test_the_copy_move_ctors_ops<armem::wm::EntitySnapshot>();
test_the_copy_move_ctors_ops<armem::wm::Entity>();
test_the_copy_move_ctors_ops<armem::wm::ProviderSegment>();
test_the_copy_move_ctors_ops<armem::wm::CoreSegment>();
test_the_copy_move_ctors_ops<armem::wm::Memory>();
test_the_copy_move_ctors_ops<armem::ltm::EntityInstance>();
test_the_copy_move_ctors_ops<armem::ltm::EntitySnapshot>();
test_the_copy_move_ctors_ops<armem::ltm::Entity>();
test_the_copy_move_ctors_ops<armem::ltm::ProviderSegment>();
test_the_copy_move_ctors_ops<armem::ltm::CoreSegment>();
test_the_copy_move_ctors_ops<armem::ltm::Memory>();
test_the_copy_move_ctors_ops<armem::d_ltm::EntityInstance>();
test_the_copy_move_ctors_ops<armem::d_ltm::EntitySnapshot>();
test_the_copy_move_ctors_ops<armem::d_ltm::Entity>();
test_the_copy_move_ctors_ops<armem::d_ltm::ProviderSegment>();
test_the_copy_move_ctors_ops<armem::d_ltm::CoreSegment>();
test_the_copy_move_ctors_ops<armem::d_ltm::Memory>();
}
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