From bb53a3f64a76b6e89a2632a56ec2845a1103ef2f Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 17 Dec 2018 17:09:17 +0100 Subject: [PATCH] VLR tests: add logging macro with explicit value description To avoid leaking structure details into test we sometimes have to separate value description from actual value. Introduce new macro which makes that possible and convert old one into trivial wrapper around it. Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864 --- tests/msc_vlr/msc_vlr_tests.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h index f7ff94002..7eb6d240a 100644 --- a/tests/msc_vlr/msc_vlr_tests.h +++ b/tests/msc_vlr/msc_vlr_tests.h @@ -182,11 +182,13 @@ void thwart_rx_non_initial_requests(); OSMO_ASSERT(accepted == expect_accepted); \ } while (false) -#define VERBOSE_ASSERT(val, expect_op, fmt) \ +#define VAL_ASSERT(desc, val, expect_op, fmt) \ do { \ - log(#val " == " fmt, (val)); \ + log(desc " == " fmt, (val)); \ OSMO_ASSERT((val) expect_op); \ - } while (0); + } while (0) + +#define VERBOSE_ASSERT(val, expect_op, fmt) VAL_ASSERT(#val, val, expect_op, fmt) #define EXPECT_CONN_COUNT(N) VERBOSE_ASSERT(llist_count(&net->ran_conns), == N, "%d")