Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
glarregay-tob committed Mar 25, 2024
1 parent f9ad12a commit 456dbb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions fuzz_utils/fuzzers/Echidna.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def parse_reproducer(self, file_path: str, calls: Any, index: int) -> str:

# before each test case, we clear the declared variables, as those are locals
self.declared_variables = set()

# 1. For each object in the list process the call object and add it to the call list
for idx, call in enumerate(calls):
call_str, fn_name = self._parse_call_object(call)
Expand All @@ -68,7 +68,10 @@ def parse_reproducer(self, file_path: str, calls: Any, index: int) -> str:
# 2. Generate the test string and return it
template = jinja2.Template(templates["TEST"])
return template.render(
function_name=function_name, call_list=call_list, file_path=file_path, has_low_level_call=has_low_level_call
function_name=function_name,
call_list=call_list,
file_path=file_path,
has_low_level_call=has_low_level_call,
)

# pylint: disable=too-many-locals,too-many-branches
Expand Down Expand Up @@ -315,7 +318,7 @@ def _get_memarr(
input_type = input_parameter.type
name = f"dyn{input_type}Arr_{index}"

# If the variable was already declared, just assign the new value
# If the variable was already declared, just assign the new value
if name in self.declared_variables:
declaration = f"{name} = new {input_type}[]({length});\n"
else:
Expand Down
5 changes: 4 additions & 1 deletion fuzz_utils/fuzzers/Medusa.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ def parse_reproducer(self, file_path: str, calls: Any, index: int) -> str:

template = jinja2.Template(templates["TEST"])
return template.render(
function_name=function_name, call_list=call_list, file_path=file_path, has_low_level_call=has_low_level_call
function_name=function_name,
call_list=call_list,
file_path=file_path,
has_low_level_call=has_low_level_call,
)
# 1. Take a reproducer list and create a test file based on the name of the last function of the list e.g. test_auto_$function_name
# 2. For each object in the list process the call object and add it to the call list
Expand Down

0 comments on commit 456dbb0

Please sign in to comment.