From 22fb8fd8636c1bced503f67dc63f0c4c5907f9c4 Mon Sep 17 00:00:00 2001 From: Nemo D'ACREMONT Date: Fri, 4 Apr 2025 22:46:14 +0200 Subject: [PATCH] feat: update tests --- tst/21-create-many.c | 2 +- tst/22-create-many-recursive.c | 2 +- tst/23-create-many-once.c | 4 ++-- tst/31-switch-many.c | 2 +- tst/32-switch-many-join.c | 5 +++-- tst/33-switch-many-cascade.c | 2 +- tst/51-fibonacci.c | 2 +- tst/61-mutex.c | 6 +++--- tst/62-mutex.c | 6 +++--- tst/63-mutex-equity.c | 10 +++++----- tst/64-mutex-join.c | 2 +- tst/71-preemption.c | 6 +++--- 12 files changed, 25 insertions(+), 24 deletions(-) diff --git a/tst/21-create-many.c b/tst/21-create-many.c index cb82ee7..a339ccf 100644 --- a/tst/21-create-many.c +++ b/tst/21-create-many.c @@ -32,7 +32,7 @@ int main(int argc, char *argv[]) if (argc < 2) { printf("argument manquant: nombre de threads\n"); - return -1; + return EXIT_FAILURE; } nb = atoi(argv[1]); diff --git a/tst/22-create-many-recursive.c b/tst/22-create-many-recursive.c index ec00b4f..3788ae6 100644 --- a/tst/22-create-many-recursive.c +++ b/tst/22-create-many-recursive.c @@ -40,7 +40,7 @@ int main(int argc, char *argv[]) if (argc < 2) { printf("argument manquant: nombre de threads\n"); - return -1; + return EXIT_FAILURE; } nb = atoi(argv[1]); diff --git a/tst/23-create-many-once.c b/tst/23-create-many-once.c index d430fd0..fe8921d 100644 --- a/tst/23-create-many-once.c +++ b/tst/23-create-many-once.c @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) if (argc < 2) { printf("argument manquant: nombre de threads\n"); - return -1; + return EXIT_FAILURE; } nb = atoi(argv[1]); @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) th = malloc(nb*sizeof(*th)); if (!th) { perror("malloc"); - return -1; + return EXIT_FAILURE; } gettimeofday(&tv1, NULL); diff --git a/tst/31-switch-many.c b/tst/31-switch-many.c index eb04fa2..0cd1003 100644 --- a/tst/31-switch-many.c +++ b/tst/31-switch-many.c @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) if (argc < 3) { printf("arguments manquants: nombre de threads, puis nombre de yield\n"); - return -1; + return EXIT_FAILURE; } nbth = atoi(argv[1]); diff --git a/tst/32-switch-many-join.c b/tst/32-switch-many-join.c index 42fe908..deffb36 100644 --- a/tst/32-switch-many-join.c +++ b/tst/32-switch-many-join.c @@ -36,8 +36,9 @@ static void * thfunc(void *_nbth) struct timeval tv1, tv2; unsigned long us; gettimeofday(&tv1, NULL); - for(i=0; i