2930313233343536373839
acia.setBus(mockBus); // Disable TX IRQ, Enable RX IRQ acia.write(CMD_STAT_REG, 0x80); acia.rxWrite('a'); verify(mockBus, atLeastOnce()).assertIrq(); } @Test
4445464748495051525354
acia.setBus(mockBus); // Disable TX IRQ, Disable RX IRQ acia.write(CMD_STAT_REG, 0x00); acia.rxWrite('a'); verify(mockBus, never()).assertIrq(); } @Test
108109110111112113114115116117118
@Test public void aciaShouldHaveRxFullStatusOnIfRxHasData() throws Exception { Acia acia = newAcia(); acia.rxWrite('a'); assertEquals(0x01, acia.read(CMD_STAT_REG) & 0x01); } @Test
118119120121122123124125126127128
@Test public void aciaShouldHaveTxEmptyAndRxFullStatusOffIfRxAndTxHaveData() throws Exception { Acia acia = newAcia(); acia.rxWrite('a'); acia.txWrite('b'); assertEquals(0x01, acia.read(CMD_STAT_REG) & 0x03); }
131132133134135136137138139140141
throws Exception { Acia acia = newAcia(); // overrun ACIA acia.rxWrite('a'); acia.rxWrite('b'); assertEquals(0x20, acia.read(CMD_STAT_REG) & 0x20); // read should reset
132133134135136137138139140141142
Acia acia = newAcia(); // overrun ACIA acia.rxWrite('a'); acia.rxWrite('b'); assertEquals(0x20, acia.read(CMD_STAT_REG) & 0x20); // read should reset acia.rxRead();
149150151152153154155156157158159
throws Exception { Acia acia = newAcia(); assertEquals(0x00, acia.read(CMD_STAT_REG) & 0x01); acia.rxWrite('a'); assertEquals(0x01, acia.read(CMD_STAT_REG) & 0x01); acia.rxRead();
1718192021222324252627
acia.setBus(mockBus); // Disable TX IRQ, Enable RX IRQ acia.write(2, 0x00); acia.rxWrite('a'); verify(mockBus, atLeastOnce()).assertIrq(); } @Test
3233343536373839404142
acia.setBus(mockBus); // Disable TX IRQ, Disable RX IRQ acia.write(2, 0x02); acia.rxWrite('a'); verify(mockBus, never()).assertIrq(); } @Test
96979899100101102103104105106
@Test public void aciaShouldHaveRxFullStatusOffIfRxHasData() throws Exception { Acia acia = new Acia6551(0x000); acia.rxWrite('a'); assertEquals(0x18, acia.read(0x0001)); } @Test public void aciaShouldHaveTxEmptyAndRxFullStatusOffIfRxAndTxHaveData()