From: Bob J. <jac...@us...> - 2004-04-21 23:47:37
|
Update of /cvsroot/jmri/test/jmri/jmrix/cmri/serial In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11066 Modified Files: SerialNodeTest.java Log Message: tests of new member functions Index: SerialNodeTest.java =================================================================== RCS file: /cvsroot/jmri/test/jmri/jmrix/cmri/serial/SerialNodeTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SerialNodeTest.java 20 Aug 2003 04:22:46 -0000 1.5 --- SerialNodeTest.java 21 Apr 2004 23:44:58 -0000 1.6 *************** *** 16,19 **** --- 16,43 ---- public class SerialNodeTest extends TestCase { + public void testCountInput1() { + SerialNode a = new SerialNode(); + a.cardTypeLocation = new byte[]{SerialNode.INPUT_CARD, SerialNode.NO_CARD, SerialNode.OUTPUT_CARD}; + Assert.assertEquals("check 1 cards, not in order", 1, a.numInputCards()); + } + + public void testCountInput2() { + SerialNode a = new SerialNode(); + a.cardTypeLocation = new byte[]{SerialNode.INPUT_CARD, SerialNode.NO_CARD, SerialNode.INPUT_CARD}; + Assert.assertEquals("check 2 cards, not in order", 2, a.numInputCards()); + } + + public void testCountOutput0() { + SerialNode a = new SerialNode(); + a.cardTypeLocation = new byte[]{SerialNode.INPUT_CARD, SerialNode.NO_CARD, SerialNode.INPUT_CARD}; + Assert.assertEquals("check 0 cards", 0, a.numOutputCards()); + } + + public void testCountOutput2() { + SerialNode a = new SerialNode(); + a.cardTypeLocation = new byte[]{SerialNode.OUTPUT_CARD, SerialNode.OUTPUT_CARD, SerialNode.INPUT_CARD}; + Assert.assertEquals("check 2 cards", 2, a.numOutputCards()); + } + public void testMarkChanges() { SerialNode a = new SerialNode(); |