/net-tools-latest/libcoap/tests/ |
D | test_options.c | 25 str teststr = { 1, (unsigned char *)"" }; in t_parse_option1() local 31 result = coap_opt_parse(teststr.s, teststr.length, &option); in t_parse_option1() 41 str teststr = { 2, (unsigned char *)"\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 str teststr = { 13, (unsigned char *)"\x3c\x00\x01\x02\x03\x04" in t_parse_option3() local 62 result = coap_opt_parse(teststr.s, teststr.length, &option); in t_parse_option3() 66 CU_ASSERT(option.value == teststr.s + 1); in t_parse_option3() 73 str teststr = { 2, (unsigned char *)"\xf3" }; in t_parse_option4() local 78 result = coap_opt_parse(teststr.s, teststr.length, &option); in t_parse_option4() [all …]
|
D | test_pdu.c | 27 uint8_t teststr[] = { 0x40, 0x01, 0x93, 0x34 }; in t_parse_pdu1() local 30 result = coap_pdu_parse((unsigned char *)teststr, sizeof(teststr), pdu); in t_parse_pdu1() 33 CU_ASSERT(pdu->length == sizeof(teststr)); in t_parse_pdu1() 38 CU_ASSERT(memcmp(&pdu->hdr->id, teststr + 2, 2) == 0); in t_parse_pdu1() 44 uint8_t teststr[] = { 0x55, 0x69, 0x12, 0x34, 't', 'o', 'k', 'e', 'n' }; in t_parse_pdu2() local 47 result = coap_pdu_parse((unsigned char *)teststr, sizeof(teststr), pdu); in t_parse_pdu2() 50 CU_ASSERT(pdu->length == sizeof(teststr)); in t_parse_pdu2() 55 CU_ASSERT(memcmp(&pdu->hdr->id, teststr + 2, 2) == 0); in t_parse_pdu2() 56 CU_ASSERT(memcmp(pdu->hdr->token, teststr + 4, 5) == 0); in t_parse_pdu2() 62 uint8_t teststr[] = { 0x53, 0x69, 0x12, 0x34, 't', 'o', 'k', 'e', 'n' }; in t_parse_pdu3() local [all …]
|
D | test_uri.c | 18 char teststr[] = "coap://[::1]/.well-known/core"; in t_parse_uri1() local 23 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri1() 42 char teststr[] = "coap://[::1]:8000/.well-known/core"; in t_parse_uri2() local 46 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri2() 65 char teststr[] = "coap://localhost/?foo&bla=fasel"; in t_parse_uri3() local 69 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri3() 87 char teststr[] = "coap://:100000"; in t_parse_uri4() local 91 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri4() 97 char teststr[] = "coap://foo:100000"; in t_parse_uri5() local 101 result = coap_split_uri((unsigned char *)teststr, strlen(teststr), &uri); in t_parse_uri5() [all …]
|
D | test_error_response.c | 30 uint8_t teststr[] = { in t_error_response1() local 46 CU_ASSERT(response->length == sizeof(teststr)); in t_error_response1() 53 CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0); in t_error_response1() 58 uint8_t teststr[] = { in t_error_response2() local 76 CU_ASSERT(response->length == sizeof(teststr)); in t_error_response2() 82 CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0); in t_error_response2() 88 uint8_t teststr[] = { in t_error_response3() local 109 CU_ASSERT(response->length == sizeof(teststr)); in t_error_response3() 115 CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0); in t_error_response3() 125 uint8_t teststr[] = { in t_error_response4() local [all …]
|
D | test_wellknown.c | 33 char teststr[] = { /* </>;title="some attribute";ct=0 (31 chars) */ in t_wellknown1() local 47 for (offset = 0; offset < sizeof(teststr); offset++) { in t_wellknown1() 53 CU_ASSERT(result == sizeof(teststr) - offset); in t_wellknown1() 54 CU_ASSERT(buflen == sizeof(teststr)); in t_wellknown1() 55 CU_ASSERT(memcmp(buf, teststr + offset, sizeof(teststr) - offset) == 0); in t_wellknown1() 64 CU_ASSERT(buflen == sizeof(teststr)); in t_wellknown1() 72 CU_ASSERT(buflen == sizeof(teststr)); in t_wellknown1() 82 char teststr[] = { /* ,</abcd>;if="one";obs (21 chars) */ in t_wellknown2() local 94 for (offset = 0; offset < sizeof(teststr) - sizeof(buf); offset++) { in t_wellknown2() 101 CU_ASSERT(buflen == sizeof(teststr)); in t_wellknown2() [all …]
|