diff options
Diffstat (limited to 'test/core/iomgr')
-rw-r--r-- | test/core/iomgr/alarm_heap_test.c | 6 | ||||
-rw-r--r-- | test/core/iomgr/alarm_list_test.c | 6 | ||||
-rw-r--r-- | test/core/iomgr/alarm_test.c | 2 | ||||
-rw-r--r-- | test/core/iomgr/fd_posix_test.c | 4 | ||||
-rw-r--r-- | test/core/iomgr/resolve_address_test.c | 16 | ||||
-rw-r--r-- | test/core/iomgr/sockaddr_utils_test.c | 8 | ||||
-rw-r--r-- | test/core/iomgr/tcp_client_posix_test.c | 8 | ||||
-rw-r--r-- | test/core/iomgr/tcp_posix_test.c | 4 | ||||
-rw-r--r-- | test/core/iomgr/tcp_server_posix_test.c | 8 | ||||
-rw-r--r-- | test/core/iomgr/time_averaged_stats_test.c | 16 |
10 files changed, 39 insertions, 39 deletions
diff --git a/test/core/iomgr/alarm_heap_test.c b/test/core/iomgr/alarm_heap_test.c index eaaaf156f4..abb1086a22 100644 --- a/test/core/iomgr/alarm_heap_test.c +++ b/test/core/iomgr/alarm_heap_test.c @@ -40,7 +40,7 @@ #include <grpc/support/log.h> #include "test/core/util/test_config.h" -static gpr_timespec random_deadline() { +static gpr_timespec random_deadline(void) { gpr_timespec ts; ts.tv_sec = rand(); ts.tv_nsec = rand(); @@ -150,7 +150,7 @@ static void check_valid(grpc_alarm_heap *pq) { } } -static void test1() { +static void test1(void) { grpc_alarm_heap pq; const int num_test_elements = 200; const int num_test_operations = 10000; @@ -206,7 +206,7 @@ static void test1() { gpr_free(inpq); } -static void shrink_test() { +static void shrink_test(void) { grpc_alarm_heap pq; int i; int expected_size; diff --git a/test/core/iomgr/alarm_list_test.c b/test/core/iomgr/alarm_list_test.c index 686d21d705..a250951231 100644 --- a/test/core/iomgr/alarm_list_test.c +++ b/test/core/iomgr/alarm_list_test.c @@ -44,13 +44,13 @@ static int cb_called[MAX_CB][2]; static int kicks; -void grpc_kick_poller() { ++kicks; } +void grpc_kick_poller(void) { ++kicks; } static void cb(void *arg, int success) { cb_called[(gpr_intptr)arg][success]++; } -static void add_test() { +static void add_test(void) { gpr_timespec start = gpr_now(); int i; grpc_alarm alarms[20]; @@ -108,7 +108,7 @@ static void add_test() { } /* Cleaning up a list with pending alarms. */ -void destruction_test() { +void destruction_test(void) { grpc_alarm alarms[5]; grpc_alarm_list_init(gpr_time_0); diff --git a/test/core/iomgr/alarm_test.c b/test/core/iomgr/alarm_test.c index 247320de04..aec3a50efc 100644 --- a/test/core/iomgr/alarm_test.c +++ b/test/core/iomgr/alarm_test.c @@ -89,7 +89,7 @@ static void alarm_cb(void *arg /* alarm_arg */, int success) { } /* Test grpc_alarm add and cancel. */ -static void test_grpc_alarm() { +static void test_grpc_alarm(void) { grpc_alarm alarm; grpc_alarm alarm_to_cancel; /* Timeout on the alarm cond. var, so make big enough to absorb time diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c index 325c9f0221..136f34a8b0 100644 --- a/test/core/iomgr/fd_posix_test.c +++ b/test/core/iomgr/fd_posix_test.c @@ -349,7 +349,7 @@ static void client_wait_and_shutdown(client *cl) { /* Test grpc_fd. Start an upload server and client, upload a stream of bytes from the client to the server, and verify that the total number of sent bytes is equal to the total number of received bytes. */ -static void test_grpc_fd() { +static void test_grpc_fd(void) { server sv; client cl; int port; @@ -403,7 +403,7 @@ static void second_read_callback(void *arg /* fd_change_data */, int success) { Note that we have two different but almost identical callbacks above -- the point is to have two different function pointers and two different data pointers and make sure that changing both really works. */ -static void test_grpc_fd_change() { +static void test_grpc_fd_change(void) { grpc_fd *em_fd; fd_change_data a, b; int flags; diff --git a/test/core/iomgr/resolve_address_test.c b/test/core/iomgr/resolve_address_test.c index 99e3119581..26a4bc67e6 100644 --- a/test/core/iomgr/resolve_address_test.c +++ b/test/core/iomgr/resolve_address_test.c @@ -37,7 +37,7 @@ #include <grpc/support/time.h> #include "test/core/util/test_config.h" -static gpr_timespec test_deadline() { +static gpr_timespec test_deadline(void) { return gpr_time_add(gpr_now(), gpr_time_from_micros(100000000)); } @@ -53,35 +53,35 @@ static void must_fail(void* evp, grpc_resolved_addresses* p) { gpr_event_set(evp, (void*)1); } -static void test_localhost() { +static void test_localhost(void) { gpr_event ev; gpr_event_init(&ev); grpc_resolve_address("localhost:1", NULL, must_succeed, &ev); GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -static void test_default_port() { +static void test_default_port(void) { gpr_event ev; gpr_event_init(&ev); grpc_resolve_address("localhost", "1", must_succeed, &ev); GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -static void test_missing_default_port() { +static void test_missing_default_port(void) { gpr_event ev; gpr_event_init(&ev); grpc_resolve_address("localhost", NULL, must_fail, &ev); GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -static void test_ipv6_with_port() { +static void test_ipv6_with_port(void) { gpr_event ev; gpr_event_init(&ev); grpc_resolve_address("[2001:db8::1]:1", NULL, must_succeed, &ev); GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -static void test_ipv6_without_port() { +static void test_ipv6_without_port(void) { const char* const kCases[] = { "2001:db8::1", "2001:db8::1.2.3.4", "[2001:db8::1]", }; @@ -94,7 +94,7 @@ static void test_ipv6_without_port() { } } -static void test_invalid_ip_addresses() { +static void test_invalid_ip_addresses(void) { const char* const kCases[] = { "293.283.1238.3:1", "[2001:db8::11111]:1", }; @@ -107,7 +107,7 @@ static void test_invalid_ip_addresses() { } } -static void test_unparseable_hostports() { +static void test_unparseable_hostports(void) { const char* const kCases[] = { "[", "[::1", "[::1]bad", "[1.2.3.4]", "[localhost]", "[localhost]:1", }; diff --git a/test/core/iomgr/sockaddr_utils_test.c b/test/core/iomgr/sockaddr_utils_test.c index 8cd9fb660f..14018ed66c 100644 --- a/test/core/iomgr/sockaddr_utils_test.c +++ b/test/core/iomgr/sockaddr_utils_test.c @@ -70,7 +70,7 @@ static const gpr_uint8 kIPv4[] = {192, 0, 2, 1}; static const gpr_uint8 kIPv6[] = {0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; -static void test_sockaddr_is_v4mapped() { +static void test_sockaddr_is_v4mapped(void) { struct sockaddr_in input4; struct sockaddr_in6 input6; struct sockaddr_in output4; @@ -101,7 +101,7 @@ static void test_sockaddr_is_v4mapped() { !grpc_sockaddr_is_v4mapped((const struct sockaddr *)&input4, NULL)); } -static void test_sockaddr_to_v4mapped() { +static void test_sockaddr_to_v4mapped(void) { struct sockaddr_in input4; struct sockaddr_in6 input6; struct sockaddr_in6 output6; @@ -129,7 +129,7 @@ static void test_sockaddr_to_v4mapped() { !grpc_sockaddr_to_v4mapped((const struct sockaddr *)&input6, &output6)); } -static void test_sockaddr_is_wildcard() { +static void test_sockaddr_is_wildcard(void) { struct sockaddr_in wild4; struct sockaddr_in6 wild6; struct sockaddr_in6 wild_mapped; @@ -187,7 +187,7 @@ static void expect_sockaddr_str(const char *expected, void *addr, gpr_free(str); } -static void test_sockaddr_to_string() { +static void test_sockaddr_to_string(void) { struct sockaddr_in input4; struct sockaddr_in6 input6; struct sockaddr dummy; diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c index 2d0a89a1f5..79ba777e85 100644 --- a/test/core/iomgr/tcp_client_posix_test.c +++ b/test/core/iomgr/tcp_client_posix_test.c @@ -43,7 +43,7 @@ #include <grpc/support/log.h> #include <grpc/support/time.h> -static gpr_timespec test_deadline() { +static gpr_timespec test_deadline(void) { return gpr_time_add(gpr_now(), gpr_time_from_seconds(10)); } @@ -59,7 +59,7 @@ static void must_fail(void *arg, grpc_endpoint *tcp) { gpr_event_set(arg, (void *)1); } -void test_succeeds() { +void test_succeeds(void) { struct sockaddr_in addr; socklen_t addr_len = sizeof(addr); int svr_fd; @@ -94,7 +94,7 @@ void test_succeeds() { GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -void test_fails() { +void test_fails(void) { struct sockaddr_in addr; socklen_t addr_len = sizeof(addr); gpr_event ev; @@ -112,7 +112,7 @@ void test_fails() { GPR_ASSERT(gpr_event_wait(&ev, test_deadline())); } -void test_times_out() { +void test_times_out(void) { struct sockaddr_in addr; socklen_t addr_len = sizeof(addr); int svr_fd; diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index 6af3ded98b..182ccba3f6 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -444,7 +444,7 @@ static void write_error_test(ssize_t num_bytes, ssize_t slice_size) { free(slices); } -void run_tests() { +void run_tests(void) { int i = 0; read_test(100, 8192); @@ -469,7 +469,7 @@ void run_tests() { } } -static void clean_up() {} +static void clean_up(void) {} static grpc_endpoint_test_fixture create_fixture_tcp_socketpair( size_t slice_size) { diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c index f30ff917cb..e906f302cf 100644 --- a/test/core/iomgr/tcp_server_posix_test.c +++ b/test/core/iomgr/tcp_server_posix_test.c @@ -58,19 +58,19 @@ static void on_connect(void *arg, grpc_endpoint *tcp) { gpr_mu_unlock(&mu); } -static void test_no_op() { +static void test_no_op(void) { grpc_tcp_server *s = grpc_tcp_server_create(); grpc_tcp_server_destroy(s); } -static void test_no_op_with_start() { +static void test_no_op_with_start(void) { grpc_tcp_server *s = grpc_tcp_server_create(); LOG_TEST(); grpc_tcp_server_start(s, NULL, on_connect, NULL); grpc_tcp_server_destroy(s); } -static void test_no_op_with_port() { +static void test_no_op_with_port(void) { struct sockaddr_in addr; grpc_tcp_server *s = grpc_tcp_server_create(); LOG_TEST(); @@ -83,7 +83,7 @@ static void test_no_op_with_port() { grpc_tcp_server_destroy(s); } -static void test_no_op_with_port_and_start() { +static void test_no_op_with_port_and_start(void) { struct sockaddr_in addr; grpc_tcp_server *s = grpc_tcp_server_create(); LOG_TEST(); diff --git a/test/core/iomgr/time_averaged_stats_test.c b/test/core/iomgr/time_averaged_stats_test.c index 7ed2f84f21..bbfeab5633 100644 --- a/test/core/iomgr/time_averaged_stats_test.c +++ b/test/core/iomgr/time_averaged_stats_test.c @@ -41,7 +41,7 @@ #define EXPECT_EQ(a, b) GPR_ASSERT((a) == (b)) #define EXPECT_DOUBLE_EQ(a, b) GPR_ASSERT(fabs((a) - (b)) < 1e-9) -static void no_regress_no_persist_test_1() { +static void no_regress_no_persist_test_1(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0); EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg); @@ -59,7 +59,7 @@ static void no_regress_no_persist_test_1() { EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight); } -static void no_regress_no_persist_test_2() { +static void no_regress_no_persist_test_2(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0); EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg); @@ -75,7 +75,7 @@ static void no_regress_no_persist_test_2() { EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight); } -static void no_regress_no_persist_test_3() { +static void no_regress_no_persist_test_3(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0); EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg); @@ -92,7 +92,7 @@ static void no_regress_no_persist_test_3() { EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight); } -static void some_regress_no_persist_test() { +static void some_regress_no_persist_test(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0.5, 0.0); EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg); @@ -105,7 +105,7 @@ static void some_regress_no_persist_test() { EXPECT_DOUBLE_EQ(2.5, tas.aggregate_total_weight); } -static void some_decay_test() { +static void some_decay_test(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 1, 0.0); EXPECT_EQ(1000, tas.aggregate_weighted_avg); @@ -126,7 +126,7 @@ static void some_decay_test() { EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight); } -static void no_regress_full_persist_test() { +static void no_regress_full_persist_test(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0, 1.0); EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg); @@ -146,7 +146,7 @@ static void no_regress_full_persist_test() { EXPECT_DOUBLE_EQ(3, tas.aggregate_total_weight); } -static void no_regress_some_persist_test() { +static void no_regress_some_persist_test(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0, 0.5); /* Should replace init value */ @@ -162,7 +162,7 @@ static void no_regress_some_persist_test() { EXPECT_DOUBLE_EQ(2.5, tas.aggregate_total_weight); } -static void some_regress_some_persist_test() { +static void some_regress_some_persist_test(void) { grpc_time_averaged_stats tas; grpc_time_averaged_stats_init(&tas, 1000, 0.4, 0.6); /* Sample weight = 0 */ |