install_steps: skiprun mbedtls-latest-intel rustls wolfssl-opensslextra-intel
install_steps_brew: openssl@4 gsasl
CC: clang-20
+ CFLAGS: -Wunused-macros
LDFLAGS: >-
-Wl,-rpath,/home/runner/wolfssl-opensslextra/lib
-Wl,-rpath,/home/runner/mbedtls/lib
install_steps: skiprun
install_steps_brew: libngtcp2 libnghttp3 c-ares
CC: clang-20
+ CFLAGS: -Wunused-macros
LDFLAGS: >-
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/openssl/lib
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/libngtcp2/lib
compiler: clang
install: llvm gnutls nettle libressl krb5 mbedtls gsasl rustls-ffi libssh fish
install_steps: skiprun
+ CFLAGS: -Wunused-macros
chkprefill: _chkprefill
generate: >-
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DCURL_DEFAULT_SSL_BACKEND=openssl
compiler: clang
install: llvm libnghttp3 libngtcp2 openldap krb5
install_steps: skipall
+ CFLAGS: -Wunused-macros
generate: >-
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DUSE_NGTCP2=ON
-DLDAP_INCLUDE_DIR=/opt/homebrew/opt/openldap/include
- name: 'configure'
env:
+ CFLAGS: '${{ matrix.build.CFLAGS }}'
MATRIX_CHKPREFILL: '${{ matrix.build.chkprefill }}'
MATRIX_CONFIGURE: '${{ matrix.build.configure }}'
MATRIX_GENERATE: '${{ matrix.build.generate }}'
false
fi
else
- export CFLAGS
if [[ "${MATRIX_COMPILER}" = 'llvm'* ]]; then
options+=" --target=$(uname -m)-apple-darwin"
fi
include:
- { build: 'autotools', compiler: 'gcc' }
- { build: 'cmake' , compiler: 'gcc' }
- - { build: 'cmake' , compiler: 'clang-tidy', install_packages: 'clang-20 clang-tidy-20' }
+ - { build: 'cmake' , compiler: 'clang-tidy', install_packages: 'clang-20 clang-tidy-20', CFLAGS: '-Wunused-macros' }
steps:
- name: 'install packages'
timeout-minutes: 2
run: autoreconf -fi
- name: 'configure'
+ env:
+ CFLAGS: '${{ matrix.CFLAGS }}'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
if [ "${MATRIX_COMPILER}" = 'clang-tidy' ]; then
#ifndef CURL_DISABLE_PARSEDATE
+#if SIZEOF_TIME_T < 5
#define PARSEDATE_LATER 1
+#endif
+#if SIZEOF_TIME_T < 5 || defined(HAVE_TIME_T_UNSIGNED)
#define PARSEDATE_SOONER 2
+#endif
static const char * const weekday[] = {
"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
#include <sys/select.h>
#endif
+#ifndef UNITTESTS
#define test_setopt(A, B, C) \
do { \
result = curl_easy_setopt(A, B, C); \
if(result != CURLE_OK) \
goto test_cleanup; \
} while(0)
+#endif /* !UNITTESTS */
+#if 0
#define test_multi_setopt(A, B, C) \
do { \
result = curl_multi_setopt(A, B, C); \
if(result != CURLE_OK) \
goto test_cleanup; \
} while(0)
+#endif
extern const char *libtest_arg2; /* set by first.c to the argv[2] or NULL */
extern const char *libtest_arg3; /* set by first.c to the argv[3] or NULL */
*
* For portability reasons TEST_ERR_* values should be less than 127.
*/
-
+#if !defined(UNITTESTS) || defined(BUILDING_LIBCURL)
#define TEST_ERR_MAJOR_BAD CURLE_OBSOLETE20
+#endif
+#ifndef UNITTESTS
#define TEST_ERR_RUNS_FOREVER CURLE_OBSOLETE24
#define TEST_ERR_EASY_INIT CURLE_OBSOLETE29
#define TEST_ERR_MULTI CURLE_OBSOLETE32
} \
} while(0)
+#if 0
#define res_multi_setopt(A, B, C) \
exe_multi_setopt(A, B, C, __FILE__, __LINE__)
+#endif
#define chk_multi_setopt(A, B, C, Y, Z) \
do { \
} \
} while(0)
+#if 0
#define res_multi_remove_handle(A, B) \
exe_multi_remove_handle(A, B, __FILE__, __LINE__)
+#endif
#define chk_multi_remove_handle(A, B, Y, Z) \
do { \
} \
} while(0)
+#if 0
#define res_multi_poll(A, B, C, D, E) \
exe_multi_poll(A, B, C, D, E, __FILE__, __LINE__)
+#endif
#define chk_multi_poll(A, B, C, D, E, Y, Z) \
do { \
#define res_multi_wakeup(A) \
exe_multi_wakeup(A, __FILE__, __LINE__)
+#if 0
#define chk_multi_wakeup(A, Y, Z) \
do { \
exe_multi_wakeup(A, Y, Z); \
#define multi_wakeup(A) \
chk_multi_wakeup(A, __FILE__, __LINE__)
+#endif
/* ---------------------------------------------------------------- */
#define res_test_timedout() \
exe_test_timedout(TEST_HANG_TIMEOUT, __FILE__, __LINE__)
+#if 0
#define res_test_timedout_custom(T) \
exe_test_timedout(T, __FILE__, __LINE__)
+#endif
#define chk_test_timedout(T, Y, Z) \
do { \
#define abort_on_test_timeout_custom(T) \
chk_test_timedout(T, __FILE__, __LINE__)
+#define NUM_HANDLES 4 /* global default */
+
+#define res_global_init(A) \
+ exe_global_init(A, __FILE__, __LINE__)
+
+#endif /* !UNITTESTS */
+
+#if !defined(UNITTESTS) || defined(BUILDING_LIBCURL)
+
/* ---------------------------------------------------------------- */
#define exe_global_init(A, Y, Z) \
} \
} while(0)
-#define res_global_init(A) \
- exe_global_init(A, __FILE__, __LINE__)
-
#define chk_global_init(A, Y, Z) \
do { \
exe_global_init(A, Y, Z); \
#define global_init(A) \
chk_global_init(A, __FILE__, __LINE__)
-#define NO_SUPPORT_BUILT_IN \
- { \
- (void)URL; \
- curl_mfprintf(stderr, "Missing support\n"); \
- return CURLE_UNSUPPORTED_PROTOCOL; \
- }
-
-#define NUM_HANDLES 4 /* global default */
+#endif /* !UNITTESTS || BUILDING_LIBCURL */
#endif /* HEADER_LIBTEST_FIRST_H */
***************************************************************************/
#include "first.h"
-#define print_err(name, exp) \
- curl_mfprintf(stderr, "Type mismatch for CURLOPT_%s (expected %s)\n", \
- name, exp)
-
static CURLcode test_lib1912(const char *URL)
{
/* Only test if GCC/clang type checking is available */
int error = 0;
#ifdef CURLINC_TYPECHECK_GCC_H
const struct curl_easyoption *o;
+
+#define print_err(name, exp) \
+ curl_mfprintf(stderr, "Type mismatch for CURLOPT_%s (expected %s)\n", \
+ name, exp)
+
for(o = curl_easy_option_next(NULL); o; o = curl_easy_option_next(o)) {
/* Test for mismatch OR missing typecheck macros */
if(curlcheck_long_option(o->id) !=
curl_global_cleanup();
return result;
#else
- NO_SUPPORT_BUILT_IN
+ (void)URL;
+ curl_mfprintf(stderr, "Missing support\n");
+ return CURLE_UNSUPPORTED_PROTOCOL;
#endif
}
curl_global_cleanup();
return result;
#else
- NO_SUPPORT_BUILT_IN
+ (void)URL;
+ curl_mfprintf(stderr, "Missing support\n");
+ return CURLE_UNSUPPORTED_PROTOCOL;
#endif
}
curl_global_cleanup();
return result;
#else
- NO_SUPPORT_BUILT_IN
+ (void)URL;
+ curl_mfprintf(stderr, "Missing support\n");
+ return CURLE_UNSUPPORTED_PROTOCOL;
#endif
}
curl_global_cleanup();
return result;
#else
- NO_SUPPORT_BUILT_IN
+ (void)URL;
+ curl_mfprintf(stderr, "Missing support\n");
+ return CURLE_UNSUPPORTED_PROTOCOL;
#endif
}
***************************************************************************/
#include "first.h"
+#if defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
+
#include "testutil.h"
#define T518_SAFETY_MARGIN 16
#define DEV_NULL "/dev/null"
#endif
-#if defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
-
static int *t518_testfd = NULL;
static struct rlimit t518_num_open;
static char t518_msgbuff[256];
***************************************************************************/
#include "first.h"
+#if defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
+
#include "testutil.h"
#define T537_SAFETY_MARGIN 11
#define DEV_NULL "/dev/null"
#endif
-#if defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
-
static int *t537_testfd = NULL;
static struct rlimit t537_num_open;
static char t537_msgbuff[256];
#define QTYPE_AAAA 28
#define QTYPE_HTTPS 0x41
+#if 0
#define HTTPS_RR_CODE_MANDATORY 0x00
+#endif
#define HTTPS_RR_CODE_ALPN 0x01
#define HTTPS_RR_CODE_NO_DEF_ALPN 0x02
+#if 0
#define HTTPS_RR_CODE_PORT 0x03
#define HTTPS_RR_CODE_IPV4 0x04
#define HTTPS_RR_CODE_ECH 0x05
#define HTTPS_RR_CODE_IPV6 0x06
+#endif
static const char *type2string(uint16_t qtype)
{
#define MAC_DIFFER 0x40
#define MAC_SHIFT 16
+#if 0
#define MAC_MATCH ((CURL_FNMATCH_MATCH << MAC_SHIFT) | MAC_DIFFER)
#define MAC_NOMATCH ((CURL_FNMATCH_NOMATCH << MAC_SHIFT) | MAC_DIFFER)
+#endif
#define MAC_FAIL ((CURL_FNMATCH_FAIL << MAC_SHIFT) | MAC_DIFFER)
static const char *ret2name(int i)
UNITTEST_END_SIMPLE
}
-#undef OID
-
#else
static CURLcode test_unit1666(const char *arg)
CURLcode result_exp;
};
-/* the size of the object needs to deduct the null terminator */
-#define OID(x) x, sizeof(x) - 1
-
static bool test1667(const struct test_1667 *spec, size_t i,
struct dynbuf *dbuf)
{
UNITTEST_END_SIMPLE
}
-#undef OID
-
#else
static CURLcode test_unit1667(const char *arg)