@@ -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-
198160def 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 )
0 commit comments