-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFuzzTestScript.py
executable file
·123 lines (112 loc) · 3.29 KB
/
FuzzTestScript.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/env python3
import string
import random
# scaling oracle, outputs should be the same for each of these shape text files
test_file_count = 1
print("\n______________ Squares")
square = [2, 0, 2, 2, 0, 2]
for i in range(1, 50, 5):
fileName = str(test_file_count) + '.txt'
test_file_count += 1
f = open(fileName, "w+")
my_new_list = [j * i for j in square]
tokens = ' '.join(map(str, my_new_list))
f.write(tokens)
#print(tokens)
#print(fileName)
f.close()
print("\n______________ Rectangles")
rectangle = [2, 0, 2, 1, 0, 1]
rectangle2 = [1, 0, 1, 2, 0, 2]
for i in range(1, 50, 5):
fileName = str(test_file_count) + '.txt'
test_file_count += 1
f = open(fileName, "w+")
my_new_list = [j * i for j in rectangle]
tokens = ' '.join(map(str, my_new_list))
f.write(tokens)
#print(tokens)
#print(fileName)
f.close()
for i in range(1, 50, 5):
fileName = str(test_file_count) + '.txt'
test_file_count += 1
f = open(fileName, "w+")
my_new_list = [j * i for j in rectangle2]
tokens = ' '.join(map(str, my_new_list))
f.write(tokens)
#print(tokens)
#print(fileName)
f.close()
print("\nMaking Rhombi")
rhombus = [5, 0, 8, 4, 3, 4]
for i in range(1, 11):
fileName = str(test_file_count) + '.txt'
test_file_count += 1
f = open(fileName, "w+")
my_new_list = [j * i for j in rhombus]
tokens = ' '.join(map(str, my_new_list))
f.write(tokens)
#print(tokens)
#print(fileName)
f.close()
print("\nMaking Trapezoids")
trapezoid = [3, 0, 3, 1, 2, 1]
for i in range(1, 31, 3):
fileName = str(test_file_count) + '.txt'
test_file_count += 1
f = open(fileName, "w+")
my_new_list = [j * i for j in trapezoid]
tokens = ' '.join(map(str, my_new_list))
f.write(tokens)
#print(tokens)
#print(fileName)
f.close()
print("\nMaking Kites")
kite = [2, 1, 2, 2, 1, 2]
for i in range(1, 51, 5):
fileName = str(test_file_count) + '.txt'
test_file_count += 1
f = open(fileName, "w+")
my_new_list = [j * i for j in kite]
tokens = ' '.join(map(str, my_new_list))
f.write(tokens)
#print(tokens)
#print(fileName)
f.close()
print("\nMaking Quadrilaterals")
parallelogram = [2, 0, 3, 1, 0, 3]
for i in range(1, 31, 3):
fileName = str(test_file_count) + '.txt'
test_file_count += 1
f = open(fileName, "w+")
my_new_list = [j * i for j in parallelogram]
tokens = ' '.join(map(str, my_new_list))
f.write(tokens)
#print(tokens)
#print(fileName)
f.close()
print("\n______________ Random ints")
# random ints text files
for i in range(1, 667):
fileName = str(test_file_count) + '.txt'
test_file_count += 1
f = open(fileName, "w+")
for j in range(6):
token = random.randint(0, 150) # so err toward less than, but allow greater than 100
f.write(str(token) + ' ')
#print(str(token))
#print(fileName)
f.close()
print("\n______________ Random ASCII")
# Now open for ASCII hell
for i in range(667, 1001):
fileName = str(test_file_count) + '.txt'
test_file_count += 1
f = open(fileName, "w+")
for j in range(6):
token = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(2))
f.write(str(token) + ' ')
#print(token)
#print(fileName)
f.close()