Skip to content
Snippets Groups Projects
Commit c200e914 authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Corrected and added test

parent 4f4d43db
No related branches found
No related tags found
2 merge requests!71Better schedule, including plotting,!69Some basic functionality for plotting a schedule
This commit is part of merge request !71. Comments created here will be created in the context of that merge request.
......@@ -189,13 +189,21 @@ class TestExecutionTime:
class TestCopyOperation:
def test_copy_buttefly_latency_offsets(self):
def test_copy_butterfly_latency_offsets(self):
bfly = Butterfly(latency_offsets={'in0': 4, 'in1': 2, 'out0': 10, 'out1': 9})
bfly_copy = bfly.copy_component()
assert bfly_copy.latency_offsets == {'in0': 4, 'in1': 2, 'out0': 10, 'out1': 9}
def test_copy_execution_time(self):
add = Addition()
add.execution_time = 2
add_copy = add.copy_component()
assert add_copy.execution_time == 2
class TestPlotCoordinates():
def test_simple_case(self):
......@@ -209,11 +217,11 @@ class TestPlotCoordinates():
def test_complicated_case():
bfly = Butterfly(latency_offsets={'in0': 2, 'in1': 3, 'out0': 5, 'out1': 10})
bfly.set_execution_time(7)
bfly.execution_time(7)
lat, exe = bfly.get_plot_coordinates()
assert lat = [[2, 0], [2, 0.5], [3, 0.5], [3, 1], [10, 1], [10, 0.5], [5, 0.5], [5, 0], [2, 0]]
assert exe = [[0, 0], [0, 1], [7, 1], [7, 0], [0, 0]]
assert lat == [[2, 0], [2, 0.5], [3, 0.5], [3, 1], [10, 1], [10, 0.5], [5, 0.5], [5, 0], [2, 0]]
assert exe == [[0, 0], [0, 1], [7, 1], [7, 0], [0, 0]]
class TestIOCoordinates():
......@@ -231,5 +239,5 @@ class TestIOCoordinates():
bfly.set_execution_time(7)
i_c, o_c = bfly.get_io_coordinates()
assert i_c = [[2, 0.25], [3, 0.75]]
assert o_c = [[5, 0.25], [10, 0.75]]
assert i_c == [[2, 0.25], [3, 0.75]]
assert o_c == [[5, 0.25], [10, 0.75]]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment