mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 20:10:39 +08:00
Functional gtests: remove unnecessary subscription updates
A new subscription is updated on instanciation and no additional update needs to be called for processing the first sample.
This commit is contained in:
@@ -71,8 +71,6 @@ public:
|
||||
|
||||
// THEN: we receive the expected mode slot
|
||||
uORB::SubscriptionData<manual_control_switches_s> manual_control_switches_sub{ORB_ID(manual_control_switches)};
|
||||
manual_control_switches_sub.update();
|
||||
|
||||
EXPECT_EQ(manual_control_switches_sub.get().mode_slot, expected_slot);
|
||||
}
|
||||
|
||||
@@ -102,8 +100,6 @@ public:
|
||||
|
||||
// THEN: we receive the expected mode slot
|
||||
uORB::SubscriptionData<manual_control_switches_s> manual_control_switches_sub{ORB_ID(manual_control_switches)};
|
||||
manual_control_switches_sub.update();
|
||||
|
||||
EXPECT_EQ(manual_control_switches_sub.get().mode_slot, expected_slot);
|
||||
|
||||
// Reset channel value for the next test
|
||||
@@ -129,8 +125,6 @@ public:
|
||||
|
||||
// THEN: we receive the expected mode slot
|
||||
uORB::SubscriptionData<manual_control_switches_s> manual_control_switches_sub{ORB_ID(manual_control_switches)};
|
||||
manual_control_switches_sub.update();
|
||||
|
||||
EXPECT_EQ(manual_control_switches_sub.get().return_switch, expected_position);
|
||||
}
|
||||
|
||||
@@ -155,8 +149,6 @@ TEST_F(RCUpdateTest, ModeSlotUnassigned)
|
||||
|
||||
// THEN: we receive no mode slot
|
||||
uORB::SubscriptionData<manual_control_switches_s> manual_control_switches_sub{ORB_ID(manual_control_switches)};
|
||||
manual_control_switches_sub.update();
|
||||
|
||||
EXPECT_EQ(manual_control_switches_sub.get().mode_slot, 0); // manual_control_switches_s::MODE_SLOT_NONE
|
||||
}
|
||||
|
||||
@@ -198,8 +190,6 @@ TEST_F(RCUpdateTest, ReturnSwitchUnassigned)
|
||||
|
||||
// THEN: we receive an unmapped return switch state
|
||||
uORB::SubscriptionData<manual_control_switches_s> manual_control_switches_sub{ORB_ID(manual_control_switches)};
|
||||
manual_control_switches_sub.update();
|
||||
|
||||
EXPECT_EQ(manual_control_switches_sub.get().return_switch, 0); // manual_control_switches_s::SWITCH_POS_NONE
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user