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

Add slightly more coverage to DataOpCodeTests

This commit is contained in:
catbref 2020-04-07 17:01:40 +01:00
parent c9fdd424e4
commit 0d5ff4de77

View File

@ -771,7 +771,7 @@ public class DataOpCodeTests extends ExecutableTest {
assertTrue(state.getIsFinished());
assertFalse(state.getHadFatalError());
assertEquals("Data does not match", 2222L >> 3, getData(2));
assertEquals("Data does not match", 2222L >>> 3, getData(2));
}
@Test
@ -788,4 +788,19 @@ public class DataOpCodeTests extends ExecutableTest {
assertEquals("Data does not match", 0L, getData(2));
}
@Test
public void testSHR_DATsign() throws ExecutionException {
codeByteBuffer.put(OpCode.SET_VAL.value).putInt(2).putLong(-1L);
codeByteBuffer.put(OpCode.SET_VAL.value).putInt(3).putLong(3L);
codeByteBuffer.put(OpCode.SHR_DAT.value).putInt(2).putInt(3);
codeByteBuffer.put(OpCode.FIN_IMD.value);
execute(true);
assertTrue(state.getIsFinished());
assertFalse(state.getHadFatalError());
assertEquals("Data does not match", -1L >>> 3, getData(2));
assertTrue("Sign does not match", getData(2) >= 0);
}
}