Skip to content

Commit

Permalink
✅ (IMUKit): Fix uninteresting mock call for gyro
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Dec 14, 2022
1 parent 0c431b4 commit ab15e9f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libs/IMUKit/tests/IMUKit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

using namespace leka;

using ::testing::AnyNumber;
using ::testing::MockFunction;
using testing::Return;

Expand Down Expand Up @@ -118,6 +119,7 @@ TEST_F(IMUKitTest, defaultPosition)
accel_data = {0.F, 0.F, 1000.F};

EXPECT_CALL(accel, getXYZ).WillRepeatedly(Return(accel_data));
EXPECT_CALL(gyro, getXYZ).Times(AnyNumber());

for (auto i = 0; i < 100; ++i) {
imukit.computeAngles();
Expand All @@ -135,6 +137,7 @@ TEST_F(IMUKitTest, robotRolled90DegreesOnTheTop)
accel_data = {1000.F, 0.F, 0.F};

EXPECT_CALL(accel, getXYZ).WillRepeatedly(Return(accel_data));
EXPECT_CALL(gyro, getXYZ).Times(AnyNumber());

for (auto i = 0; i < 100; ++i) {
imukit.computeAngles();
Expand All @@ -152,6 +155,7 @@ TEST_F(IMUKitTest, robotRolled90DegreesOnTheBottom)
accel_data = {-1000.F, 0.F, 0.F};

EXPECT_CALL(accel, getXYZ).WillRepeatedly(Return(accel_data));
EXPECT_CALL(gyro, getXYZ).Times(AnyNumber());

for (auto i = 0; i < 100; ++i) {
imukit.computeAngles();
Expand All @@ -169,6 +173,7 @@ TEST_F(IMUKitTest, robotRolled90DegreesOnItsLeft)
accel_data = {0.F, 1000.F, 0.F};

EXPECT_CALL(accel, getXYZ).WillRepeatedly(Return(accel_data));
EXPECT_CALL(gyro, getXYZ).Times(AnyNumber());

for (auto i = 0; i < 100; ++i) {
imukit.computeAngles();
Expand All @@ -186,6 +191,7 @@ TEST_F(IMUKitTest, robotRolled90DegreesOnItsRight)
accel_data = {0.F, -1000.F, 0.F};

EXPECT_CALL(accel, getXYZ).WillRepeatedly(Return(accel_data));
EXPECT_CALL(gyro, getXYZ).Times(AnyNumber());

for (auto i = 0; i < 100; ++i) {
imukit.computeAngles();
Expand Down

0 comments on commit ab15e9f

Please sign in to comment.