diff options
Diffstat (limited to 'src/testcurl/https')
-rw-r--r-- | src/testcurl/https/Makefile.am | 6 | ||||
-rw-r--r-- | src/testcurl/https/test_https_get_parallel.c | 9 | ||||
-rw-r--r-- | src/testcurl/https/test_https_get_parallel_threads.c | 9 |
3 files changed, 22 insertions, 2 deletions
diff --git a/src/testcurl/https/Makefile.am b/src/testcurl/https/Makefile.am index e1a5f402..4053e536 100644 --- a/src/testcurl/https/Makefile.am +++ b/src/testcurl/https/Makefile.am | |||
@@ -4,6 +4,8 @@ if USE_COVERAGE | |||
4 | AM_CFLAGS = --coverage | 4 | AM_CFLAGS = --coverage |
5 | endif | 5 | endif |
6 | 6 | ||
7 | CPU_COUNT_DEF = -DCPU_COUNT=$(CPU_COUNT) | ||
8 | |||
7 | AM_CPPFLAGS = \ | 9 | AM_CPPFLAGS = \ |
8 | -I$(top_srcdir)/src/include \ | 10 | -I$(top_srcdir)/src/include \ |
9 | -I$(top_srcdir)/src/microhttpd \ | 11 | -I$(top_srcdir)/src/microhttpd \ |
@@ -59,6 +61,8 @@ test_tls_options_LDADD = \ | |||
59 | test_https_get_parallel_SOURCES = \ | 61 | test_https_get_parallel_SOURCES = \ |
60 | test_https_get_parallel.c \ | 62 | test_https_get_parallel.c \ |
61 | tls_test_common.c | 63 | tls_test_common.c |
64 | test_https_get_parallel_CPPFLAGS = \ | ||
65 | $(AM_CPPFLAGS) $(CPU_COUNT_DEF) | ||
62 | test_https_get_parallel_CFLAGS = \ | 66 | test_https_get_parallel_CFLAGS = \ |
63 | $(PTHREAD_CFLAGS) $(AM_CFLAGS) | 67 | $(PTHREAD_CFLAGS) $(AM_CFLAGS) |
64 | test_https_get_parallel_LDADD = \ | 68 | test_https_get_parallel_LDADD = \ |
@@ -77,6 +81,8 @@ test_empty_response_LDADD = \ | |||
77 | test_https_get_parallel_threads_SOURCES = \ | 81 | test_https_get_parallel_threads_SOURCES = \ |
78 | test_https_get_parallel_threads.c \ | 82 | test_https_get_parallel_threads.c \ |
79 | tls_test_common.c | 83 | tls_test_common.c |
84 | test_https_get_parallel_threads_CPPFLAGS = \ | ||
85 | $(AM_CPPFLAGS) $(CPU_COUNT_DEF) | ||
80 | test_https_get_parallel_threads_CFLAGS = \ | 86 | test_https_get_parallel_threads_CFLAGS = \ |
81 | $(PTHREAD_CFLAGS) $(AM_CFLAGS) | 87 | $(PTHREAD_CFLAGS) $(AM_CFLAGS) |
82 | test_https_get_parallel_threads_LDADD = \ | 88 | test_https_get_parallel_threads_LDADD = \ |
diff --git a/src/testcurl/https/test_https_get_parallel.c b/src/testcurl/https/test_https_get_parallel.c index 9ac330f0..eafc3d26 100644 --- a/src/testcurl/https/test_https_get_parallel.c +++ b/src/testcurl/https/test_https_get_parallel.c | |||
@@ -33,6 +33,13 @@ | |||
33 | #include <gcrypt.h> | 33 | #include <gcrypt.h> |
34 | #include "tls_test_common.h" | 34 | #include "tls_test_common.h" |
35 | 35 | ||
36 | #if defined(CPU_COUNT) && (CPU_COUNT+0) < 4 | ||
37 | #undef CPU_COUNT | ||
38 | #endif | ||
39 | #if !defined(CPU_COUNT) | ||
40 | #define CPU_COUNT 4 | ||
41 | #endif | ||
42 | |||
36 | extern const char srv_key_pem[]; | 43 | extern const char srv_key_pem[]; |
37 | extern const char srv_self_signed_cert_pem[]; | 44 | extern const char srv_self_signed_cert_pem[]; |
38 | 45 | ||
@@ -94,7 +101,7 @@ test_parallel_clients (void * cls, const char *cipher_suite, | |||
94 | int curl_proto_version) | 101 | int curl_proto_version) |
95 | { | 102 | { |
96 | int i; | 103 | int i; |
97 | int client_count = 3; | 104 | int client_count = (CPU_COUNT - 1); |
98 | void *client_thread_ret; | 105 | void *client_thread_ret; |
99 | pthread_t client_arr[client_count]; | 106 | pthread_t client_arr[client_count]; |
100 | struct https_test_data client_args = | 107 | struct https_test_data client_args = |
diff --git a/src/testcurl/https/test_https_get_parallel_threads.c b/src/testcurl/https/test_https_get_parallel_threads.c index 4e27370b..334276a3 100644 --- a/src/testcurl/https/test_https_get_parallel_threads.c +++ b/src/testcurl/https/test_https_get_parallel_threads.c | |||
@@ -35,6 +35,13 @@ | |||
35 | #include <gcrypt.h> | 35 | #include <gcrypt.h> |
36 | #include "tls_test_common.h" | 36 | #include "tls_test_common.h" |
37 | 37 | ||
38 | #if defined(CPU_COUNT) && (CPU_COUNT+0) < 4 | ||
39 | #undef CPU_COUNT | ||
40 | #endif | ||
41 | #if !defined(CPU_COUNT) | ||
42 | #define CPU_COUNT 4 | ||
43 | #endif | ||
44 | |||
38 | extern const char srv_key_pem[]; | 45 | extern const char srv_key_pem[]; |
39 | extern const char srv_self_signed_cert_pem[]; | 46 | extern const char srv_self_signed_cert_pem[]; |
40 | 47 | ||
@@ -94,7 +101,7 @@ test_parallel_clients (void *cls, const char *cipher_suite, | |||
94 | int curl_proto_version) | 101 | int curl_proto_version) |
95 | { | 102 | { |
96 | int i; | 103 | int i; |
97 | int client_count = 3; | 104 | int client_count = (CPU_COUNT - 1); |
98 | void *client_thread_ret; | 105 | void *client_thread_ret; |
99 | pthread_t client_arr[client_count]; | 106 | pthread_t client_arr[client_count]; |
100 | struct https_test_data client_args = | 107 | struct https_test_data client_args = |