Commit 86fd252b authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[lib] TestCLUnfolder: Adapt to CLUnfolder changes

parent 88fbb30e
......@@ -224,9 +224,9 @@ class TestCLUnfolder(unittest.TestCase):
model = model1()
unfolder = create_unfolder(model)
# test frontier: should be n1
cfr = unfolder.get_frontier()[0]
cfr = unfolder.frontier_values[0]
res = unfolder.get_var_name(cfr) == 'n1'
res = res and (len(unfolder.get_frontier()) == 1)
res = res and (len(unfolder.frontier_values) == 1)
self.assert_(res,'Error in frontier: model1')
# model2 (one cycle without start)
......@@ -234,9 +234,9 @@ class TestCLUnfolder(unittest.TestCase):
unfolder = create_unfolder(model)
# test frontier: should be n1
cfr = unfolder.get_frontier()[0]
cfr = unfolder.frontier_values[0]
res = unfolder.get_var_name(cfr) == 'n1'
res = res and (len(unfolder.get_frontier()) == 1)
res = res and (len(unfolder.frontier_values) == 1)
self.assert_(res,'Error in frontier: model2')
# model3: same as model2 but with a start on n3
......@@ -244,7 +244,7 @@ class TestCLUnfolder(unittest.TestCase):
unfolder = create_unfolder(model)
# test frontier - should be {n1, n3}
cfr = unfolder.get_frontier()
cfr = unfolder.frontier_values
res = len(cfr) == 2
res = res and unfolder.get_var_name(cfr[0]) == 'n1'
res = res and unfolder.get_var_name(cfr[1]) == 'n3'
......@@ -253,7 +253,7 @@ class TestCLUnfolder(unittest.TestCase):
# model4
model = model4()
unfolder = create_unfolder(model)
cfr = unfolder.get_frontier()
cfr = unfolder.frontier_values
res = len(cfr) == 0
# res = res and unfolder.get_var_name(cfr[0]) == 'n3'
self.assert_(res,'Error in frontier: model4')
......@@ -278,14 +278,16 @@ class TestCLUnfolder(unittest.TestCase):
unfolder = create_unfolder(model)
lfc = unfolder.get_free_clocks()
res = len(lfc) == 2
res = res and (unfolder.get_var_name(lfc[0]) == 'hh2')
res = res and (unfolder.get_var_name(lfc[1]) == 'hh1')
found_names = {unfolder.get_var_name(clock) for clock in lfc}
res = found_names == {'hh2', 'hh1'}
self.assert_(res,'Error in free clocks: model4')
lin = unfolder.get_inputs()
res = len(lin) == 1
res = res and (unfolder.get_var_name(lin[0]) == 'in1')
found_names = {unfolder.get_var_name(inpt) for inpt in lin}
res = found_names == {'in1'}
self.assert_(res,'Error in inputs: model4')
@unittest.skip("Test is not implemented")
def test_init_forward(self):
"""
test forward initialization for various models and property
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment