From 40c1e1d50c9651bad37d2d0bb384f8f47eddb0aa Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Fri, 29 Nov 2024 15:09:47 +0100 Subject: [PATCH] Fix unit tests --- test/BB2B_Test.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/BB2B_Test.cc b/test/BB2B_Test.cc index 5659a3c..f36367a 100644 --- a/test/BB2B_Test.cc +++ b/test/BB2B_Test.cc @@ -212,9 +212,9 @@ TEST(BB2B, ObstacleLeft) { diffDrive->GetVelocity(); // this depends on the wheel diameter. EXPECT_FLOAT_EQ(velocity.distance, 0.0F); - float angularVelocity = + Spherical16 angularVelocity = diffDrive->GetAngularVelocity(); // this also depends on wheel separation - EXPECT_FLOAT_EQ(angularVelocity, 90.0F); + EXPECT_FLOAT_EQ(angularVelocity.distance, 90.0F); #pragma endregion } @@ -315,8 +315,8 @@ TEST(BB2B, ObstacleRight) { Spherical16 velocity = diffDrive->GetVelocity(); EXPECT_FLOAT_EQ(velocity.distance, 0.0F); - float angularVelocity = diffDrive->GetAngularVelocity(); - EXPECT_FLOAT_EQ(angularVelocity, -90.0F); + Spherical16 angularVelocity = diffDrive->GetAngularVelocity(); + EXPECT_FLOAT_EQ(angularVelocity.distance, -90.0F); #pragma endregion } @@ -413,8 +413,8 @@ TEST(BB2B, ObstacleBoth) { EXPECT_FLOAT_EQ(velocity.distance, 1.0F); EXPECT_FLOAT_EQ(velocity.direction.horizontal.InDegrees(), -180.0F); - float angularVelocity = diffDrive->GetAngularVelocity(); - EXPECT_FLOAT_EQ(angularVelocity, 0.0F); + Spherical16 angularVelocity = diffDrive->GetAngularVelocity(); + EXPECT_FLOAT_EQ(angularVelocity.distance, 0.0F); #pragma endregion }