X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Ftests%2FComponentTest.java;h=cc170cb77996fc97815f316a242dd875ff4344d9;hb=8372838271933fd0a8b363d01e8f20bc43a4ead8;hp=0505b4cef9d04ac8cc7dac0d801d5e9c1f224253;hpb=28ad9cb1eea7862b1850fb7fc1fc9e4627c9f818;p=Mograsim.git diff --git a/net.mograsim.logic.core/src/net/mograsim/logic/core/tests/ComponentTest.java b/net.mograsim.logic.core/src/net/mograsim/logic/core/tests/ComponentTest.java index 0505b4ce..cc170cb7 100644 --- a/net.mograsim.logic.core/src/net/mograsim/logic/core/tests/ComponentTest.java +++ b/net.mograsim.logic.core/src/net/mograsim/logic/core/tests/ComponentTest.java @@ -88,7 +88,7 @@ class ComponentTest } @Test - void fusionTest() + void fusionTest1() { t.reset(); Wire a = new Wire(t, 3, 1), b = new Wire(t, 2, 1), c = new Wire(t, 3, 1), out = new Wire(t, 8, 1); @@ -117,6 +117,17 @@ class ComponentTest assertBitArrayEquals(rC.getValues(), Bit.ZERO, Bit.ONE, Bit.ZERO); } + @Test + void fusionTest2() + { + t.reset(); + Wire a = new Wire(t, 3, 1), b = new Wire(t, 3, 1); + Wire.fuse(a, b); + a.createReadWriteEnd().feedSignals(Bit.ONE, Bit.U, Bit.Z); + t.executeAll(); + assertBitArrayEquals(b.getValues(), Bit.ONE, Bit.U, Bit.Z); + } + @Test void triStateBufferTest() { @@ -430,7 +441,7 @@ class ComponentTest TestBitDisplay test = new TestBitDisplay(t, c.createReadOnlyEnd()); TestBitDisplay test2 = new TestBitDisplay(t, a.createReadOnlyEnd()); - LongConsumer print = time -> System.out.format("Time %2d\n a: %s\n b: %s\n c: %s\n", time, a, b, c); + LongConsumer print = time -> System.out.format("Time %2d\n a: %s\n b: %s\n c: %s\n", time, a, b, c); cI.feedSignals(Bit.ONE); test.assertAfterSimulationIs(print, Bit.ONE);