From 490bc97dbf76fae2a99c8bacd5fd9be332d68b90 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 2 Feb 2018 10:57:18 -0800 Subject: Add, and document, the url->u_requri member. This member is the value passed in actual HTTP protocol, so it is useful with the function nng_http_req_set_uri(). --- tests/url.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/url.c b/tests/url.c index a4b4457b..c35feee1 100644 --- a/tests/url.c +++ b/tests/url.c @@ -26,7 +26,7 @@ TestMain("URLs", { So(strcmp(url->u_hostname, "www.google.com") == 0); So(strcmp(url->u_port, "80") == 0); So(strcmp(url->u_path, "") == 0); - So(strcmp(url->u_rawpath, "") == 0); + So(strcmp(url->u_requri, "") == 0); So(url->u_query == NULL); So(url->u_fragment == NULL); So(url->u_userinfo == NULL); @@ -41,7 +41,7 @@ TestMain("URLs", { So(strcmp(url->u_hostname, "www.google.com") == 0); So(strcmp(url->u_port, "1234") == 0); So(strcmp(url->u_path, "") == 0); - So(strcmp(url->u_rawpath, "") == 0); + So(strcmp(url->u_requri, "") == 0); So(url->u_query == NULL); So(url->u_fragment == NULL); So(url->u_userinfo == NULL); @@ -57,7 +57,7 @@ TestMain("URLs", { So(strcmp(url->u_hostname, "www.google.com") == 0); So(strcmp(url->u_port, "1234") == 0); So(strcmp(url->u_path, "/somewhere") == 0); - So(strcmp(url->u_rawpath, "/somewhere") == 0); + So(strcmp(url->u_requri, "/somewhere") == 0); So(url->u_userinfo == NULL); So(url->u_query == NULL); So(url->u_fragment == NULL); @@ -73,7 +73,7 @@ TestMain("URLs", { So(strcmp(url->u_hostname, "www.google.com") == 0); So(strcmp(url->u_port, "1234") == 0); So(strcmp(url->u_path, "/somewhere") == 0); - So(strcmp(url->u_rawpath, "/somewhere") == 0); + So(strcmp(url->u_requri, "/somewhere") == 0); So(url->u_query == NULL); So(url->u_fragment == NULL); nng_url_free(url); @@ -88,7 +88,7 @@ TestMain("URLs", { So(strcmp(url->u_port, "80") == 0); So(strcmp(url->u_path, "/somewhere") == 0); So(strcmp(url->u_query, "result=yes") == 0); - So(strcmp(url->u_rawpath, "/somewhere?result=yes") == 0); + So(strcmp(url->u_requri, "/somewhere?result=yes") == 0); So(url->u_userinfo == NULL); So(url->u_fragment == NULL); nng_url_free(url); @@ -105,7 +105,7 @@ TestMain("URLs", { So(strcmp(url->u_path, "/somewhere") == 0); So(strcmp(url->u_query, "result=yes") == 0); So(strcmp(url->u_fragment, "chapter1") == 0); - So(strcmp(url->u_rawpath, "/somewhere?result=yes#chapter1") == + So(strcmp(url->u_requri, "/somewhere?result=yes#chapter1") == 0); So(url->u_userinfo == NULL); nng_url_free(url); @@ -120,7 +120,7 @@ TestMain("URLs", { So(strcmp(url->u_port, "80") == 0); So(strcmp(url->u_path, "/somewhere") == 0); So(strcmp(url->u_fragment, "chapter2") == 0); - So(strcmp(url->u_rawpath, "/somewhere#chapter2") == 0); + So(strcmp(url->u_requri, "/somewhere#chapter2") == 0); So(url->u_query == NULL); So(url->u_userinfo == NULL); nng_url_free(url); @@ -134,7 +134,7 @@ TestMain("URLs", { So(strcmp(url->u_path, "") == 0); So(strcmp(url->u_port, "80") == 0); So(strcmp(url->u_fragment, "chapter3") == 0); - So(strcmp(url->u_rawpath, "#chapter3") == 0); + So(strcmp(url->u_requri, "#chapter3") == 0); So(url->u_query == NULL); So(url->u_userinfo == NULL); nng_url_free(url); @@ -149,7 +149,7 @@ TestMain("URLs", { So(strcmp(url->u_path, "") == 0); So(strcmp(url->u_port, "80") == 0); So(strcmp(url->u_query, "color=red") == 0); - So(strcmp(url->u_rawpath, "?color=red") == 0); + So(strcmp(url->u_requri, "?color=red") == 0); So(url->u_fragment == NULL); So(url->u_userinfo == NULL); nng_url_free(url); -- cgit v1.2.3-70-g09d2