Lines Matching refs:uri

21   coap_uri_t uri;
23 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
25 CU_ASSERT(uri.host.length == 3);
26 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "::1", 3);
28 CU_ASSERT(uri.port == COAP_DEFAULT_PORT);
30 CU_ASSERT(uri.path.length == 16);
31 CU_ASSERT_NSTRING_EQUAL(uri.path.s, ".well-known/core", 16);
33 CU_ASSERT(uri.query.length == 0);
34 CU_ASSERT(uri.query.s == NULL);
36 CU_FAIL("uri parser error");
44 coap_uri_t uri;
46 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
48 CU_ASSERT(uri.host.length == 3);
49 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "::1", 3);
51 CU_ASSERT(uri.port == 8000);
53 CU_ASSERT(uri.path.length == 16);
54 CU_ASSERT_NSTRING_EQUAL(uri.path.s, ".well-known/core", 16);
56 CU_ASSERT(uri.query.length == 0);
57 CU_ASSERT(uri.query.s == NULL);
59 CU_FAIL("uri parser error");
67 coap_uri_t uri;
69 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
71 CU_ASSERT(uri.host.length == 9);
72 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "localhost", 9);
74 CU_ASSERT(uri.port == COAP_DEFAULT_PORT);
76 CU_ASSERT(uri.path.length == 0);
78 CU_ASSERT(uri.query.length == 13);
79 CU_ASSERT_NSTRING_EQUAL(uri.query.s, "foo&bla=fasel", 13);
81 CU_FAIL("uri parser error");
89 coap_uri_t uri;
91 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
99 coap_uri_t uri;
101 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
103 CU_ASSERT(uri.host.length == 3);
104 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "foo", 3);
106 CU_ASSERT(uri.path.length == 0);
107 CU_ASSERT(uri.path.s == NULL);
109 CU_ASSERT(uri.query.length == 0);
110 CU_ASSERT(uri.query.s == NULL);
122 coap_uri_t uri;
124 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
126 CU_ASSERT(uri.host.length == 13);
127 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "134.102.218.2", 13);
129 CU_ASSERT(uri.port == COAP_DEFAULT_PORT);
131 CU_ASSERT(uri.path.length == 16);
132 CU_ASSERT_NSTRING_EQUAL(uri.path.s, ".well-known/core", 16);
134 CU_ASSERT(uri.query.length == 0);
135 CU_ASSERT(uri.query.s == NULL);
137 CU_FAIL("uri parser error");
145 coap_uri_t uri;
159 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
161 CU_ASSERT(uri.host.length == 7);
162 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "foo.bar", 7);
164 CU_ASSERT(uri.port == 5683);
166 CU_ASSERT(uri.path.length == 36);
167 CU_ASSERT_NSTRING_EQUAL(uri.path.s, "some_resource/with/multiple/segments", 36);
169 CU_ASSERT(uri.query.length == 0);
170 CU_ASSERT(uri.query.s == NULL);
173 result = coap_split_path(uri.path.s, uri.path.length, buf, &buflen);
178 CU_FAIL("uri parser error");
187 coap_uri_t uri;
190 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
204 coap_uri_t uri;
207 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
220 coap_uri_t uri;
222 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
224 CU_ASSERT(uri.host.length == 0);
225 CU_ASSERT(uri.host.s == NULL);
227 CU_ASSERT(uri.port == COAP_DEFAULT_PORT);
229 CU_ASSERT(uri.path.length == 13);
230 CU_ASSERT_NSTRING_EQUAL(uri.path.s, "absolute/path", 13);
232 CU_ASSERT(uri.query.length == 0);
233 CU_ASSERT(uri.query.s == NULL);
235 CU_FAIL("uri parser error");
244 coap_uri_t uri;
257 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
259 CU_ASSERT(uri.host.length == 17);
260 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "xn--18j4d.example", 17);
262 CU_ASSERT(uri.port == COAP_DEFAULT_PORT);
264 CU_ASSERT(uri.path.length == 45);
265 CU_ASSERT_NSTRING_EQUAL(uri.path.s,
268 CU_ASSERT(uri.query.length == 0);
269 CU_ASSERT(uri.query.s == NULL);
272 result = coap_split_path(uri.path.s, uri.path.length, buf, &buflen);
277 CU_FAIL("uri parser error");
285 coap_uri_t uri;
295 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri);
297 CU_ASSERT(uri.host.length == 12);
298 CU_ASSERT_NSTRING_EQUAL(uri.host.s, "198.51.100.1", 12);
300 CU_ASSERT(uri.port == 61616);
302 CU_ASSERT(uri.path.length == 6);
303 CU_ASSERT_NSTRING_EQUAL(uri.path.s, "/%2F//", 6);
305 CU_ASSERT(uri.query.length == 11);
306 CU_ASSERT_NSTRING_EQUAL(uri.query.s, "%2F%2F&?%26", 11);
309 result = coap_split_path(uri.path.s, uri.path.length, buf, &buflen);
316 result = coap_split_query(uri.query.s, uri.query.length, buf, &buflen);
321 CU_FAIL("uri parser error");
374 CU_FAIL("uri parser error");
434 CU_FAIL("uri parser error");
588 suite = CU_add_suite("uri parser", NULL, NULL);
590 fprintf(stderr, "W: cannot add uri parser test suite (%s)\n",
598 fprintf(stderr, "W: cannot add uri parser test (%s)\n", \