-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.py
33 lines (28 loc) · 823 Bytes
/
test.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
#########################################
# Algorytmy Grafowe 2019/2020 #
# Integracyjne testy automatyczne #
# Stanislaw Denkowski #
# Maciej Tratnowiecki #
#########################################
# Import wykorzystywanych modulow
import generator
import kdtree
import quadtree
from random import randint
if __name__=='__main__':
test = generator.generate_points(100)
kd = kdtree.Kdtree(test)
quad = quadtree.Quadtree(test)
v = 1000
while True:
xl = randint(-v,v)
xh = randint(-v,v)
yl = randint(-v,v)
yh = randint(-v,v)
s1 = kd.find(xl,xh,yl,yh)
s2 = quad.find(xl,xh,yl,yh)
if set(s1) != set(s2):
print("ERROR!")
print(test)
break
print("OK")