testing/clusterfuzz/common/fuzzy_types.py
def RandomMutation(self, count=None):
    """Apply count random mutations chosen from a weighted list."""
    random_bytes = lambda: random.randint(0x00, 0xFF)
    mutations = [
      (self.FlipBits, 1),
      (functools.partial(self.Overwrite, random_bytes), 1/3.0),
      (functools.partial(self.Overwrite, 0xFF), 1/3.0),
      (functools.partial(self.Overwrite, 0x00), 1/3.0),
      (functools.partial(self.Insert, random_bytes), 1/3.0),
      (functools.partial(self.Insert, 0xFF), 1/3.0),
      (functools.partial(self.Insert, 0x00), 1/3.0),
      (self.Delete, 1),
    ]
    if count is None:
      count = utils.RandomLowInteger(1, 5, beta=3.0)
    for _ in range(count):
      utils.WeightedChoice(mutations)()
Apply count random mutations chosen from a weighted list.
Apply count random mutations chosen from a weighted list.
Apply count random mutations chosen from a weighted list .
def RandomMutation(self, count=None):
    random_bytes = lambda: random.randint(0x00, 0xFF)
    mutations = [
      (self.FlipBits, 1),
      (functools.partial(self.Overwrite, random_bytes), 1/3.0),
      (functools.partial(self.Overwrite, 0xFF), 1/3.0),
      (functools.partial(self.Overwrite, 0x00), 1/3.0),
      (functools.partial(self.Insert, random_bytes), 1/3.0),
      (functools.partial(self.Insert, 0xFF), 1/3.0),
      (functools.partial(self.Insert, 0x00), 1/3.0),
      (self.Delete, 1),
    ]
    if count is None:
      count = utils.RandomLowInteger(1, 5, beta=3.0)
    for _ in range(count):
      utils.WeightedChoice(mutations)()
def RandomMutation ( self , count = None ) : random_bytes = lambda : random . randint ( 0x00 , 0xFF ) mutations = [ ( self . FlipBits , 1 ) , ( functools . partial ( self . Overwrite , random_bytes ) , 1 / 3.0 ) , ( functools . partial ( self . Overwrite , 0xFF ) , 1 / 3.0 ) , ( functools . partial ( self . Overwrite , 0x00 ) , 1 / 3.0 ) , ( functools . partial ( self . Insert , random_bytes ) , 1 / 3.0 ) , ( functools . partial ( self . Insert , 0xFF ) , 1 / 3.0 ) , ( functools . partial ( self . Insert , 0x00 ) , 1 / 3.0 ) , ( self . Delete , 1 ) , ] if count is None : count = utils . RandomLowInteger ( 1 , 5 , beta = 3.0 ) for _ in range ( count ) : utils . WeightedChoice ( mutations ) ( )
Apply count random mutations chosen from a weighted list.
Apply count random mutations chosen from a weighted list .
"""Apply count random mutations chosen from a weighted list."""
self
count