Browse Source

AP_Common: stop setting terrain pointer in test_location

Also enable/disable as required for testing
gps-1.3.1
Peter Barker 4 years ago committed by Andrew Tridgell
parent
commit
fc2338612e
  1. 3
      libraries/AP_Common/tests/test_location.cpp

3
libraries/AP_Common/tests/test_location.cpp

@ -212,6 +212,7 @@ TEST(Location, Tests) @@ -212,6 +212,7 @@ TEST(Location, Tests)
EXPECT_EQ(Location::AltFrame::ABOVE_TERRAIN, test_location3.get_alt_frame());
// No TERRAIN, NO HOME, NO ORIGIN
AP::terrain()->set_enabled(false);
for (auto current_frame = Location::AltFrame::ABSOLUTE;
current_frame <= Location::AltFrame::ABOVE_TERRAIN;
current_frame = static_cast<Location::AltFrame>(
@ -267,7 +268,7 @@ TEST(Location, Tests) @@ -267,7 +268,7 @@ TEST(Location, Tests)
}
}
// NO Origin
Location::set_terrain(&vehicle.terrain);
AP::terrain()->set_enabled(true);
for (auto current_frame = Location::AltFrame::ABSOLUTE;
current_frame <= Location::AltFrame::ABOVE_TERRAIN;
current_frame = static_cast<Location::AltFrame>(

Loading…
Cancel
Save