From f91c8799c65243cb48e7a4e368ab58fa0b286361 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Mon, 23 May 2022 12:22:44 +0200 Subject: [PATCH] unittests: fix assertion for nanocoap_cache_key_compare() The doc states only that the result is <0, not -1. The result isn't the latter for some platforms (see https://github.com/RIOT-OS/RIOT/runs/6534330788?check_suite_focus=true#step:13:696) --- tests/unittests/tests-nanocoap_cache/tests-nanocoap_cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unittests/tests-nanocoap_cache/tests-nanocoap_cache.c b/tests/unittests/tests-nanocoap_cache/tests-nanocoap_cache.c index 8545a34caa..b2b0257683 100644 --- a/tests/unittests/tests-nanocoap_cache/tests-nanocoap_cache.c +++ b/tests/unittests/tests-nanocoap_cache/tests-nanocoap_cache.c @@ -70,9 +70,9 @@ static void test_nanocoap_cache__cachekey(void) nanocoap_cache_key_generate((const coap_pkt_t *) &pkt2, digest2); /* compare 1. and 3. packet */ - TEST_ASSERT_EQUAL_INT(-1, nanocoap_cache_key_compare(digest1, digest2)); + TEST_ASSERT(nanocoap_cache_key_compare(digest1, digest2) < 0); /* compare 3. and 1. packet */ - TEST_ASSERT_EQUAL_INT(1, nanocoap_cache_key_compare(digest2, digest1)); + TEST_ASSERT(nanocoap_cache_key_compare(digest2, digest1) > 0); } static void test_nanocoap_cache__add(void) {