use of de.neemann.digital.core.BurnException in project Digital by hneemann.
the class DataBusTest method testSimple.
public void testSimple() throws PinException, NodeException {
ObservableValue a = new ObservableValue("a", 4).setToHighZ();
ObservableValue b = new ObservableValue("b", 4).setToHighZ();
Model m = new Model();
ObservableValue out = new DataBus(null, m, a, b).getReadableOutput();
a.setValue(1);
assertEquals(1, out.getValue());
a.setToHighZ();
b.setValue(2);
assertEquals(2, out.getValue());
b.setToHighZ();
// try { ToDo HighZ
// out.getValue();
// assertTrue(false);
// } catch (HighZException e) {
// assertTrue(true);
// }
a.setValue(1);
b.setValue(1);
m.doStep();
a.setValue(0);
b.setValue(0);
m.doStep();
a.setValue(1);
b.setValue(0);
try {
m.doStep();
assertTrue(true);
} catch (BurnException e) {
assertTrue(true);
}
}
Aggregations