diff options
Diffstat (limited to 'src/tests/userprog/args.c')
| -rw-r--r-- | src/tests/userprog/args.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/tests/userprog/args.c b/src/tests/userprog/args.c new file mode 100644 index 0000000..20eda44 --- /dev/null +++ b/src/tests/userprog/args.c @@ -0,0 +1,25 @@ +/* Prints the command-line arguments. + This program is used for all of the args-* tests. Grading is + done differently for each of the args-* tests based on the + output. */ + +#include "tests/lib.h" + +int +main (int argc, char *argv[]) +{ + int i; + + test_name = "args"; + + msg ("begin"); + msg ("argc = %d", argc); + for (i = 0; i <= argc; i++) + if (argv[i] != NULL) + msg ("argv[%d] = '%s'", i, argv[i]); + else + msg ("argv[%d] = null", i); + msg ("end"); + + return 0; +} |
