mirror of
https://codeberg.org/sethm/symon.git
synced 2026-11-07 19:12:23 +00:00
Checkpoint of my Swing UI refactoring. Usable for output-only programs, but only barely.
This commit is contained in:
1 parent
5ce81ef82c
commit
ed36690e9e
13 files changed
+776
-659
No files matched your search
@@ -44,7 +44,7 @@ public class AciaTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readingBuffersUntilEmptyShouldResetStatus()
|
||||
public void readingBuffersShouldResetStatus()
|
||||
throws Exception {
|
||||
Acia acia = new Acia(0x0000);
|
||||
|
||||
@@ -59,64 +59,4 @@ public class AciaTest {
|
||||
assertEquals(0x10, acia.read(0x0001));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readingPastEmptyRxBufferShouldThrowException()
|
||||
throws Exception {
|
||||
Acia acia = new Acia(0x0000);
|
||||
|
||||
acia.rxWrite('a');
|
||||
assertEquals(0x18, acia.read(0x0001)); // not empty
|
||||
|
||||
assertEquals('a', acia.rxRead());
|
||||
assertEquals(0x10, acia.read(0x0001)); // becomes empty
|
||||
|
||||
// Should raise (note: I prefer this style to @Test(expected=...)
|
||||
// because it allows much finer grained control over asserting
|
||||
// exactly where the exception is expected to be raised.)
|
||||
try {
|
||||
// Should cause an underrun
|
||||
acia.rxRead();
|
||||
fail("Should have raised FifoUnderrunException.");
|
||||
} catch (FifoUnderrunException ex) {}
|
||||
|
||||
assertEquals(0x10, acia.read(0x0001)); // still again
|
||||
|
||||
for (int i = 0; i < Acia.BUF_LEN; i++) {
|
||||
acia.rxWrite('a');
|
||||
}
|
||||
|
||||
// Should NOT cause an overrun
|
||||
acia.rxWrite('a'); // nothing thrown
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readingPastEmptyTxBufferShouldThrowException()
|
||||
throws Exception {
|
||||
Acia acia = new Acia(0x0000);
|
||||
|
||||
acia.txWrite('a');
|
||||
assertEquals(0x00, acia.read(0x0001)); // not empty
|
||||
|
||||
assertEquals('a', acia.txRead());
|
||||
assertEquals(0x10, acia.read(0x0001)); // becomes empty
|
||||
|
||||
// Should raise (note: I prefer this style to @Test(expected=...)
|
||||
// because it allows much finer grained control over asserting
|
||||
// exactly where the exception is expected to be raised.)
|
||||
try {
|
||||
// Should cause an underrun
|
||||
acia.txRead();
|
||||
fail("Should have raised FifoUnderrunException.");
|
||||
} catch (FifoUnderrunException ex) {}
|
||||
|
||||
assertEquals(0x10, acia.read(0x0001)); // still empty
|
||||
|
||||
for (int i = 0; i < Acia.BUF_LEN; i++) {
|
||||
acia.txWrite('a');
|
||||
}
|
||||
|
||||
// Should NOT cause an overrun
|
||||
acia.txWrite('a'); // Nothing thrown.
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.loomcom.symon;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
* Unit test for the j6502 Simulator class.
|
||||
*/
|
||||
public class SimulatorTest extends TestCase {
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public SimulatorTest(String testName) {
|
||||
super(testName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite() {
|
||||
return new TestSuite(SimulatorTest.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rigourous Test :-)
|
||||
*/
|
||||
public void testSimulator() {
|
||||
assertTrue(true);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user