Skip to content

Commit

Permalink
mavsdk_server: fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVautherin committed Oct 19, 2023
1 parent e9402ae commit 494caa8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mavsdk_server/test/connection_initiator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ TEST(ConnectionInitiator, startHangsUntilSystemDiscovered)
EXPECT_CALL(mavsdk, systems()).WillOnce(testing::Return(systems));

EXPECT_CALL(*system, is_connected()).WillOnce(testing::Return(true));
EXPECT_CALL(*system, has_autopilot()).WillOnce(testing::Return(true));

auto async_future = std::async(std::launch::async, [&initiator, &mavsdk]() {
initiator.start(mavsdk, ARBITRARY_CONNECTION_URL);
Expand All @@ -80,6 +81,7 @@ TEST(ConnectionInitiator, connectionDetectedIfDiscoverCallbackCalledBeforeWait)
EXPECT_CALL(mavsdk, systems()).WillOnce(testing::Return(systems));

EXPECT_CALL(*system, is_connected()).WillOnce(testing::Return(true));
EXPECT_CALL(*system, has_autopilot()).WillOnce(testing::Return(true));

initiator.start(mavsdk, ARBITRARY_CONNECTION_URL);
change_callback();
Expand All @@ -99,6 +101,7 @@ TEST(ConnectionInitiator, doesNotCrashIfDiscoverCallbackCalledMoreThanOnce)
EXPECT_CALL(mavsdk, systems()).WillRepeatedly(testing::Return(systems));

EXPECT_CALL(*system, is_connected()).WillRepeatedly(testing::Return(true));
EXPECT_CALL(*system, has_autopilot()).WillOnce(testing::Return(true));

initiator.start(mavsdk, ARBITRARY_CONNECTION_URL);
change_callback();
Expand Down

0 comments on commit 494caa8

Please sign in to comment.