Skip to content
Snippets Groups Projects
Commit b8b7bd32 authored by Rainer Kartmann's avatar Rainer Kartmann Committed by armar-user
Browse files

Extend ArmarXObjectsTest

# Conflicts:
#	source/RobotAPI/libraries/ArmarXObjects/test/ArmarXObjectsTest.cpp
parent c59190cc
No related branches found
No related tags found
No related merge requests found
......@@ -29,8 +29,80 @@
#include <iostream>
BOOST_AUTO_TEST_CASE(testExample)
#include <RobotAPI/libraries/ArmarXObjects/aron/ObjectPose.aron.generated.h>
#include <RobotAPI/libraries/ArmarXObjects/ObjectFinder.h>
namespace fs = std::filesystem;
BOOST_AUTO_TEST_SUITE(arondto_ObjectPose_test)
BOOST_AUTO_TEST_CASE(test_ObjectType_copy_assignment)
{
BOOST_TEST_MESSAGE("Constructor");
armarx::objpose::arondto::ObjectType lhs, rhs;
BOOST_TEST_MESSAGE("Assignment");
BOOST_CHECK_NO_THROW(lhs = rhs);
BOOST_TEST_MESSAGE("Done");
}
BOOST_AUTO_TEST_CASE(test_ObjectAttachmentInfo_copy_assignment)
{
BOOST_TEST_MESSAGE("Constructor");
armarx::objpose::arondto::ObjectAttachmentInfo lhs, rhs;
BOOST_TEST_MESSAGE("Assignment");
BOOST_CHECK_NO_THROW(lhs = rhs);
BOOST_TEST_MESSAGE("Done");
}
BOOST_AUTO_TEST_CASE(test_ObjectPose_copy_assignment)
{
BOOST_TEST_MESSAGE("Constructor");
armarx::objpose::arondto::ObjectPose lhs, rhs;
BOOST_CHECK_EQUAL(true, true);
BOOST_TEST_MESSAGE("Assignment");
BOOST_CHECK_NO_THROW(lhs = rhs);
BOOST_TEST_MESSAGE("Done");
}
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE(ObjectFinderTest)
BOOST_AUTO_TEST_CASE(test_find)
{
using namespace armarx;
ObjectFinder finder;
bool checkPaths = false;
std::vector<ObjectInfo> objects = finder.findAllObjects(checkPaths);
BOOST_CHECK_GT(objects.size(), 0);
for (const ObjectInfo& object : objects)
{
fs::path simoxXML = object.simoxXML().absolutePath;
fs::path objectDir = simoxXML.parent_path();
BOOST_TEST_CONTEXT("Object: " << object.id() << " at " << objectDir)
{
BOOST_CHECK(fs::is_directory(objectDir));
BOOST_CHECK(fs::is_regular_file(simoxXML)
|| fs::is_regular_file(object.articulatedSimoxXML().absolutePath));
}
}
}
BOOST_AUTO_TEST_SUITE_END()
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