From 4a3a1bc5b0c0476ad62223e5e41f06e2167e67c7 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 17 Sep 2015 17:22:59 +0800 Subject: [PATCH] test/coding: use new API --- migen/test/test_coding.py | 105 ++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 49 deletions(-) diff --git a/migen/test/test_coding.py b/migen/test/test_coding.py index 4cbca178..965a7e97 100644 --- a/migen/test/test_coding.py +++ b/migen/test/test_coding.py @@ -3,11 +3,11 @@ import unittest from migen import * from migen.genlib.coding import * -from migen.test.support import SimCase, SimBench +from migen.test.support import SimCase class EncCase(SimCase, unittest.TestCase): - class TestBench(SimBench): + class TestBench(Module): def __init__(self): self.submodules.dut = Encoder(8) @@ -18,18 +18,20 @@ class EncCase(SimCase, unittest.TestCase): def test_run_sequence(self): seq = list(range(1<<8)) - def cb(tb, tbp): - if seq: - tbp.dut.i = seq.pop(0) - if tbp.dut.n: - self.assertNotIn(tbp.dut.i, [1< 0: - self.assertEqual(i & 1<<(o - 1), 0) - self.assertGreaterEqual(i, 1< 0: + self.assertEqual(i & 1<<(o - 1), 0) + self.assertGreaterEqual(i, 1< 0: - self.assertEqual(i & 1<<(o - 1), 0) - self.assertGreaterEqual(i, 1< 0: + self.assertEqual(i & 1<<(o - 1), 0) + self.assertGreaterEqual(i, 1<