示例#1
0
 def test_bytemutfuzzer_fuzz(self):
     self.assertTrue(self.sf.len > 0)
     for i in xrange(100):
         with ByteMutFuzzer(*self.args) as f:
             f.iteration = i
             f._fuzz()
             # same length, different output
             self.assertEqual(self.sf.len, len(f.fuzzed))
             self._fail_if_not_fuzzed(f.fuzzed)
示例#2
0
 def test_consistency(self):
     # ensure that we get the same result 20 times in a row
     # for 50 different iterations
     last_result = None
     last_x = None
     for x in range(50):
         if x != last_x:
             last_result = None
         last_x = x
         for _ in range(20):
             with ByteMutFuzzer(self.sf, self.outdir, x, self.options) as f:
                 f._fuzz()
                 result = str(f.output)
                 if last_result:
                     self.assertEqual(result, last_result)
                 else:
                     last_result = result
示例#3
0
 def test_is_minimizable(self):
     f = ByteMutFuzzer(*self.args)
     self.assertTrue(f.is_minimizable)