aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/klaar/pfs.c
diff options
context:
space:
mode:
authorFilip Strömbäck <filip.stromback@liu.se>2020-06-11 15:19:17 +0200
committerFilip Strömbäck <filip.stromback@liu.se>2020-06-11 15:19:17 +0200
commitcda174afc8e1bf6b779726965f5eaa030d80b1dc (patch)
tree9e8b37512203cad0e6959440e7b64c1ed8c3aac4 /src/tests/klaar/pfs.c
parentb51fd37426d5c381f52bf93c5950479a9a13a594 (diff)
downloadpintos-rs-cda174afc8e1bf6b779726965f5eaa030d80b1dc.tar.gz
The klaar/pfs test now properly detects crashes better.
Previously, if the create() call would incorrectly kill the pfs process, the test would still succeed as exit codes were not verified, and there were no other way of identifying successful completion.
Diffstat (limited to 'src/tests/klaar/pfs.c')
-rw-r--r--src/tests/klaar/pfs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tests/klaar/pfs.c b/src/tests/klaar/pfs.c
index fe1c3d7..9075ba5 100644
--- a/src/tests/klaar/pfs.c
+++ b/src/tests/klaar/pfs.c
@@ -59,7 +59,7 @@ static void start_rw(int rn, int wn)
CHECK( wait( wpid ) != -1, "wait pfs-writer %d", wpid);
}
-int main (int argc, char *argv[])
+int main (int argc, char *argv[])
{
if ( argc != 3 )
fail("usage: pfs START END");
@@ -79,5 +79,9 @@ int main (int argc, char *argv[])
start_rw(num_reader, num_writer);
msg ("end");
+
+ // Tell the system we're entirely done. Otherwise the test accepts
+ // that this process is killed for some reason (e.g. invalid syscall).
+ printf("pfs done\n");
return 0;
}