Ardupilot2/Tools/LogAnalyzer/tests/TestEmpty.py
Andrew Chapman 36e480483f LogAnalyzer: Initial commit for discussion
A lot of this is still stub code, but far enough along for discussion
and feedback. Some good example tests are TestVibration and TestBrownout

datatypes handled correctly now (previsouly all read as floats), added
flag to skip bad input lines, now prints some general log info (size,
duration, etc), added some basic performance timing,
2014-06-24 15:07:45 +10:00

20 lines
575 B
Python

from LogAnalyzer import Test,TestResult
import DataflashLog
class TestEmpty(Test):
'''test for empty or near-empty logs'''
def __init__(self):
self.name = "Empty"
def run(self, logdata):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
# all the logic for this test is in the helper function, as it can also be called up front as an early exit
emptyErr = DataflashLog.DataflashLogHelper.isLogEmpty(logdata)
if emptyErr:
self.result.status = TestResult.StatusType.FAIL
self.result.statusMessage = "Empty log? " + emptyErr