turn Acia into an abstract class so that the 6551 and 6850 ACIAs can reuse code and an unified interface.
This commit is contained in:
1 parent
9726907317
commit
31fdd87b41
5 files changed
+248
-299
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package com.loomcom.symon;
|
||||
|
||||
import com.loomcom.symon.devices.Acia;
|
||||
import com.loomcom.symon.devices.Acia6551;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -12,7 +13,7 @@ public class AciaTest {
|
||||
public void shouldTriggerInterruptOnRxFullIfRxIrqEnabled() throws Exception {
|
||||
Bus mockBus = mock(Bus.class);
|
||||
|
||||
Acia acia = new Acia(0x000);
|
||||
Acia acia = new Acia6551(0x000);
|
||||
acia.setBus(mockBus);
|
||||
|
||||
// Disable TX IRQ, Enable RX IRQ
|
||||
@@ -27,7 +28,7 @@ public class AciaTest {
|
||||
public void shouldNotTriggerInterruptOnRxFullIfRxIrqNotEnabled() throws Exception {
|
||||
Bus mockBus = mock(Bus.class);
|
||||
|
||||
Acia acia = new Acia(0x000);
|
||||
Acia acia = new Acia6551(0x000);
|
||||
acia.setBus(mockBus);
|
||||
|
||||
// Disable TX IRQ, Disable RX IRQ
|
||||
@@ -42,7 +43,7 @@ public class AciaTest {
|
||||
public void shouldTriggerInterruptOnTxEmptyIfTxIrqEnabled() throws Exception {
|
||||
Bus mockBus = mock(Bus.class);
|
||||
|
||||
Acia acia = new Acia(0x000);
|
||||
Acia acia = new Acia6551(0x000);
|
||||
acia.setBus(mockBus);
|
||||
|
||||
// Enable TX IRQ, Disable RX IRQ
|
||||
@@ -63,7 +64,7 @@ public class AciaTest {
|
||||
public void shouldNotTriggerInterruptOnTxEmptyIfTxIrqNotEnabled() throws Exception {
|
||||
Bus mockBus = mock(Bus.class);
|
||||
|
||||
Acia acia = new Acia(0x000);
|
||||
Acia acia = new Acia6551(0x000);
|
||||
acia.setBus(mockBus);
|
||||
|
||||
// Disable TX IRQ, Disable RX IRQ
|
||||
@@ -80,14 +81,14 @@ public class AciaTest {
|
||||
|
||||
@Test
|
||||
public void newAciaShouldHaveTxEmptyStatus() throws Exception {
|
||||
Acia acia = new Acia(0x000);
|
||||
Acia acia = new Acia6551(0x000);
|
||||
|
||||
assertEquals(0x10, acia.read(0x0001));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aciaShouldHaveTxEmptyStatusOffIfTxHasData() throws Exception {
|
||||
Acia acia = new Acia(0x000);
|
||||
Acia acia = new Acia6551(0x000);
|
||||
|
||||
acia.txWrite('a');
|
||||
assertEquals(0x00, acia.read(0x0001));
|
||||
@@ -95,7 +96,7 @@ public class AciaTest {
|
||||
|
||||
@Test
|
||||
public void aciaShouldHaveRxFullStatusOffIfRxHasData() throws Exception {
|
||||
Acia acia = new Acia(0x000);
|
||||
Acia acia = new Acia6551(0x000);
|
||||
|
||||
acia.rxWrite('a');
|
||||
assertEquals(0x18, acia.read(0x0001));
|
||||
@@ -104,7 +105,7 @@ public class AciaTest {
|
||||
@Test
|
||||
public void aciaShouldHaveTxEmptyAndRxFullStatusOffIfRxAndTxHaveData()
|
||||
throws Exception {
|
||||
Acia acia = new Acia(0x000);
|
||||
Acia acia = new Acia6551(0x000);
|
||||
|
||||
acia.rxWrite('a');
|
||||
acia.txWrite('b');
|
||||
@@ -115,7 +116,7 @@ public class AciaTest {
|
||||
@Test
|
||||
public void readingBuffersShouldResetStatus()
|
||||
throws Exception {
|
||||
Acia acia = new Acia(0x0000);
|
||||
Acia acia = new Acia6551(0x0000);
|
||||
|
||||
acia.rxWrite('a');
|
||||
acia.txWrite('b');
|
||||
|
||||
Reference in new issue
Block a user