diff options
author | Max <msuraev@sysmocom.de> | 2018-12-17 17:09:17 +0100 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2018-12-18 14:35:10 +0000 |
commit | bb53a3f64a76b6e89a2632a56ec2845a1103ef2f (patch) | |
tree | 41aac3c9035a33f32d7a22f8376aedd990155e02 /tests | |
parent | 964da93c6913911ef9b005a7a2f36dc9af04568d (diff) |
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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/msc_vlr/msc_vlr_tests.h | 8 |
1 files 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") |