finished unit tests, better process status reporting

This commit is contained in:
Aidan Hahn 2019-05-23 14:21:40 -07:00
parent 7d8f8111c8
commit eb15da6ae2
No known key found for this signature in database
GPG key ID: 327711E983899316
3 changed files with 48 additions and 16 deletions

View file

@ -86,7 +86,7 @@ public class ProcessManagerTest {
@Test
public void getUnknownStatusTest() {
int status = manager.getProcessStatus(400);
assertEquals(2, status);
assertEquals(3, status);
}
/*
@ -160,17 +160,20 @@ public class ProcessManagerTest {
/*
* killProcessTest()
* ensures killing a process works
* also tests if getProcessStatus returns 2
*/
@Test
public void killProcessTest() {
int pid = manager.newProcess("sleep 10");
int ret = manager.killProcess(pid);
assertEquals(0, ret);
assertEquals(1, ret);
int status = manager.getProcessStatus(pid);
assertEquals(1, status);
assertEquals(2, status);
manager.shutdown();
}
}