Skip to content
Snippets Groups Projects
Commit bd8bf9f2 authored by Ashwaq Abdullah M Alsaqer's avatar Ashwaq Abdullah M Alsaqer
Browse files

latest changes

parent d1c3d904
Branches
No related tags found
No related merge requests found
......@@ -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
......@@ -306,6 +306,6 @@ public class Machine
}
public void Bomb() throws InvalidInstructionException{
throw new InvalidActivityException();
throw new InvalidInstructionException();
}
}
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment