コード例 #1
0
 def testValueTruncedFuzzable(self):
     field = String(name='trunced', value='abc')
     uut = Trunc(max_size=self.trunc_size, fields=field, fuzzable=True)
     self._testValueTrunced(field, uut, self.trunc_size)
     self.assertEqual(uut.num_mutations(), field.num_mutations())
     self.assertGreater(uut.num_mutations(), 0)
     while uut.mutate():
         self._testValueTrunced(field, uut, self.trunc_size)
コード例 #2
0
 def testValueTruncedFuzzable(self):
     field = String(name='trunced', value='abc')
     uut = Trunc(max_size=self.trunc_size, fields=field, fuzzable=True)
     self._testValueTrunced(field, uut, self.trunc_size)
     self.assertEqual(uut.num_mutations(), field.num_mutations())
     self.assertGreater(uut.num_mutations(), 0)
     while uut.mutate():
         self._testValueTrunced(field, uut, self.trunc_size)
コード例 #3
0
 def testIsFuzzable(self):
     field = String('abc')
     uut = Meta(name=self.uut_name, fields=[field], fuzzable=True)
     num_mutations = uut.num_mutations()
     self.assertGreater(num_mutations, 0)
     self.assertGreaterEqual(num_mutations, field.num_mutations())
     actual_num_mutations = 0
     while uut.mutate():
         actual_num_mutations += 1
     self.assertEqual(actual_num_mutations, num_mutations)
コード例 #4
0
 def testIsFuzzable(self):
     field = String('abc')
     uut = Meta(name=self.uut_name, fields=[field], fuzzable=True)
     num_mutations = uut.num_mutations()
     self.assertGreater(num_mutations, 0)
     self.assertGreaterEqual(num_mutations, field.num_mutations())
     actual_num_mutations = 0
     while uut.mutate():
         actual_num_mutations += 1
     self.assertEqual(actual_num_mutations, num_mutations)
コード例 #5
0
 def testNumMutations(self):
     field = String(name='trunced', value='abc')
     uut = Trunc(self.trunc_size, fields=field, name=self.uut_name)
     field_num_mutations = field.num_mutations()
     uut_num_mutations = uut.num_mutations()
     self.assertEqual(uut_num_mutations, field_num_mutations)
     self.assertGreater(uut_num_mutations, 0)
     actual_num_mutations = 0
     while uut.mutate():
         actual_num_mutations += 1
     self.assertEqual(actual_num_mutations, uut_num_mutations)
コード例 #6
0
 def testNumMutations(self):
     field = String(name='padded', value='abc')
     uut = Pad(self.pad_length, fields=field, name=self.uut_name)
     field_num_mutations = field.num_mutations()
     uut_num_mutations = uut.num_mutations()
     self.assertEqual(uut_num_mutations, field_num_mutations)
     self.assertGreater(uut_num_mutations, 0)
     actual_num_mutations = 0
     while uut.mutate():
         actual_num_mutations += 1
     self.assertEqual(actual_num_mutations, uut_num_mutations)
コード例 #7
0
 def testNumMutations(self):
     field = String(name='trunced', value='abc')
     uut = Trunc(self.trunc_size, fields=field, name=self.uut_name)
     field_num_mutations = field.num_mutations()
     uut_num_mutations = uut.num_mutations()
     self.assertEqual(uut_num_mutations, field_num_mutations)
     self.assertGreater(uut_num_mutations, 0)
     actual_num_mutations = 0
     while uut.mutate():
         actual_num_mutations += 1
     self.assertEqual(actual_num_mutations, uut_num_mutations)
コード例 #8
0
 def testNumMutations(self):
     field = String(name='padded', value='abc')
     uut = Pad(self.pad_length, fields=field, name=self.uut_name)
     field_num_mutations = field.num_mutations()
     uut_num_mutations = uut.num_mutations()
     self.assertEqual(uut_num_mutations, field_num_mutations)
     self.assertGreater(uut_num_mutations, 0)
     actual_num_mutations = 0
     while uut.mutate():
         actual_num_mutations += 1
     self.assertEqual(actual_num_mutations, uut_num_mutations)