2014-01-27 02:38:57 -04:00
|
|
|
import DataflashLog
|
2022-07-18 11:09:04 -03:00
|
|
|
from LogAnalyzer import Test, TestResult
|
2014-01-27 02:38:57 -04:00
|
|
|
|
|
|
|
|
|
|
|
class TestEmpty(Test):
|
2022-07-18 11:09:04 -03:00
|
|
|
'''test for empty or near-empty logs'''
|
2014-01-27 02:38:57 -04:00
|
|
|
|
2022-07-18 11:09:04 -03:00
|
|
|
def __init__(self):
|
|
|
|
Test.__init__(self)
|
|
|
|
self.name = "Empty"
|
2014-01-27 02:38:57 -04:00
|
|
|
|
2022-07-18 11:09:04 -03:00
|
|
|
def run(self, logdata, verbose):
|
|
|
|
self.result = TestResult()
|
|
|
|
self.result.status = TestResult.StatusType.GOOD
|
|
|
|
|
|
|
|
# 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
|