예제 #1
0
def _mutate_assignment(mutate_dict: dict, source_file: SolidityFile,
                       project_directory: Path):
    interesting_locs = source_file.get_assignments()

    for original_operator, src in interesting_locs:
        if original_operator not in mutate_dict.keys():
            continue
        yield Mutation(src, source_file, mutate_dict[original_operator],
                       project_directory)
예제 #2
0
def _mutate_binary_op(mutate_dict: dict, source_file: SolidityFile,
                      project_directory: Path):
    interesting_locs = list(source_file.get_binary_op_locations())

    for original_operator, src in interesting_locs:
        if original_operator not in mutate_dict.keys():
            continue
        yield Mutation(src, source_file, mutate_dict[original_operator],
                       project_directory)
예제 #3
0
 def mutate_modifier(source_file: SolidityFile, project_directory: Path):
     modifier_invocations = list(source_file.get_modifier_invocations())
     for _, src in modifier_invocations:
         yield Mutation(src, source_file, "", project_directory)
예제 #4
0
 def mutate_voids(source_file: SolidityFile, project_directory: Path):
     void_calls = list(source_file.get_void_calls())
     for _, src in void_calls:
         src[1] += 1
         yield Mutation(src, source_file, "", project_directory)