Skip to content

Commit

Permalink
Update CoreIMU_test.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
YannLocatelli committed Jul 24, 2024
1 parent bd9b04f commit 5d683c6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions drivers/CoreIMU/tests/CoreIMU_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ TEST_F(CoreIMUTest, enableOnWakeUpInterrupt)
coreimu.enableOnWakeUpInterrupt();
}

TEST_F(CoreIMUTest, disableOnWakeUpInterrupt)
{
EXPECT_CALL(mocki2c, write).Times(AtLeast(1));
EXPECT_CALL(mocki2c, read).Times(AtLeast(1));

coreimu.disableOnWakeUpInterrupt();
}

TEST_F(CoreIMUTest, switchCallbacks)
{
auto mock_data_available_callback = MockFunction<void(const leka::interface::IMU::SensorData &data)> {};
Expand Down Expand Up @@ -190,4 +198,13 @@ TEST_F(CoreIMUTest, switchCallbacks)
on_rise_callback = spy_InterruptIn_getRiseCallback();
on_rise_callback();
}

{
// Disable Wake Up
EXPECT_CALL(mock_data_available_callback, Call).Times(0);
EXPECT_CALL(mock_wake_up_callback, Call).Times(0);
coreimu.disableOnWakeUpInterrupt();
on_rise_callback = spy_InterruptIn_getRiseCallback();
on_rise_callback();
}
}

0 comments on commit 5d683c6

Please sign in to comment.