Skip to content

Commit 4d7da98

Browse files
committed
Fix lint
1 parent 8bae806 commit 4d7da98

3 files changed

Lines changed: 3 additions & 48 deletions

File tree

kafl_fuzzer/tests/test_deterministic.py

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -157,49 +157,11 @@ def verifier(_, label=None):
157157
if not skip_null and not eff_map:
158158
assert(calls == loops * length - skips)
159159

160-
# def assert_bitflip_invariants(func, flipped_bits, loops, skips, irp_list, index):
161-
# """
162-
# Verifies bitflip mutators using IRP structure.
163-
# Ensures each mutation flips the expected number of bits, and the IRP input is restored.
164-
# """
165-
166-
# original = irp_list[index].InBuffer[:]
167-
# length = irp_list[index].InBuffer_length
168-
169-
# for skip_null in [False, True]:
170-
# for use_eff_map in [True, False]:
171-
# eff_map = generate_effector_map(length) if use_eff_map else None
172-
173-
# calls = 0
174-
175-
# def verifier(irp_list, label=None):
176-
# outdata = irp_list[index].InBuffer
177-
# nonlocal calls
178-
# calls += 1
179-
180-
# # Special case: walking_byte's first call with effector map skips mutation
181-
# if calls == 1 and use_eff_map and func == mutate_seq_walking_byte:
182-
# assert ham_distance(original, outdata) == 0
183-
# else:
184-
# assert ham_distance(original, outdata) == flipped_bits, \
185-
# f"Bitflips mismatch on call {calls}:\n{hexlify(original)}\n{hexlify(outdata)}"
186-
187-
# return False, False
188-
189-
# func(irp_list, index, verifier, effector_map=eff_map, skip_null=skip_null)
190-
191-
# # Ensure mutation did not persist
192-
# assert irp_list[index].InBuffer == original
193-
194-
# if not skip_null and not eff_map:
195-
# assert calls == loops * length - skips
196-
197-
198160
def test_invariants(v=False):
199161

200162
payloads = []
201163
for length in [range(0, 3), 16, 23, 33]:
202-
payloads.append(rand.bytes(32)) # 그대로 유지
164+
payloads.append(rand.bytes(32))
203165

204166
irp_list, _ = generate_irp_payloads(payloads)
205167

@@ -254,7 +216,7 @@ def test_arith_8_call_num():
254216
irp_list, _ = generate_irp_payloads(payloads)
255217

256218
for index in range(len(irp_list)):
257-
loops = InBufferLength = irp_list[index].InBuffer_length
219+
loops = irp_list[index].InBuffer_length
258220
ops = 2 * (AFL_ARITH_MAX - 1 - 6)
259221
expected_calls = loops * ops
260222
assert_func_num_calls(func, irp_list, index, expected_calls)

kafl_fuzzer/tests/test_insns.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
import struct
2-
import os
32
import pytest
4-
from binascii import hexlify
53
from kafl_fuzzer.technique.havoc import (
64
mutate_seq_havoc_array,
75
mutate_seq_splice_array,
86
mutate_random_sequence,
9-
mutate_length,
10-
init_havoc
7+
mutate_length
118
)
129
from kafl_fuzzer.common.util import IRP, interface_manager
13-
from kafl_fuzzer.tests.helper import ham_distance
14-
from kafl_fuzzer.technique.helper import rand
1510
import kafl_fuzzer.technique.havoc as havoc
1611

1712
# Setup required for splice and dependency tests

kafl_fuzzer/tests/test_random.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
import struct
99
import timeit
1010
import random
11-
from binascii import hexlify
1211

1312
from kafl_fuzzer.technique.helper import rand
1413
from kafl_fuzzer.common.util import IRP
15-
from kafl_fuzzer.tests.helper import ham_distance
1614

1715
ITERATIONS = 5000
1816

0 commit comments

Comments
 (0)