pthreadpool: explicitly use max_thread=unlimited for pthreadpool_tevent_init() tests
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Jun 2018 22:10:08 +0000 (00:10 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 12 Jul 2018 12:25:18 +0000 (14:25 +0200)
Currently 0 also means unlimited, but that will change soon,
to force no thread and strict sync processing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/pthreadpool/tests.c
lib/pthreadpool/tests_cmocka.c

index f0ae0aa4a93b1ec2ffe9df85ef768b3c8a968463..d57754603a23e63cbab2fc685d212ccfdf70f7df 100644 (file)
@@ -3,6 +3,7 @@
 #include <poll.h>
 #include <errno.h>
 #include <stdlib.h>
+#include <limits.h>
 #include <pthread.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -407,7 +408,7 @@ static int test_tevent_1(void)
                        strerror(ret));
                return ret;
        }
-       ret = pthreadpool_tevent_init(ev, 0, &pool);
+       ret = pthreadpool_tevent_init(ev, UINT_MAX, &pool);
        if (ret != 0) {
                fprintf(stderr, "pthreadpool_tevent_init failed: %s\n",
                        strerror(ret));
index 9753d212e1ce9620d19eb18d90f15cb76c90a3ba..33952442e1d6238c059a0186c8328cafbc33e2d5 100644 (file)
@@ -22,6 +22,7 @@
 #include <setjmp.h>
 #include <stdlib.h>
 #include <string.h>
+#include <limits.h>
 
 #include <talloc.h>
 #include <tevent.h>
@@ -46,7 +47,7 @@ static int setup_pthreadpool_tevent(void **state)
        t->ev = tevent_context_init(t);
        assert_non_null(t->ev);
 
-       ret = pthreadpool_tevent_init(t->ev, 0, &t->pool);
+       ret = pthreadpool_tevent_init(t->ev, UINT_MAX, &t->pool);
        assert_return_code(ret, 0);
 
        *state = t;