1
0
mirror of https://github.com/myhdl/myhdl.git synced 2025-01-24 21:52:56 +08:00

added test for issue169

This commit is contained in:
srivatsansoft 2016-05-24 22:46:15 +05:30
parent 7f068bb0ea
commit eb770a199d

View File

@ -0,0 +1,56 @@
from myhdl import Signal, block, delay, instance
import pytest
class Test1:
def __init__(self):
self.clock = Signal(bool(0))
@block
def test(self):
@instance
def func():
while True:
yield delay(10)
self.clock.next = not self.clock
return func
class Test2:
def __init__(self):
self.clock = Signal(bool(1))
@block
def test(self):
@instance
def func():
while True:
yield delay(10)
self.clock.next = not self.clock
return func
@block
def test_bench():
inst1 = Test1()
inst2 = Test2()
# Two instances are created
ins1 = inst1.test()
ins2 = inst2.test()
return ins1, ins2
@pytest.mark.xfail
def test_issue_169():
test_inst = testbench()
assert test_inst.verify_convert() == 0
if __name__ == '__main__':
test_issue_169()