diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-10-30 16:19:43 -0700 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-10-30 16:19:43 -0700 |
commit | f8a6c8297c6e9e9024ff169291fb0485862c190f (patch) | |
tree | eb7c45d8b3d9e1866b7bb5e744d7988b7e0213a3 /test | |
parent | 9d301530b2086c78f20684201c4fec37d7539b14 (diff) |
Changes to build other platforms
Diffstat (limited to 'test')
-rw-r--r-- | test/core/end2end/cq_verifier_native.cc | 2 | ||||
-rw-r--r-- | test/core/end2end/cq_verifier_uv.cc | 6 | ||||
-rw-r--r-- | test/core/end2end/fuzzers/api_fuzzer.cc | 2 | ||||
-rw-r--r-- | test/core/iomgr/tcp_client_uv_test.cc | 9 | ||||
-rw-r--r-- | test/core/iomgr/tcp_server_uv_test.cc | 12 | ||||
-rw-r--r-- | test/core/util/test_config.cc | 2 |
6 files changed, 18 insertions, 15 deletions
diff --git a/test/core/end2end/cq_verifier_native.cc b/test/core/end2end/cq_verifier_native.cc index f19b15c465..2bd9401aba 100644 --- a/test/core/end2end/cq_verifier_native.cc +++ b/test/core/end2end/cq_verifier_native.cc @@ -31,7 +31,7 @@ struct cq_verifier { }; cq_verifier *cq_verifier_create(grpc_completion_queue *cq) { - cq_verifier *v = gpr_malloc(sizeof(cq_verifier)); + cq_verifier *v = static_cast<cq_verifier *>(gpr_malloc(sizeof(cq_verifier))); v->cq = cq; cq_verifier_set_first_expectation(v, NULL); return v; diff --git a/test/core/end2end/cq_verifier_uv.cc b/test/core/end2end/cq_verifier_uv.cc index fc873b784f..79e686c8f6 100644 --- a/test/core/end2end/cq_verifier_uv.cc +++ b/test/core/end2end/cq_verifier_uv.cc @@ -43,7 +43,7 @@ struct cq_verifier { }; cq_verifier *cq_verifier_create(grpc_completion_queue *cq) { - cq_verifier *v = gpr_malloc(sizeof(cq_verifier)); + cq_verifier *v = static_cast<cq_verifier *>(gpr_malloc(sizeof(cq_verifier))); v->cq = cq; v->first_expectation = NULL; uv_timer_init(uv_default_loop(), &v->timer); @@ -58,7 +58,7 @@ static void timer_close_cb(uv_handle_t *handle) { void cq_verifier_destroy(cq_verifier *v) { cq_verify(v); uv_close((uv_handle_t *)&v->timer, timer_close_cb); - while ((timer_state)v->timer.data != TIMER_CLOSED) { + while (reinterpret_cast<timer_state>(v->timer.data) != TIMER_CLOSED) { uv_run(uv_default_loop(), UV_RUN_NOWAIT); } gpr_free(v); @@ -85,7 +85,7 @@ grpc_event cq_verifier_next_event(cq_verifier *v, int timeout_seconds) { ev = grpc_completion_queue_next(v->cq, gpr_inf_past(GPR_CLOCK_MONOTONIC), NULL); // Stop the loop if the timer goes off or we get a non-timeout event - while (((timer_state)v->timer.data != TIMER_TRIGGERED) && + while ((reinterpret_cast<timer_state>(v->timer.data) != TIMER_TRIGGERED) && ev.type == GRPC_QUEUE_TIMEOUT) { uv_run(uv_default_loop(), UV_RUN_ONCE); ev = grpc_completion_queue_next(v->cq, gpr_inf_past(GPR_CLOCK_MONOTONIC), diff --git a/test/core/end2end/fuzzers/api_fuzzer.cc b/test/core/end2end/fuzzers/api_fuzzer.cc index 2db8ed474a..62df830e8a 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.cc +++ b/test/core/end2end/fuzzers/api_fuzzer.cc @@ -387,7 +387,7 @@ static void finish_resolve(grpc_exec_ctx *exec_ctx, void *arg, *r->addrs = addrs; } else if (r->lb_addrs != NULL) { grpc_lb_addresses *lb_addrs = grpc_lb_addresses_create(1, NULL); - grpc_lb_addresses_set_address(lb_addrs, 0, NULL, 0, NULL, NULL, NULL); + grpc_lb_addresses_set_address(lb_addrs, 0, NULL, 0, false, NULL, NULL); *r->lb_addrs = lb_addrs; } GRPC_CLOSURE_SCHED(exec_ctx, r->on_done, GRPC_ERROR_NONE); diff --git a/test/core/iomgr/tcp_client_uv_test.cc b/test/core/iomgr/tcp_client_uv_test.cc index edfccbe867..7eb4bd5e4a 100644 --- a/test/core/iomgr/tcp_client_uv_test.cc +++ b/test/core/iomgr/tcp_client_uv_test.cc @@ -75,7 +75,8 @@ static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { static void close_cb(uv_handle_t *handle) { gpr_free(handle); } static void connection_cb(uv_stream_t *server, int status) { - uv_tcp_t *client_handle = gpr_malloc(sizeof(uv_tcp_t)); + uv_tcp_t *client_handle = + static_cast<uv_tcp_t *>(gpr_malloc(sizeof(uv_tcp_t))); GPR_ASSERT(0 == status); GPR_ASSERT(0 == uv_tcp_init(uv_default_loop(), client_handle)); GPR_ASSERT(0 == uv_accept(server, (uv_stream_t *)client_handle)); @@ -85,7 +86,7 @@ static void connection_cb(uv_stream_t *server, int status) { void test_succeeds(void) { grpc_resolved_address resolved_addr; struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr; - uv_tcp_t *svr_handle = gpr_malloc(sizeof(uv_tcp_t)); + uv_tcp_t *svr_handle = static_cast<uv_tcp_t *>(gpr_malloc(sizeof(uv_tcp_t))); int connections_complete_before; grpc_closure done; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; @@ -186,7 +187,7 @@ void test_fails(void) { static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) { - grpc_pollset_destroy(exec_ctx, p); + grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset *>(p)); } int main(int argc, char **argv) { @@ -194,7 +195,7 @@ int main(int argc, char **argv) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_test_init(argc, argv); grpc_init(); - g_pollset = gpr_malloc(grpc_pollset_size()); + g_pollset = static_cast<grpc_pollset *>(gpr_malloc(grpc_pollset_size())); grpc_pollset_init(g_pollset, &g_mu); grpc_exec_ctx_finish(&exec_ctx); test_succeeds(); diff --git a/test/core/iomgr/tcp_server_uv_test.cc b/test/core/iomgr/tcp_server_uv_test.cc index 9fafd3177a..3fcbd4085c 100644 --- a/test/core/iomgr/tcp_server_uv_test.cc +++ b/test/core/iomgr/tcp_server_uv_test.cc @@ -76,7 +76,7 @@ static void on_connect_result_set(on_connect_result *result, static void server_weak_ref_shutdown(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - server_weak_ref *weak_ref = arg; + server_weak_ref *weak_ref = static_cast<server_weak_ref *>(arg); weak_ref->server = NULL; } @@ -190,8 +190,10 @@ static void close_cb(uv_handle_t *handle) { gpr_free(handle); } static void tcp_connect(grpc_exec_ctx *exec_ctx, const struct sockaddr *remote, socklen_t remote_len, on_connect_result *result) { gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10); - uv_tcp_t *client_handle = gpr_malloc(sizeof(uv_tcp_t)); - uv_connect_t *req = gpr_malloc(sizeof(uv_connect_t)); + uv_tcp_t *client_handle = + static_cast<uv_tcp_t *>(gpr_malloc(sizeof(uv_tcp_t))); + uv_connect_t *req = + static_cast<uv_connect_t *>(gpr_malloc(sizeof(uv_connect_t))); int nconnects_before; gpr_mu_lock(g_mu); @@ -291,7 +293,7 @@ static void test_connect(unsigned n) { static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) { - grpc_pollset_destroy(exec_ctx, p); + grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset *>(p)); } int main(int argc, char **argv) { @@ -299,7 +301,7 @@ int main(int argc, char **argv) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_test_init(argc, argv); grpc_init(); - g_pollset = gpr_malloc(grpc_pollset_size()); + g_pollset = static_cast<grpc_pollset *>(gpr_malloc(grpc_pollset_size())); grpc_pollset_init(g_pollset, &g_mu); test_no_op(); diff --git a/test/core/util/test_config.cc b/test/core/util/test_config.cc index 536045e1c3..a673d6b97a 100644 --- a/test/core/util/test_config.cc +++ b/test/core/util/test_config.cc @@ -176,7 +176,7 @@ static LONG crash_handler(struct _EXCEPTION_POINTERS *ex_info) { static void abort_handler(int sig) { fprintf(stderr, "Abort handler called.\n"); - print_current_stack(NULL); + print_current_stack(); if (IsDebuggerPresent()) { __debugbreak(); } else { |