diff options
author | Stefan Zabka <zabkaste@hu-berlin.de> | 2020-05-22 00:24:51 +0200 |
---|---|---|
committer | Stefan Zabka <zabkaste@hu-berlin.de> | 2020-05-22 00:24:51 +0200 |
commit | 40d578c09654ba6720ffd6e365e0d411cfa38613 (patch) | |
tree | 154cb0c40b37a3a9e985ce4fdd5ffd8f2ce123e1 /02_exercise/process_test.c | |
parent | f959165cdece3c1bfae8abce834a2bb78db96190 (diff) | |
download | betriebssysteme-40d578c09654ba6720ffd6e365e0d411cfa38613.tar.gz betriebssysteme-40d578c09654ba6720ffd6e365e0d411cfa38613.zip |
Somewhat working pipes
Diffstat (limited to '02_exercise/process_test.c')
-rw-r--r-- | 02_exercise/process_test.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/02_exercise/process_test.c b/02_exercise/process_test.c index 89eb2fb..dc3a291 100644 --- a/02_exercise/process_test.c +++ b/02_exercise/process_test.c @@ -43,7 +43,20 @@ void test_pipe() { assert(processes[1].in_fd != 0); free_processes(&processes); } + +void test_ls(){ + process * processes= NULL; + parse_line("ls", &processes); + assert(arrayLen(processes) == 1); + process p = processes[0]; + assert(arrayLen(p.argv)==2); + assert(p.argc == 1); + assert(strcmp(p.argv[0], "ls") == 0); + assert(p.argc[p.argv] == NULL); + free_processes(&processes); +} int main() { + test_ls(); test_simple_case(); test_detatched(); test_pipe(); |