aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Hongwei Wang <hongweiw@google.com>2015-07-17 16:17:48 -0700
committerGravatar Hongwei Wang <hongweiw@google.com>2015-07-17 16:17:48 -0700
commitf0e9fecbe013b24b342bbef2e05350c996b81ab1 (patch)
tree12c65e093f7035432fcf952d3cc390301ede9060 /test
parenta3780a81026b05b1121f764ab71955eec0092273 (diff)
Update uri_parser
Diffstat (limited to 'test')
-rw-r--r--test/core/client_config/uri_parser_test.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/test/core/client_config/uri_parser_test.c b/test/core/client_config/uri_parser_test.c
index 4bd83a3494..776e27ae7e 100644
--- a/test/core/client_config/uri_parser_test.c
+++ b/test/core/client_config/uri_parser_test.c
@@ -44,30 +44,27 @@ static void test_succeeds(const char *uri_text, const char *scheme,
grpc_uri *uri = grpc_uri_parse(uri_text, 0);
GPR_ASSERT(uri);
GPR_ASSERT(0 == strcmp(scheme, uri->scheme));
- gpr_log(GPR_INFO, uri->scheme);
- gpr_log(GPR_INFO, uri->authority);
- gpr_log(GPR_INFO, uri->path);
GPR_ASSERT(0 == strcmp(authority, uri->authority));
GPR_ASSERT(0 == strcmp(path, uri->path));
grpc_uri_destroy(uri);
}
-/*static void test_fails(const char *uri_text) {
+static void test_fails(const char *uri_text) {
GPR_ASSERT(NULL == grpc_uri_parse(uri_text, 0));
-}*/
+}
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
- /*test_succeeds("http://www.google.com", "http", "www.google.com", "");
- test_succeeds("dns:///foo", "dns", "", "/foo");*/
- test_succeeds("zookeeper://127.0.0.1:2181/foo/1", "zookeeper", "127.0.0.1:2181", "/foo/1");
- /*test_succeeds("http://www.google.com:90", "http", "www.google.com:90", "");
+ test_succeeds("http://www.google.com", "http", "www.google.com", "");
+ test_succeeds("dns:///foo", "dns", "", "/foo");
+ test_succeeds("zookeeper://127.0.0.1:2181/foo/bar", "zookeeper", "127.0.0.1:2181", "/foo/bar");
+ test_succeeds("http://www.google.com:90", "http", "www.google.com:90", "");
test_succeeds("a192.4-df:foo.coom", "a192.4-df", "", "foo.coom");
test_succeeds("a+b:foo.coom", "a+b", "", "foo.coom");
test_fails("xyz");
test_fails("http://www.google.com?why-are-you-using-queries");
test_fails("dns:foo.com#fragments-arent-supported-here");
test_fails("http:?huh");
- test_fails("unix:#yeah-right");*/
+ test_fails("unix:#yeah-right");
return 0;
}