Lines Matching refs:response

34   coap_pdu_t *response;
42 response = coap_new_error_response(pdu, COAP_RESPONSE_CODE(400), &opts);
44 CU_ASSERT_PTR_NOT_NULL(response);
46 CU_ASSERT(response->used_size == sizeof(teststr) - 4);
47 CU_ASSERT(response->type == COAP_MESSAGE_ACK);
48 CU_ASSERT(response->e_token_length == 0);
49 CU_ASSERT(response->code == 0x80);
50 CU_ASSERT(response->mid == 0x1234);
51 CU_ASSERT(coap_pdu_encode_header(response, COAP_PROTO_UDP) == 4);
52 CU_ASSERT(memcmp(response->token - 4, teststr, sizeof(teststr)) == 0);
53 coap_delete_pdu(response);
63 coap_pdu_t *response;
72 response = coap_new_error_response(pdu, COAP_RESPONSE_CODE(404), &opts);
74 CU_ASSERT_PTR_NOT_NULL(response);
76 CU_ASSERT(response->used_size == sizeof(teststr) - 4);
77 CU_ASSERT(response->type == COAP_MESSAGE_NON);
78 CU_ASSERT(response->e_token_length == 5);
79 CU_ASSERT(response->code == 0x84);
80 CU_ASSERT(coap_pdu_encode_header(response, COAP_PROTO_UDP) == 4);
81 CU_ASSERT(memcmp(response->token - 4, teststr, sizeof(teststr)) == 0);
82 coap_delete_pdu(response);
93 coap_pdu_t *response;
105 response = coap_new_error_response(pdu, code, &opts);
107 CU_ASSERT_PTR_NOT_NULL(response);
109 CU_ASSERT(response->used_size == sizeof(teststr) - 4);
110 CU_ASSERT(response->type == COAP_MESSAGE_ACK);
111 CU_ASSERT(response->e_token_length == 5);
112 CU_ASSERT(response->code == code);
113 CU_ASSERT(coap_pdu_encode_header(response, COAP_PROTO_UDP) == 4);
114 CU_ASSERT(memcmp(response->token - 4, teststr, sizeof(teststr)) == 0);
115 coap_delete_pdu(response);
132 coap_pdu_t *response;
144 response = coap_new_error_response(pdu, code, &opts);
146 CU_ASSERT_PTR_NOT_NULL(response);
148 CU_ASSERT(response->used_size == sizeof(teststr) - 4);
149 CU_ASSERT(response->type == COAP_MESSAGE_ACK);
150 CU_ASSERT(response->e_token_length == 5);
151 CU_ASSERT(response->code == code);
152 CU_ASSERT(coap_pdu_encode_header(response, COAP_PROTO_UDP) == 4);
153 CU_ASSERT(memcmp(response->token - 4, teststr, sizeof(teststr)) == 0);
154 coap_delete_pdu(response);
173 coap_pdu_t *response;
185 response = coap_new_error_response(pdu, code, &opts);
187 CU_ASSERT_PTR_NOT_NULL(response);
189 CU_ASSERT(response->used_size == sizeof(teststr) - 4);
190 CU_ASSERT(response->type == COAP_MESSAGE_ACK);
191 CU_ASSERT(response->e_token_length == 5);
192 CU_ASSERT(response->code == code);
193 CU_ASSERT(coap_pdu_encode_header(response, COAP_PROTO_UDP) == 4);
194 CU_ASSERT(memcmp(response->token - 4, teststr, sizeof(teststr)) == 0);
195 coap_delete_pdu(response);
214 coap_pdu_t *response;
226 response = coap_new_error_response(pdu, code, &opts);
228 CU_ASSERT_PTR_NOT_NULL(response);
230 CU_ASSERT(response->used_size == sizeof(teststr) - 4);
231 CU_ASSERT(response->type == COAP_MESSAGE_ACK);
232 CU_ASSERT(response->e_token_length == 5);
233 CU_ASSERT(response->code == code);
234 CU_ASSERT(coap_pdu_encode_header(response, COAP_PROTO_UDP) == 4);
235 CU_ASSERT(memcmp(response->token - 4, teststr, sizeof(teststr)) == 0);
236 coap_delete_pdu(response);
255 coap_pdu_t *response;
268 response = coap_new_error_response(pdu, code, &opts);
270 CU_ASSERT_PTR_NOT_NULL(response);
272 CU_ASSERT(response->used_size == sizeof(teststr) - 4);
273 CU_ASSERT(response->type == COAP_MESSAGE_ACK);
274 CU_ASSERT(response->e_token_length == 5);
275 CU_ASSERT(response->code == code);
276 CU_ASSERT(coap_pdu_encode_header(response, COAP_PROTO_UDP) == 4);
277 CU_ASSERT(memcmp(response->token - 4, teststr, sizeof(teststr)) == 0);
278 coap_delete_pdu(response);
291 coap_pdu_t *response;
309 response = coap_new_error_response(pdu, code, &opts);
311 CU_ASSERT_PTR_NOT_NULL(response);
313 CU_ASSERT(response->used_size == sizeof(teststr) - 4);
314 CU_ASSERT(response->type == COAP_MESSAGE_ACK);
315 CU_ASSERT(response->e_token_length == 5);
316 CU_ASSERT(response->code == code);
317 CU_ASSERT(coap_pdu_encode_header(response, COAP_PROTO_UDP) == 4);
318 CU_ASSERT(memcmp(response->token - 4, teststr, sizeof(teststr)) == 0);
319 coap_delete_pdu(response);
339 suite[0] = CU_add_suite("error response generator",
343 fprintf(stderr, "W: cannot add error response generator test suite (%s)\n",
351 fprintf(stderr, "W: cannot add error response generator test (%s)\n", \