mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-14 07:17:13 -04:00
fixes #255
This commit is contained in:
parent
076b82f363
commit
ec1fce6fec
@ -94,7 +94,7 @@ public final class PlainSwitch implements NodeInterface {
|
|||||||
else {
|
else {
|
||||||
constant = in2.searchConstant();
|
constant = in2.searchConstant();
|
||||||
if (constant != null)
|
if (constant != null)
|
||||||
return new UniDirectionalSwitch(constant, output1, setOpenContactToHighZ);
|
return new UniDirectionalSwitch(constant, output1, true);
|
||||||
else
|
else
|
||||||
return new RealSwitch(in1, in2);
|
return new RealSwitch(in1, in2);
|
||||||
}
|
}
|
||||||
|
@ -43,8 +43,8 @@ public class TestExamples extends TestCase {
|
|||||||
*/
|
*/
|
||||||
public void testTestExamples() throws Exception {
|
public void testTestExamples() throws Exception {
|
||||||
File examples = new File(Resources.getRoot(), "/dig/test");
|
File examples = new File(Resources.getRoot(), "/dig/test");
|
||||||
assertEquals(150, new FileScanner(this::check).scan(examples));
|
assertEquals(151, new FileScanner(this::check).scan(examples));
|
||||||
assertEquals(142, testCasesInFiles);
|
assertEquals(143, testCasesInFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
144
src/test/resources/dig/test/switch/const.dig
Normal file
144
src/test/resources/dig/test/switch/const.dig
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<circuit>
|
||||||
|
<version>1</version>
|
||||||
|
<attributes/>
|
||||||
|
<visualElements>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>PullDown</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="740" y="440"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>PullDown</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="680" y="440"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Const</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="660" y="320"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>RelayDT</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>rotation</string>
|
||||||
|
<rotation rotation="1"/>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="680" y="400"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Ground</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="640" y="420"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>In</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>A</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="600" y="340"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Out</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>Y_1</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="760" y="340"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Testcase</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Testdata</string>
|
||||||
|
<testData>
|
||||||
|
<dataString>A Y_1 Y_2
|
||||||
|
0 0 0
|
||||||
|
1 0 1
|
||||||
|
0 0 0
|
||||||
|
1 0 1
|
||||||
|
</dataString>
|
||||||
|
</testData>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="520" y="420"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Out</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Label</string>
|
||||||
|
<string>Y_2</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="760" y="420"/>
|
||||||
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>Text</elementName>
|
||||||
|
<elementAttributes>
|
||||||
|
<entry>
|
||||||
|
<string>Description</string>
|
||||||
|
<string>see issue #255</string>
|
||||||
|
</entry>
|
||||||
|
</elementAttributes>
|
||||||
|
<pos x="560" y="280"/>
|
||||||
|
</visualElement>
|
||||||
|
</visualElements>
|
||||||
|
<wires>
|
||||||
|
<wire>
|
||||||
|
<p1 x="660" y="320"/>
|
||||||
|
<p2 x="680" y="320"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="600" y="340"/>
|
||||||
|
<p2 x="640" y="340"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="700" y="340"/>
|
||||||
|
<p2 x="740" y="340"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="740" y="340"/>
|
||||||
|
<p2 x="760" y="340"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="680" y="420"/>
|
||||||
|
<p2 x="760" y="420"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="640" y="400"/>
|
||||||
|
<p2 x="640" y="420"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="640" y="340"/>
|
||||||
|
<p2 x="640" y="360"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="740" y="340"/>
|
||||||
|
<p2 x="740" y="440"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="680" y="320"/>
|
||||||
|
<p2 x="680" y="360"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="680" y="400"/>
|
||||||
|
<p2 x="680" y="420"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="680" y="420"/>
|
||||||
|
<p2 x="680" y="440"/>
|
||||||
|
</wire>
|
||||||
|
<wire>
|
||||||
|
<p1 x="700" y="340"/>
|
||||||
|
<p2 x="700" y="360"/>
|
||||||
|
</wire>
|
||||||
|
</wires>
|
||||||
|
</circuit>
|
Loading…
x
Reference in New Issue
Block a user