diff options
author | ncteisen <ncteisen@gmail.com> | 2017-11-10 16:32:40 -0800 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2017-11-10 16:32:40 -0800 |
commit | 05fbb9d13de546560b1fb799cb4b1ff622c47713 (patch) | |
tree | abfad45444dab518c26ff80e5fef3a32ba41bb77 | |
parent | 756acb689378ca5170f32c75ce022f2a3b116e76 (diff) |
Fix test compile
-rw-r--r-- | src/core/lib/debug/trace.h | 8 | ||||
-rw-r--r-- | test/core/iomgr/timer_list_test.cc | 12 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/core/lib/debug/trace.h b/src/core/lib/debug/trace.h index 20bb623e78..274849d157 100644 --- a/src/core/lib/debug/trace.h +++ b/src/core/lib/debug/trace.h @@ -61,9 +61,8 @@ class TraceFlag { #endif } - private: - static void List(); - + // Only to be used for testing purposes. Tracers should usually be set using + // the static Set function void set_enabled(bool enabled) { #ifdef GRPC_THREADSAFE_TRACER gpr_atm_no_barrier_store(&value_, enabled); @@ -72,6 +71,9 @@ class TraceFlag { #endif } + private: + static void List(); + static TraceFlag *root_tracer_; TraceFlag *next_tracer_; const char *const name_; diff --git a/test/core/iomgr/timer_list_test.cc b/test/core/iomgr/timer_list_test.cc index 4d92cc658a..1fdcbc45d4 100644 --- a/test/core/iomgr/timer_list_test.cc +++ b/test/core/iomgr/timer_list_test.cc @@ -31,8 +31,8 @@ #define MAX_CB 30 -grpc_core::TraceFlag grpc_timer_trace; -grpc_core::TraceFlag grpc_timer_check_trace; +extern grpc_core::TraceFlag grpc_timer_trace; +extern grpc_core::TraceFlag grpc_timer_check_trace; static int cb_called[MAX_CB][2]; @@ -48,8 +48,8 @@ static void add_test(void) { gpr_log(GPR_INFO, "add_test"); grpc_timer_list_init(&exec_ctx); - grpc_timer_trace.value = 1; - grpc_timer_check_trace.value = 1; + grpc_timer_trace.set_enabled(1); + grpc_timer_check_trace.set_enabled(1); memset(cb_called, 0, sizeof(cb_called)); grpc_millis start = grpc_exec_ctx_now(&exec_ctx); @@ -117,8 +117,8 @@ void destruction_test(void) { exec_ctx.now_is_valid = true; exec_ctx.now = 0; grpc_timer_list_init(&exec_ctx); - grpc_timer_trace.value = 1; - grpc_timer_check_trace.value = 1; + grpc_timer_trace.set_enabled(1); + grpc_timer_check_trace.set_enabled(1); memset(cb_called, 0, sizeof(cb_called)); grpc_timer_init( |