int setup_test_##name(void **state ISC_ATTR_UNUSED);
#define ISC_RUN_TEST_DECLARE(name) \
- void run_test_##name(void **state ISC_ATTR_UNUSED);
+ static void run_test_##name(void **state ISC_ATTR_UNUSED);
#define ISC_TEARDOWN_TEST_DECLARE(name) \
int teardown_test_##name(void **state ISC_ATTR_UNUSED)
int setup_test_##name(void **state ISC_ATTR_UNUSED); \
int setup_test_##name(void **state ISC_ATTR_UNUSED)
-#define ISC_RUN_TEST_IMPL(name) \
- void run_test_##name(void **state ISC_ATTR_UNUSED); \
- void run_test_##name(void **state ISC_ATTR_UNUSED)
+#define ISC_RUN_TEST_IMPL(name) \
+ static void run_test_##name(void **state ISC_ATTR_UNUSED); \
+ static void run_test_##name(void **state ISC_ATTR_UNUSED)
#define ISC_TEARDOWN_TEST_IMPL(name) \
int teardown_test_##name(void **state ISC_ATTR_UNUSED); \
;
#define ISC_LOOP_TEST_CUSTOM_IMPL(name, setup, teardown) \
- void run_test_##name(void **state ISC_ATTR_UNUSED); \
- void loop_test_##name(void *arg ISC_ATTR_UNUSED); \
- void run_test_##name(void **state ISC_ATTR_UNUSED) { \
+ static void run_test_##name(void **state ISC_ATTR_UNUSED); \
+ static void loop_test_##name(void *arg ISC_ATTR_UNUSED); \
+ static void run_test_##name(void **state ISC_ATTR_UNUSED) { \
isc_job_cb setup_loop = setup; \
isc_job_cb teardown_loop = teardown; \
if (setup_loop != NULL) { \
isc_loop_setup(isc_loop_main(), loop_test_##name, state); \
isc_loopmgr_run(); \
} \
- void loop_test_##name(void *arg ISC_ATTR_UNUSED)
+ static void loop_test_##name(void *arg ISC_ATTR_UNUSED)
#define ISC_LOOP_TEST_IMPL(name) ISC_LOOP_TEST_CUSTOM_IMPL(name, NULL, NULL)
#define CNT_MIN 800
#define CNT_MAX 1600
-static size_t shared_counter = 0;
-static size_t expected_counter = SIZE_MAX;
+#if !defined(__SANITIZE_THREAD__)
static isc_mutex_t lock;
static pthread_mutex_t mutex;
+static size_t expected_counter = SIZE_MAX;
+static size_t shared_counter = 0;
static void *
pthread_mutex_thread(void *arg) {
isc_mem_cput(isc_g_mctx, threads, workers, sizeof(*threads));
}
+#endif
ISC_TEST_LIST_START
#define CNT_MIN 800
#define CNT_MAX 1600
+#if !defined(__SANITIZE_THREAD__)
static size_t shared_counter = 0;
static size_t expected_counter = SIZE_MAX;
static uint8_t boundary = 0;
+#endif
static uint8_t *rnd;
static int
/*
* Simple single-threaded lock/tryupgrade/unlock test
*/
+#if !defined(__SANITIZE_THREAD__)
ISC_RUN_TEST_IMPL(isc_rwlock_tryupgrade) {
isc_result_t result;
isc_rwlock_lock(&rwlock, isc_rwlocktype_read);
isc_mem_cput(isc_g_mctx, threads, workers, sizeof(*threads));
}
+#endif
ISC_TEST_LIST_START