Standardized tabs, indent, and whitespace. Finally!
This commit is contained in:
1 parent
e3300d3166
commit
316d0feac6
6 files changed
+225
-268
No files matched your search
@@ -1,78 +1,35 @@
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
package com.loomcom.j6502;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import junit.framework.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import java.util.HashMap;
|
||||
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() {
|
||||
Cpu cpu = new Cpu(new Simulator());
|
||||
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() {
|
||||
Simulator sim = new Simulator();
|
||||
Cpu cpu = new Cpu(sim);
|
||||
assertEquals(sim, cpu.getSimulator());
|
||||
assertEquals(sim, cpu.getSimulator());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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