// ****************** //
// Play the program //
// ****************** //
VM vm = new VM();
Program program = new Program(codeB, pi);
try {
while(!program.isStopped())
vm.step(program);
} catch (RuntimeException e) {
program.setRuntimeFailure(e);
}
System.out.println();
System.out.println("============ Results ============");
System.out.println("*** Used gas: " + program.getResult().getGasUsed());
DataWord value1 = program.memoryLoad(new DataWord(32));
DataWord value2 = program.memoryLoad(new DataWord(64));
DataWord value3 = program.memoryLoad(new DataWord(96));
DataWord value4 = program.memoryLoad(new DataWord(128));
DataWord value5 = program.memoryLoad(new DataWord(160));
DataWord value6 = program.memoryLoad(new DataWord(192));
repository.close();
assertEquals(expectedVal_1, value1.longValue());
assertEquals(expectedVal_2, value2.longValue());