diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-11-21 17:33:58 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-11-23 13:47:00 +0300 |
commit | 67b1cdc29dfb1f260e0d31df3121e01d8ecad027 (patch) | |
tree | 2ad6484e11340ebc5619c5d6dd7ee87437884f2c /src/testcurl/test_get.c | |
parent | b05555f8372fd848698d87133d8ed194820ede1e (diff) | |
download | libmicrohttpd-67b1cdc29dfb1f260e0d31df3121e01d8ecad027.tar.gz libmicrohttpd-67b1cdc29dfb1f260e0d31df3121e01d8ecad027.zip |
Tests: added use of MHD_USE_NO_THREAD_SAFETY flag
Diffstat (limited to 'src/testcurl/test_get.c')
-rw-r--r-- | src/testcurl/test_get.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c index b44c8370..812aa840 100644 --- a/src/testcurl/test_get.c +++ b/src/testcurl/test_get.c | |||
@@ -394,7 +394,7 @@ testMultithreadedPoolGet (uint32_t poll_flag) | |||
394 | 394 | ||
395 | 395 | ||
396 | static unsigned int | 396 | static unsigned int |
397 | testExternalGet (void) | 397 | testExternalGet (int thread_unsafe) |
398 | { | 398 | { |
399 | struct MHD_Daemon *d; | 399 | struct MHD_Daemon *d; |
400 | CURL *c; | 400 | CURL *c; |
@@ -424,7 +424,8 @@ testExternalGet (void) | |||
424 | cbc.buf = buf; | 424 | cbc.buf = buf; |
425 | cbc.size = 2048; | 425 | cbc.size = 2048; |
426 | cbc.pos = 0; | 426 | cbc.pos = 0; |
427 | d = MHD_start_daemon (MHD_USE_ERROR_LOG, | 427 | d = MHD_start_daemon (MHD_USE_ERROR_LOG |
428 | | (thread_unsafe ? MHD_USE_NO_THREAD_SAFETY : 0), | ||
428 | global_port, NULL, NULL, | 429 | global_port, NULL, NULL, |
429 | &ahc_echo, NULL, | 430 | &ahc_echo, NULL, |
430 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 431 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
@@ -890,14 +891,20 @@ main (int argc, char *const *argv) | |||
890 | if (0 != curl_global_init (CURL_GLOBAL_WIN32)) | 891 | if (0 != curl_global_init (CURL_GLOBAL_WIN32)) |
891 | return 2; | 892 | return 2; |
892 | global_port = 0; | 893 | global_port = 0; |
893 | test_result = testExternalGet (); | 894 | test_result = testExternalGet (! 0); |
894 | if (test_result) | 895 | if (test_result) |
895 | fprintf (stderr, "FAILED: testExternalGet () - %u.\n", test_result); | 896 | fprintf (stderr, "FAILED: testExternalGet (!0) - %u.\n", test_result); |
896 | else if (verbose) | 897 | else if (verbose) |
897 | printf ("PASSED: testExternalGet ().\n"); | 898 | printf ("PASSED: testExternalGet ().\n"); |
898 | errorCount += test_result; | 899 | errorCount += test_result; |
899 | if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS)) | 900 | if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS)) |
900 | { | 901 | { |
902 | test_result += testExternalGet (0); | ||
903 | if (test_result) | ||
904 | fprintf (stderr, "FAILED: testExternalGet (0) - %u.\n", test_result); | ||
905 | else if (verbose) | ||
906 | printf ("PASSED: testExternalGet ().\n"); | ||
907 | errorCount += test_result; | ||
901 | test_result += testInternalGet (0); | 908 | test_result += testInternalGet (0); |
902 | if (test_result) | 909 | if (test_result) |
903 | fprintf (stderr, "FAILED: testInternalGet (0) - %u.\n", test_result); | 910 | fprintf (stderr, "FAILED: testInternalGet (0) - %u.\n", test_result); |