]> Devi Nivas Git - cs3210-lab0.git/commitdiff
Add mikecat's argp test
authorFrans Kaashoek <kaashoek@mit.edu>
Mon, 26 Sep 2016 11:54:02 +0000 (07:54 -0400)
committerFrans Kaashoek <kaashoek@mit.edu>
Mon, 26 Sep 2016 11:54:02 +0000 (07:54 -0400)
usertests.c

index 93f656beb4f431f7750944bb4cb94f4d5601cf91..a1e97e72d4b2a53f9a94dec7d13fb0fb2380c04c 100644 (file)
@@ -1724,6 +1724,19 @@ uio()
   printf(1, "uio test done\n");
 }
 
+void argptest()
+{
+  int fd;
+  fd = open("init", O_RDONLY);
+  if (fd < 0) {
+    printf(2, "open failed\n");
+    exit();
+  }
+  read(fd, sbrk(0) - 1, -1);
+  close(fd);
+  printf(1, "arg test passed\n");
+}
+
 unsigned long randstate = 1;
 unsigned int
 rand()
@@ -1743,6 +1756,7 @@ main(int argc, char *argv[])
   }
   close(open("usertests.ran", O_CREATE));
 
+  argptest();
   createdelete();
   linkunlink();
   concreate();