diff --git a/examples/invalidJZ.s b/examples/invalidJZ.s index c431909daa1f0eacac2a51cab739484cea33bfbc..824b2d91480b6f339632a63b298e0aa3280e840e 100644 --- a/examples/invalidJZ.s +++ b/examples/invalidJZ.s @@ -5,5 +5,5 @@ MOV R4 100 SUB R4 R3 R2 - JZ R4 10000 + JZ R4 -10000 RET R4 \ No newline at end of file diff --git a/mutants/mutant-5/swen90006/machine/Machine.java b/mutants/mutant-5/swen90006/machine/Machine.java index 99442857b21230f51fb450aa80fc6773aee3ba59..f2a92be65a0728c923e405760ededdb4501b0304 100644 --- a/mutants/mutant-5/swen90006/machine/Machine.java +++ b/mutants/mutant-5/swen90006/machine/Machine.java @@ -306,6 +306,6 @@ public class Machine } public void Bomb() throws InvalidInstructionException{ - throw new InvalidActivityException(); + throw new InvalidInstructionException(); } } diff --git a/test/swen90006/machine/BoundaryTests.java b/test/swen90006/machine/BoundaryTests.java index 9124b2bf4e04bbf1eec234a32f9e8f66a840844b..8124b3ed2684135a4073762aac9dc614e4c2dcaa 100644 --- a/test/swen90006/machine/BoundaryTests.java +++ b/test/swen90006/machine/BoundaryTests.java @@ -47,9 +47,17 @@ public class BoundaryTests //Test test opens a file and executes the machine @Test public void aFileOpenTest() { - final List<String> lines = readInstructions("C:\\Users\\ASUS\\git\\SWEN90006-A1-2018\\examples\\array.s"); + final List<String> lines = readInstructions("examples\\array.s"); Machine m = new Machine(); assertEquals(m.execute(lines), 45); + assertEquals(m.getCount(),162); + } + + @Test public void validAdd() + { + final List<String> lines = readInstructions("examples\\div_test2.s"); + Machine m = new Machine(); + assertEquals(m.execute(lines), 20); } //To test an exception, specify the expected exception after the @Test diff --git a/test/swen90006/machine/PartitioningTests.java b/test/swen90006/machine/PartitioningTests.java index 7cefc33f315b50dae8358fb6901f75da3f93bf9f..33480674fb1984411862c70b32a348974639bb92 100644 --- a/test/swen90006/machine/PartitioningTests.java +++ b/test/swen90006/machine/PartitioningTests.java @@ -82,6 +82,7 @@ public class PartitioningTests final List<String> lines = readInstructions("examples/array.s"); Machine m = new Machine(); assertEquals(m.execute(lines), 45); + assertEquals(m.getCount(),162); } // Equivalance Class 1