mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 04:03:59 -04:00
autotest: augment blending test to ensure GPS switch events make log
This commit is contained in:
parent
badf461101
commit
44d5885d99
@ -6681,19 +6681,28 @@ class AutoTestCopter(AutoTest):
|
||||
# inspect generated log for messages:
|
||||
dfreader = self.dfreader_for_current_onboard_log()
|
||||
wanted = set([0, 1, 2])
|
||||
seen_primary_change = False
|
||||
while True:
|
||||
m = dfreader.recv_match(type="GPS") # disarmed
|
||||
m = dfreader.recv_match(type=["GPS", "EV"]) # disarmed
|
||||
if m is None:
|
||||
break
|
||||
try:
|
||||
wanted.remove(m.I)
|
||||
except KeyError:
|
||||
continue
|
||||
if len(wanted) == 0:
|
||||
mtype = m.get_type()
|
||||
if mtype == 'GPS':
|
||||
try:
|
||||
wanted.remove(m.I)
|
||||
except KeyError:
|
||||
continue
|
||||
elif mtype == 'EV':
|
||||
if m.Id == 67: # GPS_PRIMARY_CHANGED
|
||||
seen_primary_change = True
|
||||
if len(wanted) == 0 and seen_primary_change:
|
||||
break
|
||||
|
||||
if len(wanted):
|
||||
raise NotAchievedException("Did not get all three GPS types")
|
||||
if not seen_primary_change:
|
||||
raise NotAchievedException("Did not see primary change")
|
||||
|
||||
except Exception as e:
|
||||
self.progress("Caught exception: %s" %
|
||||
self.get_exception_stacktrace(e))
|
||||
|
Loading…
Reference in New Issue
Block a user