diff options
| author | Yang Liu <liuyang22@iscas.ac.cn> | 2023-04-14 02:00:56 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-13 20:00:56 +0200 |
| commit | 8a903f1e2cfe16634c60ade801410303d2d08723 (patch) | |
| tree | 91f7aadaf5d9823ee2d5cad08cbdfd1568bdf556 | |
| parent | 9246f4925bbf0835f052e9aa0b4e167857e7ced9 (diff) | |
| download | box64-8a903f1e2cfe16634c60ade801410303d2d08723.tar.gz box64-8a903f1e2cfe16634c60ade801410303d2d08723.zip | |
[TESTS] Make test09 deterministic (#698)
| -rwxr-xr-x | tests/test09 | bin | 16744 -> 16088 bytes | |||
| -rwxr-xr-x | tests/test09.c | 7 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/test09 b/tests/test09 index cf9d6c2c..7855a69d 100755 --- a/tests/test09 +++ b/tests/test09 Binary files differdiff --git a/tests/test09.c b/tests/test09.c index e4a56050..dadff215 100755 --- a/tests/test09.c +++ b/tests/test09.c @@ -1,5 +1,6 @@ #include <stdio.h> -#include <sys/types.h> +#include <sys/types.h> +#include <sys/wait.h> #include <unistd.h> void forkexample() @@ -9,7 +10,7 @@ void forkexample() if (fork() == 0) printf("Child has x = %d\n", ++x); else { - usleep(20000); + wait(NULL); printf("Parent has x = %d\n", --x); } } @@ -17,4 +18,4 @@ int main() { forkexample(); return 0; -} \ No newline at end of file +} |