def test_01_min_distance_fake_data(self): known_seqs = [ _gen_sequence_from_seed(('futex', 'gettimeofday', 'rite', 'time' 'stat' )), _gen_sequence_from_seed(('futex', 'gettimeofday', 'write', 'time' 'stat' )), ] self.__min_distance_best_case(known_seqs) sequence = _gen_sequence_from_seed(( 'futex', 'gettimeofday', )) self.assertEquals(2, runtime_check.min_distance(sequence, known_seqs)) sequence = _gen_sequence_from_seed(( 'gettimeofday', )) self.assertEquals(4, runtime_check.min_distance(sequence, known_seqs)) self.__min_distance_worst_case(known_seqs)
def test_01_min_distance_fake_data(self): known_seqs = [ _gen_sequence_from_seed(('futex', 'gettimeofday', 'rite', 'time' 'stat')), _gen_sequence_from_seed(('futex', 'gettimeofday', 'write', 'time' 'stat')), ] self.__min_distance_best_case(known_seqs) sequence = _gen_sequence_from_seed(( 'futex', 'gettimeofday', )) self.assertEquals(2, runtime_check.min_distance(sequence, known_seqs)) sequence = _gen_sequence_from_seed(('gettimeofday', )) self.assertEquals(4, runtime_check.min_distance(sequence, known_seqs)) self.__min_distance_worst_case(known_seqs)
def __min_distance_worst_case(self, known_seqs): sequence = _gen_sequence_from_seed(('wrong', )) self.assertEquals(len(sequence), runtime_check.min_distance(sequence, known_seqs))
def __min_distance_best_case(self, known_seqs): sequence = known_seqs[0] self.assertEquals(0, runtime_check.min_distance(sequence, known_seqs))
def __min_distance_worst_case(self, known_seqs): sequence = _gen_sequence_from_seed(( 'wrong', )) self.assertEquals(len(sequence), runtime_check.min_distance(sequence, known_seqs))