Skip to content

Commit

Permalink
tests work
Browse files Browse the repository at this point in the history
  • Loading branch information
varunrau committed Dec 2, 2012
1 parent b5d9a7c commit fb8445c
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 19 deletions.
5 changes: 2 additions & 3 deletions CompileTimeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@
for line in fileinput.input(testFile): #replace SD() with a d.s.
line = line.replace("SD()", "SD(True, " + str(dataStructures[i]) + ")")
file.write(line)

file.close()

start_time = time.time()
execfile(newFileName)
elapsedTime = time.time() - start_time
dataStructureTimes.append(elapsedTime)

for i in range(len(dataStructures)):
for i in range(len(dataStructures)):
print ("Time using %s: %s" % (dataStructures[i], dataStructureTimes[i]))





2 changes: 1 addition & 1 deletion DS.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ class DS:
MIN_HEAP = 3
MAX_HEAP = 4
HASHTABLE = 5
NUM_STRUCTURES = 7
NUM_STRUCTURES = 5

Binary file added DS.pyc
Binary file not shown.
Binary file added arr.pyc
Binary file not shown.
Binary file added bst.pyc
Binary file not shown.
Binary file added btree.pyc
Binary file not shown.
Binary file added main.pyc
Binary file not shown.
Binary file added maxheap.pyc
Binary file not shown.
Binary file added minheap.pyc
Binary file not shown.
Binary file added sarr.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def test():
s_data.len = 0

for x in choice([x for x in itertools.permutations(range(10))]):
for x in choice([x for x in itertools.permutations(range(100))]):
s_data.add(x)

print(str(s_data.contains(3)) + " should be true")
Expand Down
7 changes: 5 additions & 2 deletions test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
def test():
s_data.len = 0

for x in choice([x for x in itertools.permutations(range(10))]):
s_data.add(x)
for c in range(10000):
for x in choice([x for x in itertools.permutations(range(5))]):
s_data.add(x)

print "size = " + str(s_data.len)

print(str(s_data.contains(3)) + " should be true")

Expand Down
7 changes: 5 additions & 2 deletions test_compile_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
def test():
s_data.len = 0

for x in choice([x for x in itertools.permutations(range(10))]):
s_data.add(x)
for c in range(10000):
for x in choice([x for x in itertools.permutations(range(5))]):
s_data.add(x)

print "size = " + str(s_data.len)

print(str(s_data.contains(3)) + " should be true")

Expand Down
7 changes: 5 additions & 2 deletions test_compile_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
def test():
s_data.len = 0

for x in choice([x for x in itertools.permutations(range(10))]):
s_data.add(x)
for c in range(10000):
for x in choice([x for x in itertools.permutations(range(5))]):
s_data.add(x)

print "size = " + str(s_data.len)

print(str(s_data.contains(3)) + " should be true")

Expand Down
7 changes: 5 additions & 2 deletions test_compile_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
def test():
s_data.len = 0

for x in choice([x for x in itertools.permutations(range(10))]):
s_data.add(x)
for c in range(10000):
for x in choice([x for x in itertools.permutations(range(5))]):
s_data.add(x)

print "size = " + str(s_data.len)

print(str(s_data.contains(3)) + " should be true")

Expand Down
7 changes: 5 additions & 2 deletions test_compile_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
def test():
s_data.len = 0

for x in choice([x for x in itertools.permutations(range(10))]):
s_data.add(x)
for c in range(10000):
for x in choice([x for x in itertools.permutations(range(5))]):
s_data.add(x)

print "size = " + str(s_data.len)

print(str(s_data.contains(3)) + " should be true")

Expand Down
7 changes: 5 additions & 2 deletions test_compile_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
def test():
s_data.len = 0

for x in choice([x for x in itertools.permutations(range(10))]):
s_data.add(x)
for c in range(10000):
for x in choice([x for x in itertools.permutations(range(5))]):
s_data.add(x)

print "size = " + str(s_data.len)

print(str(s_data.contains(3)) + " should be true")

Expand Down
2 changes: 1 addition & 1 deletion test_compile_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ def test():

print(str(s_data.get(0)) + " should be 0")

s_data = SD(5, True)
s_data = SD(True, 5)
test()
2 changes: 1 addition & 1 deletion test_compile_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ def test():

print(str(s_data.get(0)) + " should be 0")

s_data = SD(6, True)
s_data = SD(True, 6)
test()

0 comments on commit fb8445c

Please sign in to comment.