Skip to content
Snippets Groups Projects
Commit 5ca593d6 authored by Kevin's avatar Kevin
Browse files

Added some tests and function definition

parent 08eaa299
Branches 82-explode-sfg
No related tags found
No related merge requests found
Pipeline #15401 failed
......@@ -543,6 +543,12 @@ class SFG(AbstractOperation):
# Recreate the newly coupled SFG so that all attributes are correct.
return sfg_copy()
def explode(self) -> Tuple[Sequence[Signal, Sequence[Signal]], Sequence[Tuple[Signal, Sequence[Signal]]]:
"""Destroy the sfg by making it unusable in the future and
return all of the intermidetry operations, the input operations and the output operations.
"""
return
def _evaluate_source(self, src: OutputPort, results: MutableOutputMap, registers: MutableRegisterMap, prefix: str) -> Number:
src_prefix = prefix
if src_prefix:
......
......@@ -319,6 +319,22 @@ class TestInsertComponent:
assert _sfg.find_by_name("bfly2")[0].input(0).signals[0].source.operation is _sfg.find_by_name("n_bfly")[0]
assert _sfg.find_by_name("bfly2")[0].input(1).signals[0].source.operation is _sfg.find_by_name("n_bfly")[0]
class TestExplode:
def test_correct_lengths(self, large_operation_tree):
sfg = SFG(outputs=[Output(large_operation_tree)])
operations, inputs, outputs = sfg.explode()
assert len(operations) == 3
assert len(inputs) == 4
assert len(outputs) == 1
def test_sfg_unusable(self, large_operation_tree):
sfg = SFG(outputs=[Output(large_operation_tree)])
sfg.explode()
assert sfg is None
def test_functions_of_sfg_used(self):
with pytest.raises(AssertionError):
pass
class TestFindComponentsWithTypeName:
def test_mac_components(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment