Lines Matching refs:uri
21 coap_uri_t uri; in t_parse_uri1() local
23 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri1()
25 CU_ASSERT(uri.host.length == 3); in t_parse_uri1()
26 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "::1", 3); in t_parse_uri1()
28 CU_ASSERT(uri.port == COAP_DEFAULT_PORT); in t_parse_uri1()
30 CU_ASSERT(uri.path.length == 16); in t_parse_uri1()
31 CU_ASSERT_NSTRING_EQUAL(uri.path.s, ".well-known/core", 16); in t_parse_uri1()
33 CU_ASSERT(uri.query.length == 0); in t_parse_uri1()
34 CU_ASSERT(uri.query.s == NULL); in t_parse_uri1()
44 coap_uri_t uri; in t_parse_uri2() local
46 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri2()
48 CU_ASSERT(uri.host.length == 3); in t_parse_uri2()
49 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "::1", 3); in t_parse_uri2()
51 CU_ASSERT(uri.port == 8000); in t_parse_uri2()
53 CU_ASSERT(uri.path.length == 16); in t_parse_uri2()
54 CU_ASSERT_NSTRING_EQUAL(uri.path.s, ".well-known/core", 16); in t_parse_uri2()
56 CU_ASSERT(uri.query.length == 0); in t_parse_uri2()
57 CU_ASSERT(uri.query.s == NULL); in t_parse_uri2()
67 coap_uri_t uri; in t_parse_uri3() local
69 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri3()
71 CU_ASSERT(uri.host.length == 9); in t_parse_uri3()
72 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "localhost", 9); in t_parse_uri3()
74 CU_ASSERT(uri.port == COAP_DEFAULT_PORT); in t_parse_uri3()
76 CU_ASSERT(uri.path.length == 0); in t_parse_uri3()
78 CU_ASSERT(uri.query.length == 13); in t_parse_uri3()
79 CU_ASSERT_NSTRING_EQUAL(uri.query.s, "foo&bla=fasel", 13); in t_parse_uri3()
89 coap_uri_t uri; in t_parse_uri4() local
91 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri4()
99 coap_uri_t uri; in t_parse_uri5() local
101 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri5()
103 CU_ASSERT(uri.host.length == 3); in t_parse_uri5()
104 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "foo", 3); in t_parse_uri5()
106 CU_ASSERT(uri.path.length == 0); in t_parse_uri5()
107 CU_ASSERT(uri.path.s == NULL); in t_parse_uri5()
109 CU_ASSERT(uri.query.length == 0); in t_parse_uri5()
110 CU_ASSERT(uri.query.s == NULL); in t_parse_uri5()
122 coap_uri_t uri; in t_parse_uri6() local
124 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri6()
126 CU_ASSERT(uri.host.length == 13); in t_parse_uri6()
127 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "134.102.218.2", 13); in t_parse_uri6()
129 CU_ASSERT(uri.port == COAP_DEFAULT_PORT); in t_parse_uri6()
131 CU_ASSERT(uri.path.length == 16); in t_parse_uri6()
132 CU_ASSERT_NSTRING_EQUAL(uri.path.s, ".well-known/core", 16); in t_parse_uri6()
134 CU_ASSERT(uri.query.length == 0); in t_parse_uri6()
135 CU_ASSERT(uri.query.s == NULL); in t_parse_uri6()
145 coap_uri_t uri; in t_parse_uri7() local
159 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri7()
161 CU_ASSERT(uri.host.length == 7); in t_parse_uri7()
162 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "foo.bar", 7); in t_parse_uri7()
164 CU_ASSERT(uri.port == 5683); in t_parse_uri7()
166 CU_ASSERT(uri.path.length == 36); in t_parse_uri7()
167 CU_ASSERT_NSTRING_EQUAL(uri.path.s, "some_resource/with/multiple/segments", 36); in t_parse_uri7()
169 CU_ASSERT(uri.query.length == 0); in t_parse_uri7()
170 CU_ASSERT(uri.query.s == NULL); in t_parse_uri7()
173 result = coap_split_path(uri.path.s, uri.path.length, buf, &buflen); in t_parse_uri7()
186 coap_uri_t uri; in t_parse_uri8() local
188 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri8()
200 coap_uri_t uri; in t_parse_uri9() local
202 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri9()
214 coap_uri_t uri; in t_parse_uri10() local
216 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri10()
218 CU_ASSERT(uri.host.length == 0); in t_parse_uri10()
219 CU_ASSERT(uri.host.s == NULL); in t_parse_uri10()
221 CU_ASSERT(uri.port == COAP_DEFAULT_PORT); in t_parse_uri10()
223 CU_ASSERT(uri.path.length == 13); in t_parse_uri10()
224 CU_ASSERT_NSTRING_EQUAL(uri.path.s, "absolute/path", 13); in t_parse_uri10()
226 CU_ASSERT(uri.query.length == 0); in t_parse_uri10()
227 CU_ASSERT(uri.query.s == NULL); in t_parse_uri10()
238 coap_uri_t uri; in t_parse_uri11() local
251 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri11()
253 CU_ASSERT(uri.host.length == 17); in t_parse_uri11()
254 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "xn--18j4d.example", 17); in t_parse_uri11()
256 CU_ASSERT(uri.port == COAP_DEFAULT_PORT); in t_parse_uri11()
258 CU_ASSERT(uri.path.length == 45); in t_parse_uri11()
259 CU_ASSERT_NSTRING_EQUAL(uri.path.s, in t_parse_uri11()
262 CU_ASSERT(uri.query.length == 0); in t_parse_uri11()
263 CU_ASSERT(uri.query.s == NULL); in t_parse_uri11()
266 result = coap_split_path(uri.path.s, uri.path.length, buf, &buflen); in t_parse_uri11()
279 coap_uri_t uri; in t_parse_uri12() local
289 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri12()
291 CU_ASSERT(uri.host.length == 12); in t_parse_uri12()
292 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "198.51.100.1", 12); in t_parse_uri12()
294 CU_ASSERT(uri.port == 61616); in t_parse_uri12()
296 CU_ASSERT(uri.path.length == 6); in t_parse_uri12()
297 CU_ASSERT_NSTRING_EQUAL(uri.path.s, "/%2F//", 6); in t_parse_uri12()
299 CU_ASSERT(uri.query.length == 11); in t_parse_uri12()
300 CU_ASSERT_NSTRING_EQUAL(uri.query.s, "%2F%2F&?%26", 11); in t_parse_uri12()
303 result = coap_split_path(uri.path.s, uri.path.length, buf, &buflen); in t_parse_uri12()
310 result = coap_split_query(uri.query.s, uri.query.length, buf, &buflen); in t_parse_uri12()