no pad option

This commit is contained in:
agroce
2019-05-21 10:36:56 -07:00
parent 831b9918f8
commit cd116c0ad2
+8 -4
View File
@@ -64,6 +64,9 @@ def main():
parser.add_argument(
"--noStructure", action='store_true',
help="Don't use test structure.")
parser.add_argument(
"--noPad", action='store_true',
help="Don't pad test with zeros.")
class TimeoutException(Exception):
pass
@@ -494,10 +497,11 @@ def main():
print("Completed", iteration, "iterations:", round(time.time()-start, 2), "secs /",
candidateRuns, "execs /", str(round(percent, 2)) + "% reduction")
if (s[1] + 1) > len(currentTest):
print("Padding test with", (s[1] + 1) - len(currentTest), "zeroes")
padding = bytearray('\x00' * ((s[1] + 1) - len(currentTest)), 'utf-8')
currentTest = currentTest + padding
if not args.noPad:
if (s[1] + 1) > len(currentTest):
print("Padding test with", (s[1] + 1) - len(currentTest), "zeroes")
padding = bytearray('\x00' * ((s[1] + 1) - len(currentTest)), 'utf-8')
currentTest = currentTest + padding
print("Writing reduced test with", len(currentTest), "bytes to", out)