3
0
mirror of https://github.com/Qortal/AT.git synced 2025-01-30 19:02:14 +00:00

Add slightly more coverage to OpCodeTests

This commit is contained in:
catbref 2020-04-07 17:02:09 +01:00
parent 0d5ff4de77
commit f7e50e08cd

View File

@ -146,15 +146,23 @@ public class OpCodeTests extends ExecutableTest {
@Test
public void testSLP_IMD() throws ExecutionException {
codeByteBuffer.put(OpCode.SLP_IMD.value);
int nextAddress = codeByteBuffer.position();
int postSleepAddress = codeByteBuffer.position();
codeByteBuffer.put(OpCode.FIN_IMD.value);
int postFinishAddress = codeByteBuffer.position();
execute(true);
assertTrue(state.getIsSleeping());
assertFalse(state.getIsFinished());
assertFalse(state.getHadFatalError());
assertEquals("Program counter incorrect", nextAddress, state.getProgramCounter());
assertEquals("Program counter incorrect", postSleepAddress, state.getProgramCounter());
execute(true);
assertFalse(state.getIsSleeping());
assertTrue(state.getIsFinished());
assertFalse(state.getHadFatalError());
assertEquals("Program counter incorrect", postFinishAddress, state.getProgramCounter());
}
@Test