From 83126adb1b408b958ac818ed4812b56c02f4571e Mon Sep 17 00:00:00 2001 From: hneemann Date: Tue, 24 Sep 2019 20:36:31 +0200 Subject: [PATCH] added a 64 bit counter overflow test --- .../digital/integration/TestExamples.java | 4 +- .../dig/test/{ => counter}/cascadeCounter.dig | 0 .../resources/dig/test/counter/overflow.dig | 171 ++++++++++++++++++ 3 files changed, 173 insertions(+), 2 deletions(-) rename src/test/resources/dig/test/{ => counter}/cascadeCounter.dig (100%) create mode 100644 src/test/resources/dig/test/counter/overflow.dig diff --git a/src/test/java/de/neemann/digital/integration/TestExamples.java b/src/test/java/de/neemann/digital/integration/TestExamples.java index cb221586e..7b6da1853 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(183, new FileScanner(this::check).scan(examples)); - assertEquals(171, testCasesInFiles); + assertEquals(184, new FileScanner(this::check).scan(examples)); + assertEquals(172, testCasesInFiles); } /** diff --git a/src/test/resources/dig/test/cascadeCounter.dig b/src/test/resources/dig/test/counter/cascadeCounter.dig similarity index 100% rename from src/test/resources/dig/test/cascadeCounter.dig rename to src/test/resources/dig/test/counter/cascadeCounter.dig diff --git a/src/test/resources/dig/test/counter/overflow.dig b/src/test/resources/dig/test/counter/overflow.dig new file mode 100644 index 000000000..093c5f457 --- /dev/null +++ b/src/test/resources/dig/test/counter/overflow.dig @@ -0,0 +1,171 @@ + + + 1 + + + + Out + + + Label + Out + + + Bits + 64 + + + + + + Clock + + + Label + Clk + + + + + + Testcase + + + Testdata + + Clk ld In Out ov +c 1 0xfffffffffffffffe 0xfffffffffffffffe 0 +0 0 0 0xfffffffffffffffe 0 +c 0 0 0xffffffffffffffff 1 +c 0 0 0 0 + + + + + + + + CounterPreset + + + Bits + 64 + + + + + + Out + + + Label + ov + + + + + + VDD + + + + + Ground + + + + + Const + + + Value + 0 + + + + + + In + + + Label + In + + + Bits + 64 + + + + + + In + + + Label + ld + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file