AP_Common: stop setting terrain pointer in test_location

Also enable/disable as required for testing
This commit is contained in:
Peter Barker 2021-07-09 13:11:51 +10:00 committed by Andrew Tridgell
parent 0a068d4d4b
commit fc2338612e
1 changed files with 2 additions and 1 deletions

View File

@ -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)
}
}
// 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>(