mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-10 14:26:45 +00:00
Fix tests
This commit is contained in:
parent
50b95d1a9c
commit
2ace932b52
@ -36,10 +36,10 @@ public class TestHelper {
|
||||
}
|
||||
|
||||
public static TestExecutionResult executeCode(String code) {
|
||||
return executeCode(code, 100);
|
||||
return executeCode(code, 10000);
|
||||
}
|
||||
|
||||
public static TestExecutionResult executeCode(String code, int timeout) {
|
||||
public static TestExecutionResult executeCode(String code, int allocation) {
|
||||
AssemblyResult ar = getTestAsm().parse(code);
|
||||
CPU cpu = TestHelper.getTestCpu();
|
||||
|
||||
@ -53,8 +53,9 @@ public class TestHelper {
|
||||
cpu.getMemory().write((char) ar.origin, assembledCode, 0, assembledCode.length);
|
||||
cpu.setCodeSectionOffset(ar.getCodeSectionOffset());
|
||||
|
||||
cpu.setInstructionAlloction(allocation);
|
||||
cpu.reset();
|
||||
cpu.execute(timeout);
|
||||
cpu.execute();
|
||||
|
||||
return new TestExecutionResult(cpu.getState(), host.callHistory, ar);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class IntInstructionTest {
|
||||
"MOV Y, 0x4567 \n" +
|
||||
"brk \n";
|
||||
|
||||
TestExecutionResult res = TestHelper.executeCode(code, 10);
|
||||
TestExecutionResult res = TestHelper.executeCode(code, 30);
|
||||
|
||||
assertEquals(0x1234, res.regValue("X"));
|
||||
assertEquals(0, res.regValue("Y"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user