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