diff --git a/src/main/java/de/neemann/digital/core/switching/PlainSwitch.java b/src/main/java/de/neemann/digital/core/switching/PlainSwitch.java index 2f146abb3..23bfb8e23 100644 --- a/src/main/java/de/neemann/digital/core/switching/PlainSwitch.java +++ b/src/main/java/de/neemann/digital/core/switching/PlainSwitch.java @@ -94,7 +94,7 @@ public final class PlainSwitch implements NodeInterface { else { constant = in2.searchConstant(); if (constant != null) - return new UniDirectionalSwitch(constant, output1, setOpenContactToHighZ); + return new UniDirectionalSwitch(constant, output1, true); else return new RealSwitch(in1, in2); } diff --git a/src/test/java/de/neemann/digital/integration/TestExamples.java b/src/test/java/de/neemann/digital/integration/TestExamples.java index 3667b6eeb..fd48cf4c7 100644 --- a/src/test/java/de/neemann/digital/integration/TestExamples.java +++ b/src/test/java/de/neemann/digital/integration/TestExamples.java @@ -43,8 +43,8 @@ public class TestExamples extends TestCase { */ public void testTestExamples() throws Exception { File examples = new File(Resources.getRoot(), "/dig/test"); - assertEquals(150, new FileScanner(this::check).scan(examples)); - assertEquals(142, testCasesInFiles); + assertEquals(151, new FileScanner(this::check).scan(examples)); + assertEquals(143, testCasesInFiles); } /** diff --git a/src/test/resources/dig/test/switch/const.dig b/src/test/resources/dig/test/switch/const.dig new file mode 100644 index 000000000..10ffada4e --- /dev/null +++ b/src/test/resources/dig/test/switch/const.dig @@ -0,0 +1,144 @@ + + + 1 + + + + PullDown + + + + + PullDown + + + + + Const + + + + + RelayDT + + + rotation + + + + + + + Ground + + + + + In + + + Label + A + + + + + + Out + + + Label + Y_1 + + + + + + Testcase + + + Testdata + + A Y_1 Y_2 +0 0 0 +1 0 1 +0 0 0 +1 0 1 + + + + + + + + Out + + + Label + Y_2 + + + + + + Text + + + Description + see issue #255 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file