Lines Matching refs:option
28 coap_option_t option;
30 /* result = coap_opt_parse(teststr.s, teststr.s + teststr.length, &option); */
31 result = coap_opt_parse(teststr.s, teststr.length, &option);
33 CU_ASSERT(option.delta == 0);
34 CU_ASSERT(option.length == 0);
44 coap_option_t option;
46 result = coap_opt_parse(teststr.s, teststr.length, &option);
48 CU_ASSERT(option.delta == 12);
49 CU_ASSERT(option.length == 1);
50 CU_ASSERT(option.value == teststr.s + 1);
61 coap_option_t option;
63 result = coap_opt_parse(teststr.s, teststr.length, &option);
65 CU_ASSERT(option.delta == 3);
66 CU_ASSERT(option.length == 12);
67 CU_ASSERT(option.value == teststr.s + 1);
68 /* CU_ASSERT(memcmp(option.value, teststr.s + 1, 12) == 0); */
77 coap_option_t option;
79 result = coap_opt_parse(teststr.s, teststr.length, &option);
89 coap_option_t option;
91 result = coap_opt_parse(teststr.s, teststr.length, &option);
101 coap_option_t option;
103 result = coap_opt_parse(teststr.s, teststr.length, &option);
113 coap_option_t option;
115 result = coap_opt_parse(teststr.s, teststr.length, &option);
117 CU_ASSERT(option.delta == 20);
118 CU_ASSERT(option.length == 0);
127 coap_option_t option;
129 result = coap_opt_parse(teststr.s, teststr.length, &option);
131 CU_ASSERT(option.delta == 780);
132 CU_ASSERT(option.length == 0);
141 coap_option_t option;
143 result = coap_opt_parse(teststr.s, teststr.length, &option);
145 CU_ASSERT(option.delta == 65535);
154 coap_option_t option;
156 result = coap_opt_parse(teststr.s, teststr.length, &option);
162 /* illegal delta value (option too short) */
166 coap_option_t option;
168 result = coap_opt_parse(teststr.s, teststr.length, &option);
178 coap_option_t option;
180 result = coap_opt_parse(teststr.s, teststr.length, &option);
196 coap_option_t option;
198 result = coap_opt_parse(teststr.s, teststr.length, &option);
200 CU_ASSERT(option.delta == 280);
201 CU_ASSERT(option.length == 500);
202 CU_ASSERT(option.value == &_data[5]);
223 coap_option_t option;
225 result = coap_opt_parse(data, length, &option);
227 CU_ASSERT(option.delta == 268);
228 CU_ASSERT(option.length == 65535);
229 CU_ASSERT(option.value == &data[4]);
480 coap_opt_t *option;
487 option = coap_option_next(&oi);
489 CU_ASSERT(option == NULL);
506 coap_opt_t *option;
513 option = coap_option_next(&oi);
515 CU_ASSERT(option == NULL);
533 coap_opt_t *option;
540 option = coap_option_next(&oi);
543 CU_ASSERT_PTR_EQUAL(option, teststr + 3);
545 option = coap_option_next(&oi);
548 CU_ASSERT_PTR_EQUAL(option, teststr + 7);
550 option = coap_option_next(&oi);
553 CU_ASSERT_PTR_EQUAL(option, teststr + 8);
555 option = coap_option_next(&oi);
557 CU_ASSERT_PTR_EQUAL(option, NULL);
576 coap_opt_t *option;
583 option = coap_option_next(&oi);
586 CU_ASSERT_PTR_EQUAL(option, teststr + 3);
588 option = coap_option_next(&oi);
591 CU_ASSERT_PTR_EQUAL(option, teststr + 7);
593 option = coap_option_next(&oi);
596 CU_ASSERT_PTR_EQUAL(option, teststr + 8);
598 option = coap_option_next(&oi);
600 CU_ASSERT_PTR_EQUAL(option, NULL);
605 /* CoAP PDU with malformed option */
618 coap_opt_t *option;
625 option = coap_option_next(&oi);
628 CU_ASSERT_PTR_EQUAL(option, teststr);
630 option = coap_option_next(&oi);
632 CU_ASSERT_PTR_EQUAL(option, NULL);
637 /* option filter */
651 coap_opt_t *option;
655 coap_option_filter_set(&filter, 10); /* option nr 10 only */
661 option = coap_option_next(&oi);
664 CU_ASSERT_PTR_EQUAL(option, teststr + 1);
666 option = coap_option_next(&oi);
669 CU_ASSERT_PTR_EQUAL(option, teststr + 2);
671 option = coap_option_next(&oi);
674 CU_ASSERT_PTR_EQUAL(option, teststr + 3);
676 option = coap_option_next(&oi);
678 CU_ASSERT_PTR_EQUAL(option, NULL);
683 /* option filter */
696 coap_opt_t *option;
708 option = coap_option_next(&oi);
711 CU_ASSERT_PTR_EQUAL(option, teststr);
713 option = coap_option_next(&oi);
716 CU_ASSERT_PTR_EQUAL(option, teststr + 4);
718 option = coap_option_next(&oi);
721 CU_ASSERT_PTR_EQUAL(option, teststr + 5);
723 option = coap_option_next(&oi);
725 CU_ASSERT_PTR_EQUAL(option, NULL);
730 /* option filter */
743 coap_opt_t *option;
746 /* search option nr 36 */
754 option = coap_option_next(&oi);
756 CU_ASSERT_PTR_EQUAL(option, NULL);
761 /* options filter: option number too large for filter */
774 coap_opt_t *option;
777 /* search option nr 100 */
785 option = coap_option_next(&oi);
787 CU_ASSERT_PTR_EQUAL(option, NULL);
792 /* options filter: option numbers in PDU exceed filter size */
805 coap_opt_t *option;
808 /* search option nr 61 */
816 option = coap_option_next(&oi);
818 CU_ASSERT_PTR_EQUAL(option, teststr + 4);
820 option = coap_option_next(&oi);
822 CU_ASSERT_PTR_EQUAL(option, NULL);
871 /* adding a short option type must fail */
874 /* adding a long option type must succeed */
938 suite[0] = CU_add_suite("option parser", NULL, NULL);
940 fprintf(stderr, "W: cannot add option parser test suite (%s)\n",
948 fprintf(stderr, "W: cannot add option parser test (%s)\n", \
952 OPTION_TEST(1, "parse option #1");
953 OPTION_TEST(2, "parse option #2");
954 OPTION_TEST(3, "parse option #3");
955 OPTION_TEST(4, "parse option #4");
956 OPTION_TEST(5, "parse option #5");
957 OPTION_TEST(6, "parse option #6");
958 OPTION_TEST(7, "parse option #7");
959 OPTION_TEST(8, "parse option #8");
960 OPTION_TEST(9, "parse option #9");
961 OPTION_TEST(10, "parse option #10");
962 OPTION_TEST(11, "parse option #11");
963 OPTION_TEST(12, "parse option #12");
964 OPTION_TEST(13, "parse option #13");
965 OPTION_TEST(14, "parse option #14");
967 if ((suite[1] = CU_add_suite("option encoder", NULL, NULL))) {
970 fprintf(stderr, "W: cannot add option encoder test (%s)\n", \
974 OPTION_ENCODER_TEST(1, "encode option #1");
975 OPTION_ENCODER_TEST(2, "encode option #2");
976 OPTION_ENCODER_TEST(3, "encode option #3");
977 OPTION_ENCODER_TEST(4, "encode option #4");
978 OPTION_ENCODER_TEST(5, "encode option #5");
979 OPTION_ENCODER_TEST(6, "encode option #6");
980 OPTION_ENCODER_TEST(7, "encode option #7");
981 OPTION_ENCODER_TEST(8, "encode option #8");
982 OPTION_ENCODER_TEST(9, "encode option #9");
985 fprintf(stderr, "W: cannot add option encoder test suite (%s)\n",
989 if ((suite[2] = CU_add_suite("option accessors", NULL, NULL))) {
992 fprintf(stderr, "W: cannot add option accessor function test (%s)\n", \
996 OPTION_ACCESSOR_TEST(1, "access option #1");
997 OPTION_ACCESSOR_TEST(2, "access option #2");
998 OPTION_ACCESSOR_TEST(3, "access option #3");
999 OPTION_ACCESSOR_TEST(4, "access option #4");
1000 OPTION_ACCESSOR_TEST(5, "access option #5");
1001 OPTION_ACCESSOR_TEST(6, "access option #6");
1002 OPTION_ACCESSOR_TEST(7, "access option #7");
1005 fprintf(stderr, "W: cannot add option acessor function test suite (%s)\n",
1009 if ((suite[3] = CU_add_suite("option iterator", NULL, NULL))) {
1012 fprintf(stderr, "W: cannot add option iterator test (%s)\n", \
1016 OPTION_ITERATOR_TEST(1, "option iterator #1");
1017 OPTION_ITERATOR_TEST(2, "option iterator #2");
1018 OPTION_ITERATOR_TEST(3, "option iterator #3");
1019 OPTION_ITERATOR_TEST(4, "option iterator #4");
1020 OPTION_ITERATOR_TEST(5, "option iterator #5");
1021 OPTION_ITERATOR_TEST(6, "option iterator #6");
1022 OPTION_ITERATOR_TEST(7, "option iterator #7");
1023 OPTION_ITERATOR_TEST(8, "option iterator #8");
1024 OPTION_ITERATOR_TEST(9, "option iterator #9");
1025 OPTION_ITERATOR_TEST(10, "option iterator #10");
1028 fprintf(stderr, "W: cannot add option iterator test suite (%s)\n",
1032 if ((suite[4] = CU_add_suite("option filter", NULL, NULL))) {
1035 fprintf(stderr, "W: cannot add option filter test (%s)\n", \
1039 OPTION_FILTER_TEST(1, "option filter #1");
1040 OPTION_FILTER_TEST(2, "option filter #2");
1041 OPTION_FILTER_TEST(3, "option filter #3");
1044 fprintf(stderr, "W: cannot add option filter test suite (%s)\n",