Standardized tabs, indent, and whitespace. Finally!
This commit is contained in:
1 parent
e3300d3166
commit
316d0feac6
2 files changed
+11
-54
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
package com.loomcom.j6502;
|
package com.loomcom.j6502;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A memory-mapped IO Device.
|
* A memory-mapped IO Device.
|
||||||
|
|||||||
@@ -3,40 +3,29 @@
|
|||||||
*/
|
*/
|
||||||
package com.loomcom.j6502;
|
package com.loomcom.j6502;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import junit.framework.*;
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author sethm
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class CpuTest {
|
public class CpuTest extends TestCase {
|
||||||
|
|
||||||
|
public CpuTest(String testName) {
|
||||||
|
super(testName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new TestSuite(CpuTest.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCpu() {
|
public void testCpu() {
|
||||||
Cpu cpu = new Cpu(new Simulator());
|
Cpu cpu = new Cpu(new Simulator());
|
||||||
assertNotNull(cpu);
|
assertNotNull(cpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testReset() {
|
|
||||||
fail("Not yet implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testInterrupt() {
|
|
||||||
fail("Not yet implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testNmiInterrupt() {
|
|
||||||
fail("Not yet implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGetSimulator() {
|
public void testGetSimulator() {
|
||||||
Simulator sim = new Simulator();
|
Simulator sim = new Simulator();
|
||||||
Cpu cpu = new Cpu(sim);
|
Cpu cpu = new Cpu(sim);
|
||||||
@@ -44,35 +33,3 @@ public class CpuTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class MockSimulator extends Simulator {
|
|
||||||
public int step;
|
|
||||||
public boolean hasRun = false;
|
|
||||||
public Map<Integer,Integer> memory;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int read(int address) {
|
|
||||||
Integer val = memory.get(new Integer(address));
|
|
||||||
if (val == null) {
|
|
||||||
throw new NullPointerException("Read from a non-existent memory location");
|
|
||||||
} else {
|
|
||||||
return val.intValue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
hasRun = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void step() {
|
|
||||||
step++;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void write(int address, int value) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.write(address, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user