[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 08/29: tests: minor improvemnts
From: |
gnunet |
Subject: |
[libmicrohttpd] 08/29: tests: minor improvemnts |
Date: |
Tue, 20 Jun 2023 22:24:21 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit dce208464a89dfe8e72a4bc4e7aa6b0c8b2563bf
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon Jun 12 20:23:25 2023 +0300
tests: minor improvemnts
---
src/microhttpd/test_mhd_version.c | 25 ++++++++++++++++---------
src/testcurl/test_long_header.c | 2 ++
2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/src/microhttpd/test_mhd_version.c
b/src/microhttpd/test_mhd_version.c
index 654acf30..bd91d64d 100644
--- a/src/microhttpd/test_mhd_version.c
+++ b/src/microhttpd/test_mhd_version.c
@@ -18,7 +18,7 @@
*/
/**
- * @file microhttpd/test_mhd_version.h
+ * @file microhttpd/test_mhd_version.с
* @brief Tests for MHD versions identifiers
* @author Karlson2k (Evgeny Grin)
*/
@@ -103,16 +103,22 @@ test_macro2_vs_func_str (void)
static int
test_func_str_vs_macro_bin (void)
{
-#ifdef HAVE_SNPRINTF
- char bin_print[10];
+ char bin_print[64];
int res;
const char *str_func = MHD_get_version ();
printf ("Checking MHD_get_version() function vs MHD_VERSION macro.\n");
+#ifdef HAVE_SNPRINTF
res = snprintf (bin_print, sizeof(bin_print), "%X.%X.%X",
(unsigned int) ((bin_macro >> 24) & 0xFF),
(unsigned int) ((bin_macro >> 16) & 0xFF),
(unsigned int) ((bin_macro >> 8) & 0xFF));
+#else /* ! HAVE_SNPRINTF */
+ res = sprintf (bin_print, "%X.%X.%X",
+ (unsigned int) ((bin_macro >> 24) & 0xFF),
+ (unsigned int) ((bin_macro >> 16) & 0xFF),
+ (unsigned int) ((bin_macro >> 8) & 0xFF));
+#endif /* ! HAVE_SNPRINTF */
if ((9 < res) || (0 >= res))
{
fprintf (stderr, "snprintf() error.\n");
@@ -132,11 +138,6 @@ test_func_str_vs_macro_bin (void)
bin_macro,
bin_print);
return 0;
-#else /* ! HAVE_SNPRINTF */
- fprintf (stderr, "snprintf() function is not available. "
- "Cannot check binary/string match.\n");
- return 0;
-#endif /* ! HAVE_SNPRINTF */
}
@@ -219,5 +220,11 @@ main (void)
res += test_macro_vs_func_bin ();
res += test_func_bin_format ();
- return 0 == res ? 0 : 1;
+ if (0 != res)
+ {
+ fprintf (stderr, "Test failed. Number of errors: %d\n", res);
+ return 1;
+ }
+ printf ("Test succeed.\n");
+ return 0;
}
diff --git a/src/testcurl/test_long_header.c b/src/testcurl/test_long_header.c
index a423d3b5..0f679d63 100644
--- a/src/testcurl/test_long_header.c
+++ b/src/testcurl/test_long_header.c
@@ -304,6 +304,8 @@ main (int argc, char *const *argv)
errorCount += testLongHeaderGet (VERY_LONG / 2 + 1893);
if (errorCount != 0)
fprintf (stderr, "Error (code: %u)\n", errorCount);
+ else
+ printf ("Test succeed.\n");
curl_global_cleanup ();
return (0 == errorCount) ? 0 : 1; /* 0 == pass */
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (8dc93b08 -> f02888d4), gnunet, 2023/06/20
- [libmicrohttpd] 03/29: microhttpd.h: fixed typos in comments, gnunet, 2023/06/20
- [libmicrohttpd] 04/29: Renamed connection state for clarity, gnunet, 2023/06/20
- [libmicrohttpd] 02/29: Re-implemented parsing of the request line from scratch., gnunet, 2023/06/20
- [libmicrohttpd] 08/29: tests: minor improvemnts,
gnunet <=
- [libmicrohttpd] 07/29: Removed request line and headers processing old functions and variables, gnunet, 2023/06/20
- [libmicrohttpd] 09/29: daemon: added debug member to avoid accept4() usage, gnunet, 2023/06/20
- [libmicrohttpd] 01/29: Refactoring: check whether memory block is resizable, gnunet, 2023/06/20
- [libmicrohttpd] 06/29: Re-implemented parsing of the request headers and footers from scratch., gnunet, 2023/06/20
- [libmicrohttpd] 12/29: Added back testing with socat as a fallback option, gnunet, 2023/06/20
- [libmicrohttpd] 05/29: Request body processing: removed impossible code paths, gnunet, 2023/06/20
- [libmicrohttpd] 16/29: Added tests with single and double folded header, gnunet, 2023/06/20
- [libmicrohttpd] 21/29: process_request_body(): minor readability improvementы, gnunet, 2023/06/20
- [libmicrohttpd] 11/29: testzzuf: re-worked zzuf testing, gnunet, 2023/06/20
- [libmicrohttpd] 10/29: testzzuf: added special debug functions, gnunet, 2023/06/20