Lines Matching refs:teststr
25 coap_str_const_t teststr = { 1, (const uint8_t *)"" };
30 /* result = coap_opt_parse(teststr.s, teststr.s + teststr.length, &option); */
31 result = coap_opt_parse(teststr.s, teststr.length, &option);
41 coap_str_const_t teststr = { 2, (const uint8_t *)"\xc1" };
46 result = coap_opt_parse(teststr.s, teststr.length, &option);
50 CU_ASSERT(option.value == teststr.s + 1);
56 coap_str_const_t teststr = { 13, (const uint8_t *)"\x3c\x00\x01\x02\x03\x04"
63 result = coap_opt_parse(teststr.s, teststr.length, &option);
67 CU_ASSERT(option.value == teststr.s + 1);
68 /* CU_ASSERT(memcmp(option.value, teststr.s + 1, 12) == 0); */
74 coap_str_const_t teststr = { 2, (const uint8_t *)"\xf3" };
79 result = coap_opt_parse(teststr.s, teststr.length, &option);
86 coap_str_const_t teststr = { 2, (const uint8_t *)"\x3f" };
91 result = coap_opt_parse(teststr.s, teststr.length, &option);
98 coap_str_const_t teststr = { 1, (const uint8_t *)"\xff" };
103 result = coap_opt_parse(teststr.s, teststr.length, &option);
110 coap_str_const_t teststr = { 2, (const uint8_t *)"\xd0\x07" };
115 result = coap_opt_parse(teststr.s, teststr.length, &option);
124 coap_str_const_t teststr = { 3, (const uint8_t *)"\xe0\x01\xff" };
129 result = coap_opt_parse(teststr.s, teststr.length, &option);
138 coap_str_const_t teststr = { 3, (const uint8_t *)"\xe0\xfe\xf2" };
143 result = coap_opt_parse(teststr.s, teststr.length, &option);
151 coap_str_const_t teststr = { 3, (const uint8_t *)"\xe0\xff\xff" };
156 result = coap_opt_parse(teststr.s, teststr.length, &option);
163 coap_str_const_t teststr = { 1, (const uint8_t *)"\xd0" };
168 result = coap_opt_parse(teststr.s, teststr.length, &option);
175 coap_str_const_t teststr = { 3, (const uint8_t *)"\xee\xff\x0b" };
180 result = coap_opt_parse(teststr.s, teststr.length, &option);
188 coap_string_t teststr = { sizeof(_data), _data };
189 teststr.s[0] = 0xee;
190 teststr.s[1] = 0x00;
191 teststr.s[2] = 0x0b;
192 teststr.s[3] = 0x00;
193 teststr.s[4] = 0xe7;
198 result = coap_opt_parse(teststr.s, teststr.length, &option);
239 char teststr[] = { 0x00 };
244 CU_ASSERT(result == sizeof(teststr));
246 CU_ASSERT(memcmp(buf, teststr, result) == 0);
251 uint8_t teststr[] = { 0x5d, 0xff };
256 CU_ASSERT(result == sizeof(teststr));
258 CU_ASSERT(memcmp(buf, teststr, result) == 0);
263 uint8_t teststr[] = { 0xd1, 0x01 };
268 CU_ASSERT(result == sizeof(teststr));
270 CU_ASSERT(memcmp(buf, teststr, result) == 0);
275 uint8_t teststr[] = { 0xdd, 0xff, 0xab };
280 CU_ASSERT(result == sizeof(teststr));
282 CU_ASSERT(memcmp(buf, teststr, result) == 0);
287 uint8_t teststr[] = { 0xed, 0x13, 0x00, 0xff };
292 CU_ASSERT(result == sizeof(teststr));
294 CU_ASSERT(memcmp(buf, teststr, result) == 0);
299 uint8_t teststr[] = { 0xee, 0xfe, 0xf2, 0xfe, 0xf2 };
304 CU_ASSERT(result == sizeof(teststr));
306 CU_ASSERT(memcmp(buf, teststr, result) == 0);
311 uint8_t teststr[] = { 0x35, 'v', 'a', 'l', 'u', 'e' };
317 (unsigned char *)teststr + valoff,
318 sizeof(teststr) - valoff);
320 CU_ASSERT(result == sizeof(teststr));
322 CU_ASSERT(memcmp(buf, teststr, sizeof(teststr)) == 0);
344 uint8_t teststr[] = { 0xe1, 0x00, 0x00 };
349 CU_ASSERT(result == sizeof(teststr));
351 CU_ASSERT(memcmp(buf, teststr, result) == 0);
360 const uint8_t teststr[] = { 0x12, 'a', 'b' };
363 CU_ASSERT(sizeof(teststr) == coap_opt_parse((const coap_opt_t *)teststr,
364 sizeof(teststr), &opt));
366 CU_ASSERT(coap_opt_length((const coap_opt_t *)teststr) == 2);
367 CU_ASSERT_PTR_EQUAL_C(coap_opt_value((const coap_opt_t *)teststr), teststr + 1);
368 CU_ASSERT(coap_opt_size((const coap_opt_t *)teststr) == sizeof(teststr));
373 const uint8_t teststr[] = { 0xe2, 0x18, 0xfd, 'a', 'b' };
376 CU_ASSERT(sizeof(teststr) == coap_opt_parse((const coap_opt_t *)teststr,
377 sizeof(teststr), &opt));
379 CU_ASSERT(coap_opt_length((const coap_opt_t *)teststr) == 2);
380 CU_ASSERT_PTR_EQUAL_C(coap_opt_value((const coap_opt_t *)teststr), teststr + 3);
381 CU_ASSERT(coap_opt_size((const coap_opt_t *)teststr) == sizeof(teststr));
386 const uint8_t teststr[] = { 0xed, 0x18, 0x0a, 0x00, 'a', 'b', 'c', 'd',
392 CU_ASSERT(sizeof(teststr) == coap_opt_parse((const coap_opt_t *)teststr,
393 sizeof(teststr), &opt));
395 CU_ASSERT(coap_opt_length((const coap_opt_t *)teststr) == 13);
396 CU_ASSERT_PTR_EQUAL_C(coap_opt_value((const coap_opt_t *)teststr), teststr + 4);
397 CU_ASSERT(coap_opt_size((const coap_opt_t *)teststr) == sizeof(teststr));
402 const uint8_t teststr[] = { 0xde, 0xff, 0xfe, 0xf2, 'a', 'b', 'c' };
405 CU_ASSERT(0 == coap_opt_parse((const coap_opt_t *)teststr,
406 sizeof(teststr), &opt));
408 CU_ASSERT(coap_opt_length((const coap_opt_t *)teststr) == 65535);
409 CU_ASSERT_PTR_EQUAL_C(coap_opt_value((const coap_opt_t *)teststr), teststr + 4);
410 CU_ASSERT(coap_opt_size((const coap_opt_t *)teststr) == 65535 + 4);
415 const uint8_t teststr[] = { 0xee, 0xfe, 0xf2, 0x00, 0xdd, 'a', 'b', 'c' };
418 CU_ASSERT(0 == coap_opt_parse((const coap_opt_t *)teststr,
419 sizeof(teststr), &opt));
421 CU_ASSERT(coap_opt_length((const coap_opt_t *)teststr) == 490);
422 CU_ASSERT_PTR_EQUAL_C(coap_opt_value((const coap_opt_t *)teststr), teststr + 5);
423 CU_ASSERT(coap_opt_size((const coap_opt_t *)teststr) == 495);
429 const uint8_t teststr[] = { 0xf2, 'a', 'b' };
434 CU_ASSERT(0 == coap_opt_parse((const coap_opt_t *)teststr,
435 sizeof(teststr), &opt));
437 CU_ASSERT(coap_opt_length((const coap_opt_t *)teststr) == 0);
438 CU_ASSERT_PTR_EQUAL_C(coap_opt_value((const coap_opt_t *)teststr), NULL);
439 CU_ASSERT(coap_opt_size((const coap_opt_t *)teststr) == 0);
444 const uint8_t teststr[] = { 0x2f, 'a', 'b' };
447 CU_ASSERT(0 == coap_opt_parse((const coap_opt_t *)teststr,
448 sizeof(teststr), &opt));
450 CU_ASSERT(coap_opt_length((const coap_opt_t *)teststr) == 0);
451 CU_ASSERT_PTR_EQUAL_C(coap_opt_value((const coap_opt_t *)teststr), NULL);
452 CU_ASSERT(coap_opt_size((const coap_opt_t *)teststr) == 0);
470 uint8_t teststr[] ALIGNED(8) = {
476 .token = teststr,
495 uint8_t teststr[3] ALIGNED(8) = {
502 .token = teststr,
503 .used_size = sizeof(teststr)
521 uint8_t teststr[] ALIGNED(8) = {
529 .token = teststr,
530 .used_size = sizeof(teststr)
543 CU_ASSERT_PTR_EQUAL(option, teststr + 3);
548 CU_ASSERT_PTR_EQUAL(option, teststr + 7);
553 CU_ASSERT_PTR_EQUAL(option, teststr + 8);
563 uint8_t teststr[] ALIGNED(8) = {
572 .token = teststr,
573 .used_size = sizeof(teststr)
586 CU_ASSERT_PTR_EQUAL(option, teststr + 3);
591 CU_ASSERT_PTR_EQUAL(option, teststr + 7);
596 CU_ASSERT_PTR_EQUAL(option, teststr + 8);
606 uint8_t teststr[] ALIGNED(8) = {
614 .token = teststr,
615 .used_size = sizeof(teststr)
628 CU_ASSERT_PTR_EQUAL(option, teststr);
639 uint8_t teststr[] ALIGNED(8) = {
647 .token = teststr,
648 .used_size = sizeof(teststr)
664 CU_ASSERT_PTR_EQUAL(option, teststr + 1);
669 CU_ASSERT_PTR_EQUAL(option, teststr + 2);
674 CU_ASSERT_PTR_EQUAL(option, teststr + 3);
684 uint8_t teststr[] ALIGNED(8) = {
692 .token = teststr,
693 .used_size = sizeof(teststr)
711 CU_ASSERT_PTR_EQUAL(option, teststr);
716 CU_ASSERT_PTR_EQUAL(option, teststr + 4);
721 CU_ASSERT_PTR_EQUAL(option, teststr + 5);
731 uint8_t teststr[] ALIGNED(8) = {
739 .token = teststr,
740 .used_size = sizeof(teststr)
762 uint8_t teststr[] ALIGNED(8) = {
770 .token = teststr,
771 .used_size = sizeof(teststr)
793 uint8_t teststr[] ALIGNED(8) = {
801 .token = teststr,
802 .used_size = sizeof(teststr)
818 CU_ASSERT_PTR_EQUAL(option, teststr + 4);