X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.core%2Ftest%2Fnet%2Fmograsim%2Flogic%2Fcore%2Ftests%2FTestBitDisplay.java;fp=net.mograsim.logic.core%2Ftest%2Fnet%2Fmograsim%2Flogic%2Fcore%2Ftests%2FTestBitDisplay.java;h=0000000000000000000000000000000000000000;hb=0a04a4ed66ecebd4254541c4977599f6052c115a;hp=015e257fd621cac297feb15c94da18abbbfa8a74;hpb=9b4850366c29fbd800ee8df1858c398d8c35a0c0;p=Mograsim.git diff --git a/net.mograsim.logic.core/test/net/mograsim/logic/core/tests/TestBitDisplay.java b/net.mograsim.logic.core/test/net/mograsim/logic/core/tests/TestBitDisplay.java deleted file mode 100644 index 015e257f..00000000 --- a/net.mograsim.logic.core/test/net/mograsim/logic/core/tests/TestBitDisplay.java +++ /dev/null @@ -1,47 +0,0 @@ -package net.mograsim.logic.core.tests; - -import static org.junit.jupiter.api.Assertions.assertArrayEquals; - -import java.util.function.LongConsumer; - -import net.mograsim.logic.core.components.BitDisplay; -import net.mograsim.logic.core.timeline.Timeline; -import net.mograsim.logic.core.types.Bit; -import net.mograsim.logic.core.wires.Wire.ReadEnd; - -public final class TestBitDisplay extends BitDisplay -{ - - public TestBitDisplay(Timeline timeline, ReadEnd in) - { - super(timeline, in); - } - - public void assertDisplays(Bit... expected) - { - assertArrayEquals(expected, getDisplayedValue().getBits()); - } - - public void assertAfterSimulationIs(Bit... expected) - { - timeline.executeAll(); - assertDisplays(expected); - } - - public void assertAfterSimulationIs(LongConsumer r, Bit... expected) - { - while (timeline.hasNext()) - { - timeline.executeNext(); - r.accept(timeline.getSimulationTime()); - } - assertDisplays(expected); - } - - @Override - protected void compute() - { - super.compute(); - System.out.println("update: value is " + getDisplayedValue()); - } -}