diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-01-18 14:36:47 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-01-18 14:36:47 -0800 |
commit | ecd49345b5c500b9ea1da70b15c90b87da3ff55a (patch) | |
tree | 29afa5d2986d5c85a93e126c1d1f1cd1213d82ab /test/core | |
parent | cf1d6eb4ae1b48958454259f7e26bee9140cbf65 (diff) |
Use clang-format-3.5
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/channel/channel_stack_test.c | 4 | ||||
-rw-r--r-- | test/core/channel/metadata_buffer_test.c | 4 | ||||
-rw-r--r-- | test/core/end2end/cq_verifier.c | 1 | ||||
-rw-r--r-- | test/core/end2end/tests/max_concurrent_streams.c | 2 | ||||
-rw-r--r-- | test/core/end2end/tests/thread_stress.c | 4 | ||||
-rw-r--r-- | test/core/iomgr/alarm_list_test.c | 14 | ||||
-rw-r--r-- | test/core/iomgr/endpoint_tests.c | 4 | ||||
-rw-r--r-- | test/core/statistics/hash_table_test.c | 22 | ||||
-rw-r--r-- | test/core/surface/completion_queue_benchmark.c | 14 | ||||
-rw-r--r-- | test/core/surface/completion_queue_test.c | 20 | ||||
-rw-r--r-- | test/core/transport/chttp2/stream_map_test.c | 6 |
11 files changed, 47 insertions, 48 deletions
diff --git a/test/core/channel/channel_stack_test.c b/test/core/channel/channel_stack_test.c index fb52fe3270..d0ea79c34e 100644 --- a/test/core/channel/channel_stack_test.c +++ b/test/core/channel/channel_stack_test.c @@ -78,9 +78,9 @@ static void channel_func(grpc_channel_element *elem, static void test_create_channel_stack(void) { const grpc_channel_filter filter = { - call_func, channel_func, + call_func, channel_func, - sizeof(int), call_init_func, call_destroy_func, + sizeof(int), call_init_func, call_destroy_func, sizeof(int), channel_init_func, channel_destroy_func, }; diff --git a/test/core/channel/metadata_buffer_test.c b/test/core/channel/metadata_buffer_test.c index 5604e25705..aa2399272f 100644 --- a/test/core/channel/metadata_buffer_test.c +++ b/test/core/channel/metadata_buffer_test.c @@ -78,7 +78,7 @@ static void expect_call_op(grpc_call_element *elem, GPR_ASSERT(op->dir == GRPC_CALL_DOWN); GPR_ASSERT(op->flags == *n); GPR_ASSERT(op->done_cb == do_nothing); - GPR_ASSERT(op->user_data == (void *)(gpr_uintptr)*n); + GPR_ASSERT(op->user_data == (void *)(gpr_uintptr) * n); GPR_ASSERT(0 == gpr_slice_cmp(op->data.metadata->key->slice, key)); GPR_ASSERT(0 == gpr_slice_cmp(op->data.metadata->value->slice, value)); @@ -148,7 +148,7 @@ static void test_case(size_t key_prefix_len, size_t value_prefix_len, op.flags = i; op.data.metadata = grpc_mdelem_from_slices(mdctx, key, value); op.done_cb = do_nothing; - op.user_data = (void *)(gpr_uintptr)i; + op.user_data = (void *)(gpr_uintptr) i; grpc_metadata_buffer_queue(&buffer, &op); } diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c index 60b0bf3303..9fa513126f 100644 --- a/test/core/end2end/cq_verifier.c +++ b/test/core/end2end/cq_verifier.c @@ -495,4 +495,3 @@ void cq_expect_finished(cq_verifier *v, void *tag, ...) { void cq_expect_server_shutdown(cq_verifier *v, void *tag) { add(v, GRPC_SERVER_SHUTDOWN, tag); } - diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c index e88f418cb0..1db32b1de9 100644 --- a/test/core/end2end/tests/max_concurrent_streams.c +++ b/test/core/end2end/tests/max_concurrent_streams.c @@ -203,7 +203,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { GPR_ASSERT(ev->data.invoke_accepted == GRPC_OP_OK); /* The /alpha or /beta calls started above could be invoked (but NOT both); * check this here */ - live_call = (int)(gpr_intptr)ev->tag; + live_call = (int)(gpr_intptr) ev->tag; live_call_obj = live_call == 300 ? c1 : c2; grpc_event_finish(ev); diff --git a/test/core/end2end/tests/thread_stress.c b/test/core/end2end/tests/thread_stress.c index 5410258201..2de0497a7a 100644 --- a/test/core/end2end/tests/thread_stress.c +++ b/test/core/end2end/tests/thread_stress.c @@ -282,11 +282,11 @@ static void run_test(grpc_end2end_test_config config, int requests_in_flight) { /* kick off threads */ for (i = 0; i < CLIENT_THREADS; i++) { gpr_event_init(&g_client_done[i]); - gpr_thd_new(&thd_id, client_thread, (void *)(gpr_intptr)i, NULL); + gpr_thd_new(&thd_id, client_thread, (void *)(gpr_intptr) i, NULL); } for (i = 0; i < SERVER_THREADS; i++) { gpr_event_init(&g_server_done[i]); - gpr_thd_new(&thd_id, server_thread, (void *)(gpr_intptr)i, NULL); + gpr_thd_new(&thd_id, server_thread, (void *)(gpr_intptr) i, NULL); } /* start requests */ diff --git a/test/core/iomgr/alarm_list_test.c b/test/core/iomgr/alarm_list_test.c index a250951231..ce9b7f4c66 100644 --- a/test/core/iomgr/alarm_list_test.c +++ b/test/core/iomgr/alarm_list_test.c @@ -61,13 +61,13 @@ static void add_test(void) { /* 10 ms alarms. will expire in the current epoch */ for (i = 0; i < 10; i++) { grpc_alarm_init(&alarms[i], gpr_time_add(start, gpr_time_from_millis(10)), - cb, (void *)(gpr_intptr)i, start); + cb, (void *)(gpr_intptr) i, start); } /* 1010 ms alarms. will expire in the next epoch */ for (i = 10; i < 20; i++) { grpc_alarm_init(&alarms[i], gpr_time_add(start, gpr_time_from_millis(1010)), - cb, (void *)(gpr_intptr)i, start); + cb, (void *)(gpr_intptr) i, start); } /* collect alarms. Only the first batch should be ready. */ @@ -115,15 +115,15 @@ void destruction_test(void) { memset(cb_called, 0, sizeof(cb_called)); grpc_alarm_init(&alarms[0], gpr_time_from_millis(100), cb, - (void *)(gpr_intptr)0, gpr_time_0); + (void *)(gpr_intptr) 0, gpr_time_0); grpc_alarm_init(&alarms[1], gpr_time_from_millis(3), cb, - (void *)(gpr_intptr)1, gpr_time_0); + (void *)(gpr_intptr) 1, gpr_time_0); grpc_alarm_init(&alarms[2], gpr_time_from_millis(100), cb, - (void *)(gpr_intptr)2, gpr_time_0); + (void *)(gpr_intptr) 2, gpr_time_0); grpc_alarm_init(&alarms[3], gpr_time_from_millis(3), cb, - (void *)(gpr_intptr)3, gpr_time_0); + (void *)(gpr_intptr) 3, gpr_time_0); grpc_alarm_init(&alarms[4], gpr_time_from_millis(1), cb, - (void *)(gpr_intptr)4, gpr_time_0); + (void *)(gpr_intptr) 4, gpr_time_0); GPR_ASSERT(1 == grpc_alarm_check(NULL, gpr_time_from_millis(2), NULL)); GPR_ASSERT(1 == cb_called[4][1]); grpc_alarm_cancel(&alarms[0]); diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c index 125cde4678..dc5747bf57 100644 --- a/test/core/iomgr/endpoint_tests.c +++ b/test/core/iomgr/endpoint_tests.c @@ -290,7 +290,7 @@ static void shutdown_during_write_test_read_handler( if (error != GRPC_ENDPOINT_CB_OK) { grpc_endpoint_destroy(st->ep); - gpr_event_set(&st->ev, (void *)(gpr_intptr)error); + gpr_event_set(&st->ev, (void *)(gpr_intptr) error); } else { grpc_endpoint_notify_on_read( st->ep, shutdown_during_write_test_read_handler, user_data); @@ -309,7 +309,7 @@ static void shutdown_during_write_test_write_handler( gpr_log(GPR_ERROR, "shutdown_during_write_test_write_handler completed unexpectedly"); } - gpr_event_set(&st->ev, (void *)(gpr_intptr)1); + gpr_event_set(&st->ev, (void *)(gpr_intptr) 1); } static void shutdown_during_write_test(grpc_endpoint_test_config config, diff --git a/test/core/statistics/hash_table_test.c b/test/core/statistics/hash_table_test.c index 5d05ab5bc4..ebfc2a2a9a 100644 --- a/test/core/statistics/hash_table_test.c +++ b/test/core/statistics/hash_table_test.c @@ -64,8 +64,8 @@ static void free_data(void* data) { gpr_free(data); } static void test_create_table(void) { /* Create table with uint64 key type */ census_ht* ht = NULL; - census_ht_option ht_options = {CENSUS_HT_UINT64, 1999, NULL, NULL, NULL, - NULL}; + census_ht_option ht_options = {CENSUS_HT_UINT64, 1999, NULL, + NULL, NULL, NULL}; ht = census_ht_create(&ht_options); GPR_ASSERT(ht != NULL); GPR_ASSERT(census_ht_get_size(ht) == 0); @@ -119,8 +119,8 @@ static void test_table_with_int_key(void) { /* Test that there is no memory leak when keys and values are owned by table. */ static void test_value_and_key_deleter(void) { - census_ht_option opt = {CENSUS_HT_POINTER, 7, &hash64, &cmp_str_keys, - &free_data, &free_data}; + census_ht_option opt = {CENSUS_HT_POINTER, 7, &hash64, + &cmp_str_keys, &free_data, &free_data}; census_ht* ht = census_ht_create(&opt); census_ht_key key; char* val = NULL; @@ -184,8 +184,8 @@ static void test_simple_add_and_erase(void) { } static void test_insertion_and_deletion_with_high_collision_rate(void) { - census_ht_option opt = {CENSUS_HT_POINTER, 13, &force_collision, - &cmp_str_keys, NULL, NULL}; + census_ht_option opt = {CENSUS_HT_POINTER, 13, &force_collision, + &cmp_str_keys, NULL, NULL}; census_ht* ht = census_ht_create(&opt); char key_str[1000][10]; gpr_uint64 val = 0; @@ -208,12 +208,12 @@ static void test_insertion_and_deletion_with_high_collision_rate(void) { } static void test_table_with_string_key(void) { - census_ht_option opt = {CENSUS_HT_POINTER, 7, &hash64, &cmp_str_keys, NULL, - NULL}; + census_ht_option opt = {CENSUS_HT_POINTER, 7, &hash64, + &cmp_str_keys, NULL, NULL}; census_ht* ht = census_ht_create(&opt); - const char* keys[] = {"k1", "a", "000", "apple", - "banana_a_long_long_long_banana", "%$", "111", "foo", - "b"}; + const char* keys[] = {"k1", "a", "000", + "apple", "banana_a_long_long_long_banana", "%$", + "111", "foo", "b"}; const int vals[] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; int i = 0; GPR_ASSERT(ht != NULL); diff --git a/test/core/surface/completion_queue_benchmark.c b/test/core/surface/completion_queue_benchmark.c index e1b9d0d035..5360d7c6c3 100644 --- a/test/core/surface/completion_queue_benchmark.c +++ b/test/core/surface/completion_queue_benchmark.c @@ -53,23 +53,23 @@ static void producer_thread(void *arg) { test_thread_options *opt = arg; int i; - gpr_event_set(&opt->on_started, (void *)(gpr_intptr)1); + gpr_event_set(&opt->on_started, (void *)(gpr_intptr) 1); GPR_ASSERT(gpr_event_wait(opt->start, gpr_inf_future)); for (i = 0; i < opt->iterations; i++) { grpc_cq_begin_op(opt->cc, NULL, GRPC_WRITE_ACCEPTED); - grpc_cq_end_write_accepted(opt->cc, (void *)(gpr_intptr)1, NULL, NULL, NULL, - GRPC_OP_OK); + grpc_cq_end_write_accepted(opt->cc, (void *)(gpr_intptr) 1, NULL, NULL, + NULL, GRPC_OP_OK); } - gpr_event_set(&opt->on_finished, (void *)(gpr_intptr)1); + gpr_event_set(&opt->on_finished, (void *)(gpr_intptr) 1); } static void consumer_thread(void *arg) { test_thread_options *opt = arg; grpc_event *ev; - gpr_event_set(&opt->on_started, (void *)(gpr_intptr)1); + gpr_event_set(&opt->on_started, (void *)(gpr_intptr) 1); GPR_ASSERT(gpr_event_wait(opt->start, gpr_inf_future)); for (;;) { @@ -78,7 +78,7 @@ static void consumer_thread(void *arg) { case GRPC_WRITE_ACCEPTED: break; case GRPC_QUEUE_SHUTDOWN: - gpr_event_set(&opt->on_finished, (void *)(gpr_intptr)1); + gpr_event_set(&opt->on_finished, (void *)(gpr_intptr) 1); return; default: gpr_log(GPR_ERROR, "Invalid event received: %d", ev->type); @@ -112,7 +112,7 @@ double ops_per_second(int consumers, int producers, int iterations) { /* start the benchmark */ t_start = gpr_now(); - gpr_event_set(&start, (void *)(gpr_intptr)1); + gpr_event_set(&start, (void *)(gpr_intptr) 1); /* wait for producers to finish */ for (i = 0; i < producers; i++) { diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index 71f9cc2291..4bbe9cc96f 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -282,7 +282,7 @@ static void producer_thread(void *arg) { int i; gpr_log(GPR_INFO, "producer %d started", opt->id); - gpr_event_set(&opt->on_started, (void *)(gpr_intptr)1); + gpr_event_set(&opt->on_started, (void *)(gpr_intptr) 1); GPR_ASSERT(gpr_event_wait(opt->phase1, ten_seconds_time())); gpr_log(GPR_INFO, "producer %d phase 1", opt->id); @@ -291,18 +291,18 @@ static void producer_thread(void *arg) { } gpr_log(GPR_INFO, "producer %d phase 1 done", opt->id); - gpr_event_set(&opt->on_phase1_done, (void *)(gpr_intptr)1); + gpr_event_set(&opt->on_phase1_done, (void *)(gpr_intptr) 1); GPR_ASSERT(gpr_event_wait(opt->phase2, ten_seconds_time())); gpr_log(GPR_INFO, "producer %d phase 2", opt->id); for (i = 0; i < TEST_THREAD_EVENTS; i++) { - grpc_cq_end_write_accepted(opt->cc, (void *)(gpr_intptr)1, NULL, NULL, NULL, - GRPC_OP_OK); + grpc_cq_end_write_accepted(opt->cc, (void *)(gpr_intptr) 1, NULL, NULL, + NULL, GRPC_OP_OK); opt->events_triggered++; } gpr_log(GPR_INFO, "producer %d phase 2 done", opt->id); - gpr_event_set(&opt->on_finished, (void *)(gpr_intptr)1); + gpr_event_set(&opt->on_finished, (void *)(gpr_intptr) 1); } static void consumer_thread(void *arg) { @@ -310,13 +310,13 @@ static void consumer_thread(void *arg) { grpc_event *ev; gpr_log(GPR_INFO, "consumer %d started", opt->id); - gpr_event_set(&opt->on_started, (void *)(gpr_intptr)1); + gpr_event_set(&opt->on_started, (void *)(gpr_intptr) 1); GPR_ASSERT(gpr_event_wait(opt->phase1, ten_seconds_time())); gpr_log(GPR_INFO, "consumer %d phase 1", opt->id); gpr_log(GPR_INFO, "consumer %d phase 1 done", opt->id); - gpr_event_set(&opt->on_phase1_done, (void *)(gpr_intptr)1); + gpr_event_set(&opt->on_phase1_done, (void *)(gpr_intptr) 1); GPR_ASSERT(gpr_event_wait(opt->phase2, ten_seconds_time())); gpr_log(GPR_INFO, "consumer %d phase 2", opt->id); @@ -331,7 +331,7 @@ static void consumer_thread(void *arg) { break; case GRPC_QUEUE_SHUTDOWN: gpr_log(GPR_INFO, "consumer %d phase 2 done", opt->id); - gpr_event_set(&opt->on_finished, (void *)(gpr_intptr)1); + gpr_event_set(&opt->on_finished, (void *)(gpr_intptr) 1); grpc_event_finish(ev); return; default: @@ -376,7 +376,7 @@ static void test_threading(int producers, int consumers) { /* start phase1: producers will pre-declare all operations they will complete */ gpr_log(GPR_INFO, "start phase 1"); - gpr_event_set(&phase1, (void *)(gpr_intptr)1); + gpr_event_set(&phase1, (void *)(gpr_intptr) 1); gpr_log(GPR_INFO, "wait phase 1"); for (i = 0; i < producers + consumers; i++) { @@ -386,7 +386,7 @@ static void test_threading(int producers, int consumers) { /* start phase2: operations will complete, and consumers will consume them */ gpr_log(GPR_INFO, "start phase 2"); - gpr_event_set(&phase2, (void *)(gpr_intptr)1); + gpr_event_set(&phase2, (void *)(gpr_intptr) 1); /* in parallel, we shutdown the completion channel - all events should still be consumed */ diff --git a/test/core/transport/chttp2/stream_map_test.c b/test/core/transport/chttp2/stream_map_test.c index 9b4446f7f8..30cd63ca67 100644 --- a/test/core/transport/chttp2/stream_map_test.c +++ b/test/core/transport/chttp2/stream_map_test.c @@ -93,7 +93,7 @@ static void test_basic_add_find(size_t n) { grpc_chttp2_stream_map_init(&map, 8); GPR_ASSERT(0 == grpc_chttp2_stream_map_size(&map)); for (i = 1; i <= n; i++) { - grpc_chttp2_stream_map_add(&map, i, (void *)(gpr_uintptr)i); + grpc_chttp2_stream_map_add(&map, i, (void *)(gpr_uintptr) i); } GPR_ASSERT(n == grpc_chttp2_stream_map_size(&map)); GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 0)); @@ -148,7 +148,7 @@ static void test_delete_evens_sweep(size_t n) { grpc_chttp2_stream_map_init(&map, 8); for (i = 1; i <= n; i++) { - grpc_chttp2_stream_map_add(&map, i, (void *)(gpr_uintptr)i); + grpc_chttp2_stream_map_add(&map, i, (void *)(gpr_uintptr) i); } for (i = 1; i <= n; i++) { if ((i & 1) == 0) { @@ -170,7 +170,7 @@ static void test_delete_evens_incremental(size_t n) { grpc_chttp2_stream_map_init(&map, 8); for (i = 1; i <= n; i++) { - grpc_chttp2_stream_map_add(&map, i, (void *)(gpr_uintptr)i); + grpc_chttp2_stream_map_add(&map, i, (void *)(gpr_uintptr) i); if ((i & 1) == 0) { grpc_chttp2_stream_map_delete(&map, i); } |