From: Arran Cudbard-Bell Date: Tue, 7 Sep 2021 14:07:53 +0000 (-0500) Subject: Add TEST_CHECK_SLEN X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bda6d78b46a6f4f50bb7653eeea7fc07aaf84ba;p=thirdparty%2Ffreeradius-server.git Add TEST_CHECK_SLEN --- diff --git a/src/lib/util/acutest_helpers.h b/src/lib/util/acutest_helpers.h index bdc3250290d..3393257f254 100644 --- a/src/lib/util/acutest_helpers.h +++ b/src/lib/util/acutest_helpers.h @@ -35,6 +35,14 @@ do { \ TEST_MSG("Got length : %zu", (size_t)_our_got); \ } while(0) +#define TEST_CHECK_SLEN(_got, _exp) \ +do { \ + ssize_t _our_got = (_got); \ + TEST_CHECK(_exp == _our_got); \ + TEST_MSG("Expected length : %zd", (ssize_t)_exp); \ + TEST_MSG("Got length : %zd", (ssize_t)_our_got); \ +} while(0) + #define TEST_CHECK_RET(_got, _exp) \ do { \ int _our_got = (_got); \