use of de.neemann.digital.core.basic.XOr in project Digital by hneemann.
the class TestTrans method testTrans.
public void testTrans() throws Exception {
Model model = new ToBreakRunner("dig/test/transp/transtest3.dig").getModel();
assertEquals(2, model.getInputs().size());
assertEquals(1, model.getOutputs().size());
assertEquals(1, model.getNodes().size());
Node node = model.getNodes().get(0);
assertTrue(node instanceof XOr);
XOr xor = (XOr) node;
// The models inputs are the xor input values!
// All the intermediate transparent stuff is removed!
ArrayList<ObservableValue> ins = new ArrayList<>();
for (Signal s : model.getInputs()) ins.add(s.getValue());
assertTrue(ins.contains(xor.getInputs().get(0)));
assertTrue(ins.contains(xor.getInputs().get(1)));
}