mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-13 14:26:30 -04:00
test: really disable bufferevent_pair_release_lock under ASAN (and fix gcc)
(cherry picked from commit 7b9ba3b717af109abdf3fb5fc99c288dc8024ef5)
This commit is contained in:
parent
ff67e8c268
commit
82ae28e1d7
@ -29,9 +29,18 @@
|
|||||||
/* The old tests here need assertions to work. */
|
/* The old tests here need assertions to work. */
|
||||||
#undef NDEBUG
|
#undef NDEBUG
|
||||||
|
|
||||||
|
/**
|
||||||
|
* - clang supports __has_feature
|
||||||
|
* - gcc supports __SANITIZE_ADDRESS__
|
||||||
|
*
|
||||||
|
* Let's set __SANITIZE_ADDRESS__ if __has_feature(address_sanitizer)
|
||||||
|
*/
|
||||||
#ifndef __has_feature
|
#ifndef __has_feature
|
||||||
#define __has_feature(x) 0
|
#define __has_feature(x) 0
|
||||||
#endif
|
#endif
|
||||||
|
#if !defined(__SANITIZE_ADDRESS__) && __has_feature(address_sanitizer)
|
||||||
|
#define __SANITIZE_ADDRESS__
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
@ -207,7 +216,7 @@ static void test_bufferevent_pair_flush_normal(void) { test_bufferevent_impl(1,
|
|||||||
static void test_bufferevent_pair_flush_flush(void) { test_bufferevent_impl(1, BEV_FLUSH); }
|
static void test_bufferevent_pair_flush_flush(void) { test_bufferevent_impl(1, BEV_FLUSH); }
|
||||||
static void test_bufferevent_pair_flush_finished(void) { test_bufferevent_impl(1, BEV_FINISHED); }
|
static void test_bufferevent_pair_flush_finished(void) { test_bufferevent_impl(1, BEV_FINISHED); }
|
||||||
|
|
||||||
#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED) && __has_feature(address_sanitizer)
|
#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED) && !defined(__SANITIZE_ADDRESS__)
|
||||||
/**
|
/**
|
||||||
* Trace lock/unlock/alloc/free for locks.
|
* Trace lock/unlock/alloc/free for locks.
|
||||||
* (More heavier then evthread_debug*)
|
* (More heavier then evthread_debug*)
|
||||||
@ -1355,7 +1364,7 @@ struct testcase_t bufferevent_testcases[] = {
|
|||||||
LEGACY(bufferevent_pair_flush_normal, TT_ISOLATED),
|
LEGACY(bufferevent_pair_flush_normal, TT_ISOLATED),
|
||||||
LEGACY(bufferevent_pair_flush_flush, TT_ISOLATED),
|
LEGACY(bufferevent_pair_flush_flush, TT_ISOLATED),
|
||||||
LEGACY(bufferevent_pair_flush_finished, TT_ISOLATED),
|
LEGACY(bufferevent_pair_flush_finished, TT_ISOLATED),
|
||||||
#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED) && __has_feature(address_sanitizer)
|
#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED) && !defined(__SANITIZE_ADDRESS__)
|
||||||
{ "bufferevent_pair_release_lock", test_bufferevent_pair_release_lock,
|
{ "bufferevent_pair_release_lock", test_bufferevent_pair_release_lock,
|
||||||
TT_FORK|TT_ISOLATED|TT_NEED_THREADS|TT_NEED_BASE|TT_LEGACY|TT_NO_LOGS,
|
TT_FORK|TT_ISOLATED|TT_NEED_THREADS|TT_NEED_BASE|TT_LEGACY|TT_NO_LOGS,
|
||||||
&basic_setup, NULL },
|
&basic_setup, NULL },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user