diff --git a/test/swen90006/machine/PartitioningTests.java b/test/swen90006/machine/PartitioningTests.java index 1331aa4329bb4576fc35396abdd72f20dd303e7d..68ef26189452e4d16ea32b83651d7cbcf73fc73a 100644 --- a/test/swen90006/machine/PartitioningTests.java +++ b/test/swen90006/machine/PartitioningTests.java @@ -106,7 +106,7 @@ public class PartitioningTests { final InvalidInstructionException expected = new InvalidInstructionException(); final List<String> instructions = new ArrayList<>(); - instructions.add("LDR R2 R0 -1"); + instructions.add("LDR R2 R0 -65536"); instructions.add("RET R2"); Machine m = new Machine(); try { @@ -194,19 +194,12 @@ public class PartitioningTests //To test EC22 in Machine. @Test public void ec22Test() { - final InvalidInstructionException expected = new InvalidInstructionException(); + final int expected = 0; final List<String> instructions = new ArrayList<>(); instructions.add("RET R0"); instructions.add("RET R1"); Machine m = new Machine(); - try { - m.execute(instructions); - } - catch (InvalidInstructionException e){ - assertSame(expected.toString(), e.toString()); - return; - } - assertEquals(expected.toString(), m.execute(instructions)); + assertEquals(expected, m.execute(instructions)); } //To test EC23 in Machine.