From acb4f9163373a6ceec3e67f3db2fa9837cb89c12 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Tue, 20 Apr 2021 15:29:31 +0200 Subject: [PATCH] test_pdu.c: fix type warnings Commit e4e067e5f has introduced a new type for PDU request and status codes, coap_pdu_code_t. This change now uses proper enums values to fix compiler warnings (-Wenum-conversion). --- tests/test_pdu.c | 6 +++--- tests/test_wellknown.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_pdu.c b/tests/test_pdu.c index c73a0da3..7b4cd5ee 100644 --- a/tests/test_pdu.c +++ b/tests/test_pdu.c @@ -334,7 +334,7 @@ t_encode_pdu1(void) { coap_pdu_clear(pdu, pdu->max_size); pdu->type = COAP_MESSAGE_CON; - pdu->code = COAP_REQUEST_GET; + pdu->code = COAP_REQUEST_CODE_GET; pdu->mid = 0x1234; result = coap_add_token(pdu, 5, (const uint8_t *)"token"); @@ -354,7 +354,7 @@ t_encode_pdu2(void) { coap_pdu_clear(pdu, 3); /* set very small PDU size */ pdu->type = COAP_MESSAGE_CON; - pdu->code = COAP_REQUEST_GET; + pdu->code = COAP_REQUEST_CODE_GET; pdu->mid = 0x1234; result = coap_add_token(pdu, 5, (const uint8_t *)"token"); @@ -477,7 +477,7 @@ t_encode_pdu6(void) { coap_pdu_clear(pdu, pdu->max_size); /* clear PDU */ pdu->type = COAP_MESSAGE_NON; - pdu->code = COAP_REQUEST_POST; + pdu->code = COAP_REQUEST_CODE_POST; pdu->mid = 0x1234; CU_ASSERT(pdu->used_size == 0); diff --git a/tests/test_wellknown.c b/tests/test_wellknown.c index 805885e5..ebcc3f5a 100644 --- a/tests/test_wellknown.c +++ b/tests/test_wellknown.c @@ -223,7 +223,7 @@ t_wellknown6(void) { coap_pdu_clear(pdu, pdu->max_size); /* clear PDU */ pdu->type = COAP_MESSAGE_NON; - pdu->code = COAP_REQUEST_GET; + pdu->code = COAP_REQUEST_CODE_GET; pdu->mid = 0x1234; CU_ASSERT_PTR_NOT_NULL(pdu);