testing/clusterfuzz/common/fuzzy_types.py
def FuzzyInt(n):
  """Returns an integer derived from the input by one of several mutations."""
  int_sizes = [8, 16, 32, 64, 128]
  mutations = [
    lambda n: utils.UniformExpoInteger(0, sys.maxsize.bit_length() + 1),
    lambda n: -utils.UniformExpoInteger(0, sys.maxsize.bit_length()),
    lambda n: 2 ** random.choice(int_sizes) - 1,
    lambda n: 2 ** random.choice(int_sizes),
    lambda n: 0,
    lambda n: -n,
    lambda n: n + 1,
    lambda n: n - 1,
    lambda n: n + random.randint(-1024, 1024),
  ]
  return random.choice(mutations)(n)
Returns an integer derived from the input by one of several mutations.
Returns an integer derived from the input by one of several mutations.
Returns an integer derived from the input by one of several mutations .
def FuzzyInt(n):
  int_sizes = [8, 16, 32, 64, 128]
  mutations = [
    lambda n: utils.UniformExpoInteger(0, sys.maxsize.bit_length() + 1),
    lambda n: -utils.UniformExpoInteger(0, sys.maxsize.bit_length()),
    lambda n: 2 ** random.choice(int_sizes) - 1,
    lambda n: 2 ** random.choice(int_sizes),
    lambda n: 0,
    lambda n: -n,
    lambda n: n + 1,
    lambda n: n - 1,
    lambda n: n + random.randint(-1024, 1024),
  ]
  return random.choice(mutations)(n)
def FuzzyInt ( n ) : int_sizes = [ 8 , 16 , 32 , 64 , 128 ] mutations = [ lambda n : utils . UniformExpoInteger ( 0 , sys . maxsize . bit_length ( ) + 1 ) , lambda n : - utils . UniformExpoInteger ( 0 , sys . maxsize . bit_length ( ) ) , lambda n : 2 ** random . choice ( int_sizes ) - 1 , lambda n : 2 ** random . choice ( int_sizes ) , lambda n : 0 , lambda n : - n , lambda n : n + 1 , lambda n : n - 1 , lambda n : n + random . randint ( - 1024 , 1024 ) , ] return random . choice ( mutations ) ( n )
Returns an integer derived from the input by one of several mutations.
Returns an integer derived from the input by one of several mutations .
"""Returns an integer derived from the input by one of several mutations."""
n