diff options
author | Noah Eisen <ncteisen@google.com> | 2018-02-09 09:34:04 -0800 |
---|---|---|
committer | Noah Eisen <ncteisen@google.com> | 2018-02-09 09:34:04 -0800 |
commit | 4d20a666850b732cf1562487fb5f46ab9654105f (patch) | |
tree | 9059162d0f125e02780f506c2476d5d9bbc0eb7d /test/core/gpr | |
parent | cddf6f838aa48c8d5c9f75cee5a8ed8abdcb25b9 (diff) |
Run clang fmt
Diffstat (limited to 'test/core/gpr')
-rw-r--r-- | test/core/gpr/alloc_test.cc | 4 | ||||
-rw-r--r-- | test/core/gpr/spinlock_test.cc | 9 | ||||
-rw-r--r-- | test/core/gpr/sync_test.cc | 9 |
3 files changed, 15 insertions, 7 deletions
diff --git a/test/core/gpr/alloc_test.cc b/test/core/gpr/alloc_test.cc index 1f6d5962ba..36cdc02ff2 100644 --- a/test/core/gpr/alloc_test.cc +++ b/test/core/gpr/alloc_test.cc @@ -27,7 +27,9 @@ static void* fake_malloc(size_t size) { return (void*)size; } static void* fake_realloc(void* addr, size_t size) { return (void*)size; } -static void fake_free(void* addr) { *(static_cast<intptr_t*>(addr)) = static_cast<intptr_t>(0xdeadd00d); } +static void fake_free(void* addr) { + *(static_cast<intptr_t*>(addr)) = static_cast<intptr_t>(0xdeadd00d); +} static void test_custom_allocs() { const gpr_allocation_functions default_fns = gpr_get_allocation_functions(); diff --git a/test/core/gpr/spinlock_test.cc b/test/core/gpr/spinlock_test.cc index d443684c92..cd6de69126 100644 --- a/test/core/gpr/spinlock_test.cc +++ b/test/core/gpr/spinlock_test.cc @@ -93,7 +93,8 @@ static void test(const char* name, void (*body)(void* m), int timeout_s, gpr_timespec start = gpr_now(GPR_CLOCK_REALTIME); gpr_timespec time_taken; gpr_timespec deadline = gpr_time_add( - start, gpr_time_from_micros(static_cast<int64_t>(timeout_s) * 1000000, GPR_TIMESPAN)); + start, gpr_time_from_micros(static_cast<int64_t>(timeout_s) * 1000000, + GPR_TIMESPAN)); fprintf(stderr, "%s:", name); fflush(stderr); while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0) { @@ -105,14 +106,16 @@ static void test(const char* name, void (*body)(void* m), int timeout_s, test_wait(m); if (m->counter != m->thread_count * m->iterations * m->incr_step) { fprintf(stderr, "counter %ld threads %d iterations %ld\n", - static_cast<long>(m->counter), m->thread_count, static_cast<long>(m->iterations)); + static_cast<long>(m->counter), m->thread_count, + static_cast<long>(m->iterations)); fflush(stderr); GPR_ASSERT(0); } test_destroy(m); } time_taken = gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start); - fprintf(stderr, " done %lld.%09d s\n", static_cast<long long>(time_taken.tv_sec), + fprintf(stderr, " done %lld.%09d s\n", + static_cast<long long>(time_taken.tv_sec), static_cast<int>(time_taken.tv_nsec)); fflush(stderr); } diff --git a/test/core/gpr/sync_test.cc b/test/core/gpr/sync_test.cc index abad930ce6..39ff8852b6 100644 --- a/test/core/gpr/sync_test.cc +++ b/test/core/gpr/sync_test.cc @@ -236,7 +236,8 @@ static void test(const char* name, void (*body)(void* m), gpr_timespec start = gpr_now(GPR_CLOCK_REALTIME); gpr_timespec time_taken; gpr_timespec deadline = gpr_time_add( - start, gpr_time_from_micros(static_cast<int64_t>(timeout_s) * 1000000, GPR_TIMESPAN)); + start, gpr_time_from_micros(static_cast<int64_t>(timeout_s) * 1000000, + GPR_TIMESPAN)); fprintf(stderr, "%s:", name); fflush(stderr); while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0) { @@ -252,7 +253,8 @@ static void test(const char* name, void (*body)(void* m), test_wait(m); if (m->counter != m->threads * m->iterations * m->incr_step) { fprintf(stderr, "counter %ld threads %d iterations %ld\n", - static_cast<long>(m->counter), m->threads, static_cast<long>(m->iterations)); + static_cast<long>(m->counter), m->threads, + static_cast<long>(m->iterations)); fflush(stderr); GPR_ASSERT(0); } @@ -260,7 +262,8 @@ static void test(const char* name, void (*body)(void* m), iterations <<= 1; } time_taken = gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start); - fprintf(stderr, " done %lld.%09d s\n", static_cast<long long>(time_taken.tv_sec), + fprintf(stderr, " done %lld.%09d s\n", + static_cast<long long>(time_taken.tv_sec), static_cast<int>(time_taken.tv_nsec)); fflush(stderr); } |