ANYbotics/kindr

Is this a misuse of the typed test?

furgalep opened this issue · 4 comments

I've never seen the typed test before, but this looks like a misuse:

https://github.com/ethz-asl/kindr/blob/master/test/poses/PoseEigenTest.cpp#L86-L100

TYPED_TEST(HomogeneousTransformationTest, testSetIdentity)
{
  pose::HomogeneousTransformationPosition3RotationQuaternionD test(pos::Position3D(1,2,3),rot::RotationQuaternionPD(rot::AngleAxisPD(0.5,1.0,0,0)));

  test.setIdentity();

  ASSERT_EQ(test.getPosition().vector().x(), 0);
  ASSERT_EQ(test.getPosition().vector().y(), 0);
  ASSERT_EQ(test.getPosition().vector().z(), 0);

  ASSERT_EQ(test.getRotation().w(), 1);
  ASSERT_EQ(test.getRotation().x(), 0);
  ASSERT_EQ(test.getRotation().y(), 0);
  ASSERT_EQ(test.getRotation().z(), 0);
}

This code doesn't look like it is using the types in the test fixture.

Agreed. That does look like an incomplete conversion to a TYPED_TEST. I've seen only completed so far. But I only read some to debug problems that came to me somehow :).

haha

That was only an initial test for testing the implementation.
The unit tests for poses are not really done.

Ah, thanks for looking. Okay, let's clean up as we implement the interface.