From 92b970bd47b5ebef401e5dc81e2ddceab42b6eaf Mon Sep 17 00:00:00 2001 From: hneemann Date: Tue, 28 Feb 2017 09:08:06 +0100 Subject: [PATCH] added some test cases --- .../digital/integration/TestExamples.java | 4 +- .../resources/dig/test/switch/switch_pull.dig | 519 ++++++++++++++++++ .../dig/test/switch/switch_simple.dig | 415 ++++++++++++++ 3 files changed, 936 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/dig/test/switch/switch_pull.dig create mode 100644 src/test/resources/dig/test/switch/switch_simple.dig diff --git a/src/test/java/de/neemann/digital/integration/TestExamples.java b/src/test/java/de/neemann/digital/integration/TestExamples.java index cb368b500..02bac18a6 100644 --- a/src/test/java/de/neemann/digital/integration/TestExamples.java +++ b/src/test/java/de/neemann/digital/integration/TestExamples.java @@ -39,8 +39,8 @@ public class TestExamples extends TestCase { */ public void testTestExamples() throws Exception { File examples = new File(Resources.getRoot(), "/dig/test"); - assertEquals(43, new FileScanner(this::check).scan(examples)); - assertEquals(35, testCasesInFiles); + assertEquals(45, new FileScanner(this::check).scan(examples)); + assertEquals(37, testCasesInFiles); } diff --git a/src/test/resources/dig/test/switch/switch_pull.dig b/src/test/resources/dig/test/switch/switch_pull.dig new file mode 100644 index 000000000..07d0c5028 --- /dev/null +++ b/src/test/resources/dig/test/switch/switch_pull.dig @@ -0,0 +1,519 @@ + + + 1 + + + Relay + + + + + In + + + Label + A + + + + + + PullUp + + + + + Out + + + Label + Y1 + + + + + + Ground + + + + + Relay + + + + + Out + + + Label + Y2 + + + + + + Ground + + + + + PullDown + + + + + Relay + + + + + PullUp + + + + + Out + + + Label + Y3 + + + + + + Relay + + + + + Out + + + Label + Y4 + + + + + + PullDown + + + + + VDD + + + + + VDD + + + + + Testcase + + + Testdata + + A Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 +0 1 0 1 0 1 0 1 0 +1 0 0 1 1 0 0 1 1 +0 1 0 1 0 1 0 1 0 +1 0 0 1 1 0 0 1 1 + + + + + + + + Relay + + + rotation + + + + + + + PullUp + + + + + Out + + + Label + Y5 + + + + + + Ground + + + + + Relay + + + rotation + + + + + + + Out + + + Label + Y6 + + + + + + Ground + + + + + PullDown + + + + + Relay + + + rotation + + + + + + + PullUp + + + + + Out + + + Label + Y7 + + + + + + Relay + + + rotation + + + + + + + Out + + + Label + Y8 + + + + + + PullDown + + + + + VDD + + + + + VDD + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/dig/test/switch/switch_simple.dig b/src/test/resources/dig/test/switch/switch_simple.dig new file mode 100644 index 000000000..fdc4bcf0d --- /dev/null +++ b/src/test/resources/dig/test/switch/switch_simple.dig @@ -0,0 +1,415 @@ + + + 1 + + + Relay + + + + + In + + + Label + A + + + + + + Out + + + Label + Y1 + + + + + + Ground + + + + + Relay + + + + + Out + + + Label + Y2 + + + + + + Ground + + + + + Relay + + + + + Out + + + Label + Y3 + + + + + + Relay + + + + + Out + + + Label + Y4 + + + + + + VDD + + + + + VDD + + + + + Testcase + + + Testdata + + A Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 +0 z z z z z z z z +1 0 0 1 1 0 0 1 1 +0 z z z z z z z z +1 0 0 1 1 0 0 1 1 + + + + + + + + Relay + + + rotation + + + + + + + Out + + + Label + Y5 + + + + + + Ground + + + + + Relay + + + rotation + + + + + + + Out + + + Label + Y6 + + + + + + Ground + + + + + Relay + + + rotation + + + + + + + Out + + + Label + Y7 + + + + + + Relay + + + rotation + + + + + + + Out + + + Label + Y8 + + + + + + VDD + + + + + VDD + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file