Commit 22ee3628 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[Refactoring] Fix unit-tests

parent 7ed0d440
......@@ -33,13 +33,12 @@ namespace pin_test = hpp::pinocchio::unittest;
template <typename CS_t>
void basic_test (CS_t cs, DevicePtr_t robot)
{
hpp::core::Configuration_t q;
for (int i = 0; i < 10; ++i)
{
hpp::core::ConfigurationPtr_t cptr = cs->shoot();
BOOST_REQUIRE (cptr);
hpp::core::Configuration_t c = *cptr;
cs->shoot(q);
hpp::pinocchio::ArrayXb unused(robot->numberDof());
BOOST_CHECK(!hpp::pinocchio::saturate(robot, c, unused));
BOOST_CHECK(!hpp::pinocchio::saturate(robot, q, unused));
}
}
......@@ -61,5 +60,7 @@ BOOST_AUTO_TEST_CASE (gaussian)
cs->sigma (0);
BOOST_CHECK(cs->shoot()->isApprox(cs->center()));
hpp::core::Configuration_t q;
cs->shoot(q);
BOOST_CHECK(q.isApprox(cs->center()));
}
......@@ -79,7 +79,7 @@ BOOST_AUTO_TEST_CASE (two_freeflyers)
{
DevicePtr_t robot = createRobot();
BOOST_REQUIRE (robot);
configurationShooter::UniformPtr_t cs = configurationShooter::Uniform::create(robot);
ConfigurationShooterPtr_t cs = configurationShooter::Uniform::create(robot);
JointPtr_t object2 = robot->getJointByName("obj2/root_joint");
JointPtr_t object1 = robot->getJointByName("obj1/root_joint");
......@@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE (two_frames_on_freeflyer)
{
DevicePtr_t robot = createRobot();
BOOST_REQUIRE (robot);
configurationShooter::UniformPtr_t cs = configurationShooter::Uniform::create(robot);
ConfigurationShooterPtr_t cs = configurationShooter::Uniform::create(robot);
JointPtr_t object2 = robot->getJointByName("obj2/root_joint");
JointPtr_t object1 = robot->getJointByName("obj1/root_joint");
......@@ -266,7 +266,7 @@ BOOST_AUTO_TEST_CASE (compare_to_relative_transform)
{
DevicePtr_t robot = createRobot();
BOOST_REQUIRE (robot);
configurationShooter::UniformPtr_t cs = configurationShooter::Uniform::create(robot);
ConfigurationShooterPtr_t cs = configurationShooter::Uniform::create(robot);
JointPtr_t object2 = robot->getJointByName("obj2/root_joint");
JointPtr_t object1 = robot->getJointByName("obj1/root_joint");
......
......@@ -369,7 +369,7 @@ BOOST_AUTO_TEST_CASE (nearestNeighbor) {
hpp::pinocchio::value_type dist;
using hpp::core::Nodes_t;
Nodes_t knearest = r->nearestNeighbor()->KnearestSearch
(nodes[0]->configuration(), nodes[0]->connectedComponent (), 3, dist);
(*nodes[0]->configuration(), nodes[0]->connectedComponent (), 3, dist);
for (Nodes_t::const_iterator it = knearest.begin (); it != knearest.end(); ++it) {
BOOST_TEST_MESSAGE ("q = [" << (*it)->configuration()->transpose() << "] - dist : " << (*distance) (*nodes[0]->configuration(), *(*it)->configuration()));
}
......
......@@ -410,7 +410,7 @@ BOOST_AUTO_TEST_CASE (kinodynamic) {
// random tests with non null initial and final acceleration
configurationShooter::UniformPtr_t shooter = configurationShooter::Uniform::create(robot);
ConfigurationShooterPtr_t shooter = configurationShooter::Uniform::create(robot);
ConfigurationPtr_t qr1,qr0;
value_type t1,t2;
for(size_t i = 0 ; i < 1000 ; i++){
......@@ -607,7 +607,7 @@ BOOST_AUTO_TEST_CASE (kinodynamicOriented) {
PathValidationReportPtr_t validationReport;
PathPtr_t validPath;
configurationShooter::UniformPtr_t shooter = configurationShooter::Uniform::create(robot);
ConfigurationShooterPtr_t shooter = configurationShooter::Uniform::create(robot);
ConfigurationPtr_t qr1,qr0;
value_type t1,t2;
for(size_t i = 0 ; i < 1000 ; i++){
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment