mirror of
https://codeberg.org/sethm/symon.git
synced 2026-11-07 19:12:23 +00:00
Lots of whitespace changes after importing the project into Eclipse
This commit is contained in:
1 parent
a6abc2cd23
commit
e3300d3166
6 files changed
+164
-33
No files matched your search
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.loomcom.j6502;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author sethm
|
||||
*
|
||||
*/
|
||||
public class CpuTest {
|
||||
|
||||
@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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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