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