tests: temporarily change log-level to remove expected warnings

Some unit tests in tests/test_options.c and tests/test_pdu.c check
for error cases, causing warning messages to be emitted by the
library code. As the expected result is checked separately, the
warnings can be suppressed to avoid confusion.
This commit is contained in:
Olaf Bergmann committed 2015-06-07 12:32:09 +02:00
1 parent 24a83b7b0e
commit 774fc01ec1
2 files changed
+6

No files matched your search

+3
View File
@@ -393,9 +393,12 @@ t_access_option5(void) {
static void
t_access_option6(void) {
coap_log_t level = coap_get_log_level();
const uint8_t teststr[] = { 0xf2, 'a', 'b' };
coap_set_log_level(LOG_CRIT);
CU_ASSERT(coap_opt_delta((coap_opt_t *)teststr) == 0);
coap_set_log_level(level);
CU_ASSERT(coap_opt_length((coap_opt_t *)teststr) == 0);
CU_ASSERT_PTR_EQUAL(coap_opt_value((coap_opt_t *)teststr), NULL);
CU_ASSERT(coap_opt_size((coap_opt_t *)teststr) == 0);
+3
View File
@@ -599,6 +599,7 @@ t_encode_pdu10(void) {
static void
t_encode_pdu11(void) {
coap_log_t level = coap_get_log_level();
/* data too long for PDU */
size_t old_max = pdu->max_size;
int result;
@@ -606,7 +607,9 @@ t_encode_pdu11(void) {
coap_pdu_clear(pdu, 8); /* clear PDU, with small maximum */
CU_ASSERT(pdu->data == NULL);
coap_set_log_level(LOG_CRIT);
result = coap_add_data(pdu, 10, (unsigned char *)"0123456789");
coap_set_log_level(level);
CU_ASSERT(result == 0);
CU_ASSERT(pdu->data == NULL);