diff --git a/Java/src/main/java/org/ciyam/at/FunctionCode.java b/Java/src/main/java/org/ciyam/at/FunctionCode.java index c0bdac9..c7f1fec 100644 --- a/Java/src/main/java/org/ciyam/at/FunctionCode.java +++ b/Java/src/main/java/org/ciyam/at/FunctionCode.java @@ -854,7 +854,7 @@ public enum FunctionCode { functionData.returnValue = state.getAPI().generateRandomUsingTransactionInA(state); // If API set isSleeping then rewind program counter (actually codeByteBuffer) ready for being awoken - if (state.getIsSleeping()) { + if (state.isSleeping()) { // EXT_FUN_RET(1) + our function code(2) + address(4) state.rewindCodePosition(MachineState.OPCODE_SIZE + MachineState.FUNCTIONCODE_SIZE + MachineState.ADDRESS_SIZE); diff --git a/Java/src/main/java/org/ciyam/at/MachineState.java b/Java/src/main/java/org/ciyam/at/MachineState.java index d2a04dc..723ff9a 100644 --- a/Java/src/main/java/org/ciyam/at/MachineState.java +++ b/Java/src/main/java/org/ciyam/at/MachineState.java @@ -273,7 +273,7 @@ public class MachineState { this.onErrorAddress = address; } - public boolean getIsSleeping() { + public boolean isSleeping() { return this.isSleeping; } @@ -289,7 +289,7 @@ public class MachineState { this.sleepUntilHeight = height; } - public boolean getIsStopped() { + public boolean isStopped() { return this.isStopped; } @@ -297,7 +297,7 @@ public class MachineState { this.isStopped = isStopped; } - public boolean getIsFrozen() { + public boolean isFrozen() { return this.isFrozen; } @@ -313,7 +313,7 @@ public class MachineState { this.frozenBalance = frozenBalance; } - public boolean getIsFinished() { + public boolean isFinished() { return this.isFinished; } @@ -321,7 +321,7 @@ public class MachineState { this.isFinished = isFinished; } - public boolean getHadFatalError() { + public boolean hadFatalError() { return this.hadFatalError; } diff --git a/Java/src/test/java/org/ciyam/at/BlockchainFunctionCodeTests.java b/Java/src/test/java/org/ciyam/at/BlockchainFunctionCodeTests.java index feff13f..aa9cf06 100644 --- a/Java/src/test/java/org/ciyam/at/BlockchainFunctionCodeTests.java +++ b/Java/src/test/java/org/ciyam/at/BlockchainFunctionCodeTests.java @@ -31,8 +31,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { Timestamp blockTimestamp = new Timestamp(getData(0)); assertEquals("Block timestamp incorrect", TestAPI.DEFAULT_INITIAL_BLOCK_HEIGHT, blockTimestamp.blockHeight); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -55,7 +55,7 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { blockTimestamp = new Timestamp(getData(0)); assertEquals("Block timestamp incorrect", expectedBlockHeight, blockTimestamp.blockHeight); - assertFalse(state.getHadFatalError()); + assertFalse(state.hadFatalError()); } @Test @@ -69,8 +69,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { Timestamp blockTimestamp = new Timestamp(getData(0)); assertEquals("Block timestamp incorrect", TestAPI.DEFAULT_AT_CREATION_BLOCK_HEIGHT, blockTimestamp.blockHeight); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -86,8 +86,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { Timestamp blockTimestamp = new Timestamp(getData(0)); assertEquals("Block timestamp incorrect", expectedBlockHeight, blockTimestamp.blockHeight); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -104,8 +104,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { byte[] aBytes = api.getA(state); assertTrue("Block hash mismatch", Arrays.equals(expectedBlockHash, aBytes)); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -141,8 +141,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { Timestamp txTimestamp = new Timestamp(transaction.timestamp); assertEquals("Transaction hash mismatch", currentBlockHeight, txTimestamp.blockHeight); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -188,8 +188,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { long transactionsCount = getData(2); assertEquals("Transaction count incorrect", expectedTransactionsCount, transactionsCount); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -235,8 +235,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { long messageTxType = getData(2); assertEquals("Message tx type mismatch", messageTx.txType.value, messageTxType); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -282,8 +282,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { long messageTxAmount = getData(2); assertEquals("Message tx amount mismatch", messageTx.amount, messageTxAmount); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -299,8 +299,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { execute(false); assertNotEquals("Random wasn't generated", 0L, getData(1)); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -358,8 +358,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { getDataBytes(8, actualMessage); assertTrue("Message tx message mismatch", Arrays.equals(expectedMessage, actualMessage)); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -402,8 +402,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { String actualSender = TestAPI.decodeAddress(actualSenderBytes); assertEquals("Sender address string mismatch", expectedSender, actualSender); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -428,8 +428,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { String actualAtCreator = TestAPI.decodeAddress(actualAtCreatorBytes); assertEquals("AT creator address string mismatch", expectedAtCreator, actualAtCreator); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -468,8 +468,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { assertEquals("Final 'current balance' mismatch", expectedBalance, getData(3)); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -492,7 +492,7 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { assertEquals("Final 'previous balance' mismatch", expectedBalance, getData(1)); - assertFalse(state.getHadFatalError()); + assertFalse(state.hadFatalError()); } @Test @@ -531,7 +531,7 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { actualBalance = recipient.balance; assertEquals("Final recipient balance mismatch", expectedBalance, actualBalance); - assertFalse(state.getHadFatalError()); + assertFalse(state.hadFatalError()); } @Test @@ -574,7 +574,7 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { actualBalance = recipient.balance; assertEquals("Final recipient balance mismatch", expectedBalance, actualBalance); - assertFalse(state.getHadFatalError()); + assertFalse(state.hadFatalError()); } @Test @@ -613,7 +613,7 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { actualBalance = recipient.balance; assertEquals("Final recipient balance mismatch", expectedBalance, actualBalance); - assertFalse(state.getHadFatalError()); + assertFalse(state.hadFatalError()); } @Test @@ -652,7 +652,7 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { actualBalance = recipient.balance; assertEquals("Final recipient balance mismatch", expectedBalance, actualBalance); - assertFalse(state.getHadFatalError()); + assertFalse(state.hadFatalError()); } @Test @@ -700,7 +700,7 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { actualBalance = recipient.balance; assertEquals("Final recipient balance mismatch", expectedBalance, actualBalance); - assertFalse(state.getHadFatalError()); + assertFalse(state.hadFatalError()); } @Test @@ -744,8 +744,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { byte[] actualMessage = recipient.messages.get(0); assertTrue("Recipient message incorrect", Arrays.equals(message, actualMessage)); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -769,8 +769,8 @@ public class BlockchainFunctionCodeTests extends ExecutableTest { long actualTimestamp = getData(2); assertEquals("Expected timestamp incorrect", expectedTimestamp, actualTimestamp); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } } diff --git a/Java/src/test/java/org/ciyam/at/BranchingOpCodeTests.java b/Java/src/test/java/org/ciyam/at/BranchingOpCodeTests.java index 828c040..41b3d86 100644 --- a/Java/src/test/java/org/ciyam/at/BranchingOpCodeTests.java +++ b/Java/src/test/java/org/ciyam/at/BranchingOpCodeTests.java @@ -31,8 +31,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(1)); } @@ -51,7 +51,7 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getHadFatalError()); + assertTrue(state.hadFatalError()); } @Test @@ -63,7 +63,7 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getHadFatalError()); + assertTrue(state.hadFatalError()); } @Test @@ -83,8 +83,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(1)); } @@ -105,8 +105,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 1L, getData(1)); } @@ -127,8 +127,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(1)); } @@ -149,8 +149,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 1L, getData(1)); } @@ -172,8 +172,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(2)); } @@ -195,8 +195,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 1L, getData(2)); } @@ -218,8 +218,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(2)); } @@ -241,8 +241,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 1L, getData(2)); } @@ -264,8 +264,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(2)); } @@ -287,8 +287,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(2)); } @@ -310,8 +310,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 1L, getData(2)); } @@ -333,8 +333,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(2)); } @@ -356,8 +356,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(2)); } @@ -379,8 +379,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 1L, getData(2)); } @@ -402,8 +402,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(2)); } @@ -425,8 +425,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 1L, getData(2)); } @@ -448,8 +448,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(2)); } @@ -471,8 +471,8 @@ public class BranchingOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 1L, getData(2)); } diff --git a/Java/src/test/java/org/ciyam/at/CallStackOpCodeTests.java b/Java/src/test/java/org/ciyam/at/CallStackOpCodeTests.java index 44d94d5..4a83c1c 100644 --- a/Java/src/test/java/org/ciyam/at/CallStackOpCodeTests.java +++ b/Java/src/test/java/org/ciyam/at/CallStackOpCodeTests.java @@ -25,8 +25,8 @@ public class CallStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); int expectedCallStackPosition = (state.numCallStackPages - 1) * MachineState.ADDRESS_SIZE; assertEquals("Call stack pointer incorrect", expectedCallStackPosition, getCallStackPosition()); @@ -59,8 +59,8 @@ public class CallStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); int expectedCallStackPosition = (state.numCallStackPages - 1 - 1) * MachineState.ADDRESS_SIZE; assertEquals("Call stack pointer incorrect", expectedCallStackPosition, getCallStackPosition()); @@ -83,8 +83,8 @@ public class CallStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -103,8 +103,8 @@ public class CallStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); int expectedCallStackPosition = (state.numCallStackPages - 1 + 1) * MachineState.ADDRESS_SIZE; assertEquals("Call stack pointer incorrect", expectedCallStackPosition, getCallStackPosition()); @@ -140,8 +140,8 @@ public class CallStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); int expectedCallStackPosition = (state.numCallStackPages - 1 - 1 + 1 + 1) * MachineState.ADDRESS_SIZE; assertEquals("Call stack pointer incorrect", expectedCallStackPosition, getCallStackPosition()); @@ -161,8 +161,8 @@ public class CallStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -175,8 +175,8 @@ public class CallStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } } diff --git a/Java/src/test/java/org/ciyam/at/DataOpCodeTests.java b/Java/src/test/java/org/ciyam/at/DataOpCodeTests.java index 32452e2..6faf1e0 100644 --- a/Java/src/test/java/org/ciyam/at/DataOpCodeTests.java +++ b/Java/src/test/java/org/ciyam/at/DataOpCodeTests.java @@ -16,8 +16,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2222L, getData(2)); } @@ -29,8 +29,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -41,8 +41,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2222L, getData(1)); } @@ -54,8 +54,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that trying to use an address outside data segment throws a fatal error. */ @@ -66,8 +66,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -78,8 +78,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); // Check data all zero for (int i = 0; i < 0x0020; ++i) @@ -94,8 +94,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -106,8 +106,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2222L + 1L, getData(2)); } @@ -119,8 +119,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that incrementing maximum unsigned long value overflows back to zero correctly. */ @@ -132,8 +132,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 0L, getData(2)); } @@ -145,8 +145,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2222L - 1L, getData(2)); } @@ -157,8 +157,8 @@ public class DataOpCodeTests extends ExecutableTest { codeByteBuffer.put(OpCode.FIN_IMD.value); execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that decrementing zero long value underflows back to maximum unsigned long correctly. */ @@ -170,8 +170,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 0xffffffffffffffffL, getData(2)); } @@ -184,8 +184,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2222L + 3333L, getData(2)); } @@ -197,8 +197,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that trying to use an address outside data segment throws a fatal error. */ @@ -209,8 +209,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that adding to an unsigned long value overflows correctly. */ @@ -223,8 +223,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 0x0000000000000098L, getData(2)); } @@ -237,8 +237,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 3333L - 2222L, getData(3)); } @@ -251,8 +251,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", (3333L * 2222L), getData(3)); } @@ -265,8 +265,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", (3333L / 2222L), getData(3)); } @@ -280,8 +280,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check divide-by-zero is non-fatal because error handler is set. */ @@ -304,8 +304,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Error flag not set", 1L, getData(1)); } @@ -318,8 +318,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", (3333L | 2222L), getData(3)); } @@ -332,8 +332,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", (3333L & 2222L), getData(3)); } @@ -346,8 +346,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", (3333L ^ 2222L), getData(3)); } @@ -359,8 +359,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", ~2222L, getData(2)); } @@ -380,8 +380,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 3333L, getData(6)); } @@ -400,8 +400,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that trying to use an address outside data segment throws a fatal error. */ @@ -419,8 +419,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -438,8 +438,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 4444L, getData(0)); } @@ -459,8 +459,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that trying to use an address outside data segment throws a fatal error. */ @@ -479,8 +479,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that trying to use an address outside data segment throws a fatal error. */ @@ -499,8 +499,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that trying to use an address outside data segment throws a fatal error. */ @@ -519,8 +519,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -537,8 +537,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 5555L, getData(3)); } @@ -557,8 +557,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that trying to use an address outside data segment throws a fatal error. */ @@ -576,8 +576,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -595,8 +595,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 5555L, getData(4)); } @@ -616,8 +616,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that trying to use an address outside data segment throws a fatal error. */ @@ -636,8 +636,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that trying to use an address outside data segment throws a fatal error. */ @@ -656,8 +656,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check that trying to use an address outside data segment throws a fatal error. */ @@ -676,8 +676,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -689,8 +689,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2222L % 3333L, getData(2)); } @@ -704,8 +704,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } /** Check divide-by-zero is non-fatal because error handler is set. */ @@ -728,8 +728,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Error flag not set", 1L, getData(1)); } @@ -742,8 +742,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2222L << 3, getData(2)); } @@ -756,8 +756,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 0L, getData(2)); } @@ -770,8 +770,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2222L >>> 3, getData(2)); } @@ -784,8 +784,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 0L, getData(2)); } @@ -798,8 +798,8 @@ public class DataOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", -1L >>> 3, getData(2)); assertTrue("Sign does not match", getData(2) >= 0); } diff --git a/Java/src/test/java/org/ciyam/at/FunctionCodeTests.java b/Java/src/test/java/org/ciyam/at/FunctionCodeTests.java index be4313b..b87b668 100644 --- a/Java/src/test/java/org/ciyam/at/FunctionCodeTests.java +++ b/Java/src/test/java/org/ciyam/at/FunctionCodeTests.java @@ -46,8 +46,8 @@ public class FunctionCodeTests extends ExecutableTest { getDataBytes(destAddress, dest); assertTrue("Data wasn't copied correctly", Arrays.equals(TEST_BYTES, dest)); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -57,8 +57,8 @@ public class FunctionCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -69,8 +69,8 @@ public class FunctionCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -81,8 +81,8 @@ public class FunctionCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } } diff --git a/Java/src/test/java/org/ciyam/at/HashingFunctionCodeTests.java b/Java/src/test/java/org/ciyam/at/HashingFunctionCodeTests.java index 7d8937a..be6e277 100644 --- a/Java/src/test/java/org/ciyam/at/HashingFunctionCodeTests.java +++ b/Java/src/test/java/org/ciyam/at/HashingFunctionCodeTests.java @@ -89,8 +89,8 @@ public class HashingFunctionCodeTests extends ExecutableTest { execute(true); - assertTrue("MachineState isn't in finished state", state.getIsFinished()); - assertFalse("MachineState encountered fatal error", state.getHadFatalError()); + assertTrue("MachineState isn't in finished state", state.isFinished()); + assertFalse("MachineState encountered fatal error", state.hadFatalError()); assertEquals(hashName + " hashes do not match", 1L, getData(1)); } @@ -118,8 +118,8 @@ public class HashingFunctionCodeTests extends ExecutableTest { execute(true); - assertTrue("MachineState isn't in finished state", state.getIsFinished()); - assertFalse("MachineState encountered fatal error", state.getHadFatalError()); + assertTrue("MachineState isn't in finished state", state.isFinished()); + assertFalse("MachineState encountered fatal error", state.hadFatalError()); assertEquals(hashName + " hashes do not match", 1L, getData(1)); } diff --git a/Java/src/test/java/org/ciyam/at/MiscTests.java b/Java/src/test/java/org/ciyam/at/MiscTests.java index 5d41433..11cfa29 100644 --- a/Java/src/test/java/org/ciyam/at/MiscTests.java +++ b/Java/src/test/java/org/ciyam/at/MiscTests.java @@ -22,8 +22,8 @@ public class MiscTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", testValue, getData(0)); } @@ -33,8 +33,8 @@ public class MiscTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -47,7 +47,7 @@ public class MiscTests extends ExecutableTest { for (long i = 0; i < minRounds; ++i) execute(true); - assertTrue(state.getIsFrozen()); + assertTrue(state.isFrozen()); Long frozenBalance = state.getFrozenBalance(); assertNotNull(frozenBalance); @@ -64,7 +64,7 @@ public class MiscTests extends ExecutableTest { state = new MachineState(api, logger, headerBytes, codeBytes, dataBytes); - assertTrue(state.getIsFrozen()); + assertTrue(state.isFrozen()); assertEquals((Long) (minActivationAmount - 1L), state.getFrozenBalance()); } diff --git a/Java/src/test/java/org/ciyam/at/OpCodeTests.java b/Java/src/test/java/org/ciyam/at/OpCodeTests.java index a147b4b..f406e16 100644 --- a/Java/src/test/java/org/ciyam/at/OpCodeTests.java +++ b/Java/src/test/java/org/ciyam/at/OpCodeTests.java @@ -17,8 +17,8 @@ public class OpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); // Check data unchanged for (int i = 0; i < 0x0020; ++i) @@ -39,8 +39,8 @@ public class OpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Data does not match", 2L, getData(0)); } @@ -54,9 +54,9 @@ public class OpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsSleeping()); - assertFalse(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isSleeping()); + assertFalse(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Sleep-until block height incorrect", blockHeight, getData(0)); } @@ -68,9 +68,9 @@ public class OpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getIsSleeping()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.isSleeping()); + assertFalse(state.hadFatalError()); } @Test @@ -81,9 +81,9 @@ public class OpCodeTests extends ExecutableTest { execute(true); - assertFalse(state.getIsFinished()); - assertTrue(state.getIsSleeping()); - assertFalse(state.getHadFatalError()); + assertFalse(state.isFinished()); + assertTrue(state.isSleeping()); + assertFalse(state.hadFatalError()); } @Test @@ -96,9 +96,9 @@ public class OpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsStopped()); - assertFalse(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isStopped()); + assertFalse(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Program counter incorrect", stopAddress, state.getProgramCounter()); } @@ -111,9 +111,9 @@ public class OpCodeTests extends ExecutableTest { execute(true); - assertFalse(state.getIsStopped()); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertFalse(state.isStopped()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -123,9 +123,9 @@ public class OpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getIsStopped()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.isStopped()); + assertFalse(state.hadFatalError()); } @Test @@ -138,9 +138,9 @@ public class OpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsStopped()); - assertFalse(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isStopped()); + assertFalse(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Program counter incorrect", stopAddress, state.getProgramCounter()); } @@ -153,16 +153,16 @@ public class OpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsSleeping()); - assertFalse(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isSleeping()); + assertFalse(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Program counter incorrect", postSleepAddress, state.getProgramCounter()); execute(true); - assertFalse(state.getIsSleeping()); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertFalse(state.isSleeping()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Program counter incorrect", postFinishAddress, state.getProgramCounter()); } @@ -186,8 +186,8 @@ public class OpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Error flag not set", 1L, getData(2)); } @@ -204,8 +204,8 @@ public class OpCodeTests extends ExecutableTest { execute(true); assertEquals(expectedStopAddress, state.getOnStopAddress()); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } @Test @@ -219,8 +219,8 @@ public class OpCodeTests extends ExecutableTest { execute(true); assertEquals(expectedStopAddress, state.getOnStopAddress()); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } } diff --git a/Java/src/test/java/org/ciyam/at/SerializationTests.java b/Java/src/test/java/org/ciyam/at/SerializationTests.java index dbe3479..fe644f8 100644 --- a/Java/src/test/java/org/ciyam/at/SerializationTests.java +++ b/Java/src/test/java/org/ciyam/at/SerializationTests.java @@ -46,8 +46,8 @@ public class SerializationTests extends ExecutableTest { simulate(); assertEquals(expectedStopAddress, (int) state.getOnStopAddress()); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); } /** Test serialization of state with data pushed onto user stack. */ @@ -78,8 +78,8 @@ public class SerializationTests extends ExecutableTest { byte[] savedState = simulate(); assertEquals(expectedStopAddress, (int) state.getOnStopAddress()); - assertTrue(state.getIsStopped()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isStopped()); + assertFalse(state.hadFatalError()); // Just after first STP_IMD we expect address 0 to be initialValue + increment long expectedValue = initialValue + increment; diff --git a/Java/src/test/java/org/ciyam/at/UserStackOpCodeTests.java b/Java/src/test/java/org/ciyam/at/UserStackOpCodeTests.java index 72a250d..34dd2d9 100644 --- a/Java/src/test/java/org/ciyam/at/UserStackOpCodeTests.java +++ b/Java/src/test/java/org/ciyam/at/UserStackOpCodeTests.java @@ -18,8 +18,8 @@ public class UserStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); int expectedUserStackPosition = (state.numUserStackPages - 1) * MachineState.VALUE_SIZE; assertEquals("User stack pointer incorrect", expectedUserStackPosition, getUserStackPosition()); @@ -36,8 +36,8 @@ public class UserStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); int expectedUserStackPosition = (state.numUserStackPages - 2) * MachineState.VALUE_SIZE; assertEquals("User stack pointer incorrect", expectedUserStackPosition, getUserStackPosition()); @@ -55,8 +55,8 @@ public class UserStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -79,8 +79,8 @@ public class UserStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); assertEquals("Error flag not set", 1L, getData(1)); } @@ -93,8 +93,8 @@ public class UserStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); int expectedUserStackPosition = (state.numUserStackPages - 1 + 1) * MachineState.VALUE_SIZE; assertEquals("User stack pointer incorrect", expectedUserStackPosition, getUserStackPosition()); @@ -115,8 +115,8 @@ public class UserStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertFalse(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertFalse(state.hadFatalError()); int expectedUserStackPosition = (state.numUserStackPages - 1 - 1 + 1 + 1) * MachineState.VALUE_SIZE; assertEquals("User stack pointer incorrect", expectedUserStackPosition, getUserStackPosition()); @@ -131,8 +131,8 @@ public class UserStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } @Test @@ -145,8 +145,8 @@ public class UserStackOpCodeTests extends ExecutableTest { execute(true); - assertTrue(state.getIsFinished()); - assertTrue(state.getHadFatalError()); + assertTrue(state.isFinished()); + assertTrue(state.hadFatalError()); } } diff --git a/Java/src/test/java/org/ciyam/at/test/ExecutableTest.java b/Java/src/test/java/org/ciyam/at/test/ExecutableTest.java index ad4e115..aea4b45 100644 --- a/Java/src/test/java/org/ciyam/at/test/ExecutableTest.java +++ b/Java/src/test/java/org/ciyam/at/test/ExecutableTest.java @@ -79,18 +79,18 @@ public abstract class ExecutableTest { System.out.println(String.format("Stop Address: 0x%04x", state.getOnStopAddress())); System.out.println("Error Address: " + (state.getOnErrorAddress() == null ? "not set" : String.format("0x%04x", state.getOnErrorAddress()))); - if (state.getIsSleeping()) + if (state.isSleeping()) System.out.println("Sleeping until current block height (" + state.getCurrentBlockHeight() + ") reaches " + state.getSleepUntilHeight()); else - System.out.println("Sleeping: " + state.getIsSleeping()); + System.out.println("Sleeping: " + state.isSleeping()); - System.out.println("Stopped: " + state.getIsStopped()); - System.out.println("Finished: " + state.getIsFinished()); + System.out.println("Stopped: " + state.isStopped()); + System.out.println("Finished: " + state.isFinished()); - if (state.getHadFatalError()) + if (state.hadFatalError()) System.out.println("Finished due to fatal error!"); - System.out.println("Frozen: " + state.getIsFrozen()); + System.out.println("Frozen: " + state.isFrozen()); long newBalance = state.getCurrentBalance(); System.out.println("New balance: " + TestAPI.prettyAmount(newBalance)); @@ -101,7 +101,7 @@ public abstract class ExecutableTest { packedState = state.toBytes(); System.out.println("Execution round finished\n"); - } while (!onceOnly && !state.getIsFinished()); + } while (!onceOnly && !state.isFinished()); unwrapState(state); }