Skip to content

Commit 45d6c75

Browse files
committed
AP_Common: tests: remove un-needed vehicle object
1 parent fcbd854 commit 45d6c75

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

libraries/AP_Common/tests/test_location.cpp

+4-17
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,11 @@
77

88
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
99

10-
class DummyVehicle {
11-
public:
12-
bool start_cmd(const AP_Mission::Mission_Command& cmd) { return true; };
13-
bool verify_cmd(const AP_Mission::Mission_Command& cmd) { return true; };
14-
void mission_complete() { };
15-
AP_AHRS ahrs{AP_AHRS::FLAG_ALWAYS_USE_EKF};
16-
17-
AP_Mission mission{
18-
FUNCTOR_BIND_MEMBER(&DummyVehicle::start_cmd, bool, const AP_Mission::Mission_Command &),
19-
FUNCTOR_BIND_MEMBER(&DummyVehicle::verify_cmd, bool, const AP_Mission::Mission_Command &),
20-
FUNCTOR_BIND_MEMBER(&DummyVehicle::mission_complete, void)};
21-
AP_Terrain terrain;
22-
};
10+
AP_AHRS ahrs{AP_AHRS::FLAG_ALWAYS_USE_EKF};
11+
AP_Terrain terrain;
2312

2413
GCS_Dummy _gcs;
2514

26-
static DummyVehicle vehicle;
27-
2815
#define EXPECT_VECTOR2F_EQ(v1, v2) \
2916
do { \
3017
EXPECT_FLOAT_EQ(v1[0], v2[0]); \
@@ -210,7 +197,7 @@ TEST(Location, Tests)
210197
}
211198
}
212199
// NO TERRAIN, NO ORIGIN
213-
EXPECT_TRUE(vehicle.ahrs.set_home(test_home));
200+
EXPECT_TRUE(ahrs.set_home(test_home));
214201
for (auto current_frame = Location::AltFrame::ABSOLUTE;
215202
current_frame <= Location::AltFrame::ABOVE_TERRAIN;
216203
current_frame = static_cast<Location::AltFrame>(
@@ -340,7 +327,7 @@ TEST(Location, Sanitize)
340327
// we will sanitize test_loc with test_default_loc
341328
// test_home is just for reference
342329
const Location test_home{-35362938, 149165085, 100, Location::AltFrame::ABSOLUTE};
343-
EXPECT_TRUE(vehicle.ahrs.set_home(test_home));
330+
EXPECT_TRUE(ahrs.set_home(test_home));
344331
const Location test_default_loc{-35362938, 149165085, 200, Location::AltFrame::ABSOLUTE};
345332
Location test_loc;
346333
test_loc.set_alt_cm(0, Location::AltFrame::ABOVE_HOME);

0 commit comments

Comments
 (0)