Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
 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))
Ejemplo n.º 4
0
 def __min_distance_best_case(self, known_seqs):
     sequence = known_seqs[0]
     self.assertEquals(0, runtime_check.min_distance(sequence, known_seqs))
Ejemplo n.º 5
0
 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))
Ejemplo n.º 6
0
 def __min_distance_best_case(self, known_seqs):
     sequence = known_seqs[0]
     self.assertEquals(0, runtime_check.min_distance(sequence, known_seqs))