Skip to content

Commit

Permalink
✅ (MotionKit): Shut unexpected calls
Browse files Browse the repository at this point in the history
  • Loading branch information
HPezz committed Dec 8, 2022
1 parent 4abb309 commit aeee3c5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libs/MotionKit/tests/MotionKit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,15 @@ TEST_F(MotionKitTest, rotateAndStop)
motion.stop();
};

EXPECT_CALL(mock_function_imu, Call()).Times(1);
EXPECT_CALL(mock_function_motion, Call()).Times(1);

EXPECT_CALL(mock_motor_left, stop).Times(2);
EXPECT_CALL(mock_motor_right, stop).Times(2);

EXPECT_CALL(mock_motor_left, spin).Times(1);
EXPECT_CALL(mock_motor_right, spin).Times(1);

stub_event_loop_imu.registerCallback(loop_imu);
stub_event_loop_motion.registerCallback(loop_motion);
motion.rotate(1, Rotation::clockwise);
Expand All @@ -119,8 +126,12 @@ TEST_F(MotionKitTest, startStabilisationAndStop)
motion.stop();
};

EXPECT_CALL(mock_function_imu, Call()).Times(1);
EXPECT_CALL(mock_function_motion, Call()).Times(1);

EXPECT_CALL(mock_motor_left, stop).Times(2);
EXPECT_CALL(mock_motor_right, stop).Times(2);

stub_event_loop_imu.registerCallback(loop_imu);
stub_event_loop_motion.registerCallback(loop_motion);
motion.startStabilisation();
Expand Down

0 comments on commit aeee3c5

Please sign in to comment.