aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/client_channel/parse_address_test.c
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2017-04-25 12:15:53 -0700
committerGravatar murgatroid99 <mlumish@google.com>2017-04-25 12:15:53 -0700
commit3049462b75ac557348243601896ed68ca8145522 (patch)
tree213389dd32b961b25f3833738201e857ce7ae2e3 /test/core/client_channel/parse_address_test.c
parent627e2a5abd2e4146c85625e98083a95846ad57e8 (diff)
parent79759fea1abd09102d38af3e13a84b69e898124b (diff)
Merge remote-tracking branch 'upstream/v1.3.x' into node_only_uv
Diffstat (limited to 'test/core/client_channel/parse_address_test.c')
-rw-r--r--test/core/client_channel/parse_address_test.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/core/client_channel/parse_address_test.c b/test/core/client_channel/parse_address_test.c
index 629cdb001f..802e41e5de 100644
--- a/test/core/client_channel/parse_address_test.c
+++ b/test/core/client_channel/parse_address_test.c
@@ -47,12 +47,12 @@
#ifdef GRPC_HAVE_UNIX_SOCKET
-static void test_parse_unix(const char *uri_text, const char *pathname) {
+static void test_grpc_parse_unix(const char *uri_text, const char *pathname) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
grpc_resolved_address addr;
- GPR_ASSERT(1 == parse_unix(uri, &addr));
+ GPR_ASSERT(1 == grpc_parse_unix(uri, &addr));
struct sockaddr_un *addr_un = (struct sockaddr_un *)addr.addr;
GPR_ASSERT(AF_UNIX == addr_un->sun_family);
GPR_ASSERT(0 == strcmp(addr_un->sun_path, pathname));
@@ -63,18 +63,18 @@ static void test_parse_unix(const char *uri_text, const char *pathname) {
#else /* GRPC_HAVE_UNIX_SOCKET */
-static void test_parse_unix(const char *uri_text, const char *pathname) {}
+static void test_grpc_parse_unix(const char *uri_text, const char *pathname) {}
#endif /* GRPC_HAVE_UNIX_SOCKET */
-static void test_parse_ipv4(const char *uri_text, const char *host,
- unsigned short port) {
+static void test_grpc_parse_ipv4(const char *uri_text, const char *host,
+ unsigned short port) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
grpc_resolved_address addr;
char ntop_buf[INET_ADDRSTRLEN];
- GPR_ASSERT(1 == parse_ipv4(uri, &addr));
+ GPR_ASSERT(1 == grpc_parse_ipv4(uri, &addr));
struct sockaddr_in *addr_in = (struct sockaddr_in *)addr.addr;
GPR_ASSERT(AF_INET == addr_in->sin_family);
GPR_ASSERT(NULL != grpc_inet_ntop(AF_INET, &addr_in->sin_addr, ntop_buf,
@@ -86,14 +86,14 @@ static void test_parse_ipv4(const char *uri_text, const char *host,
grpc_exec_ctx_finish(&exec_ctx);
}
-static void test_parse_ipv6(const char *uri_text, const char *host,
- unsigned short port, uint32_t scope_id) {
+static void test_grpc_parse_ipv6(const char *uri_text, const char *host,
+ unsigned short port, uint32_t scope_id) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
grpc_resolved_address addr;
char ntop_buf[INET6_ADDRSTRLEN];
- GPR_ASSERT(1 == parse_ipv6(uri, &addr));
+ GPR_ASSERT(1 == grpc_parse_ipv6(uri, &addr));
struct sockaddr_in6 *addr_in6 = (struct sockaddr_in6 *)addr.addr;
GPR_ASSERT(AF_INET6 == addr_in6->sin6_family);
GPR_ASSERT(NULL != grpc_inet_ntop(AF_INET6, &addr_in6->sin6_addr, ntop_buf,
@@ -109,8 +109,8 @@ static void test_parse_ipv6(const char *uri_text, const char *host,
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
- test_parse_unix("unix:/path/name", "/path/name");
- test_parse_ipv4("ipv4:192.0.2.1:12345", "192.0.2.1", 12345);
- test_parse_ipv6("ipv6:[2001:db8::1]:12345", "2001:db8::1", 12345, 0);
- test_parse_ipv6("ipv6:[2001:db8::1%252]:12345", "2001:db8::1", 12345, 2);
+ test_grpc_parse_unix("unix:/path/name", "/path/name");
+ test_grpc_parse_ipv4("ipv4:192.0.2.1:12345", "192.0.2.1", 12345);
+ test_grpc_parse_ipv6("ipv6:[2001:db8::1]:12345", "2001:db8::1", 12345, 0);
+ test_grpc_parse_ipv6("ipv6:[2001:db8::1%252]:12345", "2001:db8::1", 12345, 2);
}