from __future__ import print_function from LogAnalyzer import Test,TestResult import DataflashLog class TestDupeLogData(Test): '''test for duplicated data in log, which has been happening on PX4/Pixhawk''' def __init__(self): Test.__init__(self) self.name = "Dupe Log Data" def __matchSample(self, sample, sampleStartIndex, logdata): '''return the line number where a match is found, otherwise return False''' # ignore if all data in sample is the same value nSame = 0 for s in sample: if s[1] == sample[0][1]: nSame += 1 if nSame == 20: return False # c data = logdata.channels["ATT"]["Pitch"].listData for i in range(sampleStartIndex, len(data)): #print("Checking against index %d" % i) if i == sampleStartIndex: continue # skip matching against ourselves j = 0 while j<20 and (i+j)= len(sampleStartIndices): break