- assertBitArrayEquals(gate.getOut().getValues(), Bit.ONE, Bit.ONE, Bit.ZERO, Bit.ONE);\r
+ assertBitArrayEquals(c.getValues(), Bit.ONE, Bit.ONE, Bit.ZERO, Bit.ONE);\r
+ }\r
+ \r
+ @Test\r
+ void xorTest()\r
+ {\r
+ Simulation.TIMELINE.reset();\r
+ WireArray a = new WireArray(3, 1), b = new WireArray(3, 2), c = new WireArray(3, 1), d = new WireArray(3, 1);\r
+ new XorGate(1, d, a, b, c);\r
+ a.createInput().feedSignals(Bit.ZERO, Bit.ONE, Bit.ONE);\r
+ b.createInput().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE);\r
+ c.createInput().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE);\r
+\r
+ Simulation.TIMELINE.executeAll();\r
+\r
+ assertBitArrayEquals(d.getValues(), Bit.ZERO, Bit.ONE, Bit.ONE);\r