Fix tests

This commit is contained in:
simon987 2020-08-01 21:22:13 -04:00
parent 50b95d1a9c
commit 2ace932b52
2 changed files with 5 additions and 4 deletions

View File

@ -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);
}

View File

@ -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"));