From 06ce16c003d591a8d12a8694035ef1895cc49760 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" <114750+alfredh@users.noreply.github.com> Date: Mon, 29 Apr 2024 08:28:06 +0200 Subject: [PATCH] test: add usage of rtcp_msg_print() (#1105) --- test/rtp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/rtp.c b/test/rtp.c index ca67f2d81..3ed53dd6d 100644 --- a/test/rtp.c +++ b/test/rtp.c @@ -243,6 +243,7 @@ int test_rtcp_encode(void) struct mbuf *mb; const size_t sz = sizeof(rtcp_msg) - 1; const uint32_t srcv[2] = {0x12345678, 0x00abcdef}; + char debug_buf[512]; int err = 0; mb = mbuf_alloc(512); @@ -285,7 +286,17 @@ int test_rtcp_encode(void) while (mbuf_get_left(mb) >= 4 && !err) { struct rtcp_msg *msg = NULL; err = rtcp_decode(&msg, mb); + if (err) + break; + + /* Check that debug print works */ + debug_buf[0] = '\0'; + re_snprintf(debug_buf, sizeof(debug_buf), + "%H", rtcp_msg_print, msg); + msg = mem_deref(msg); + + ASSERT_TRUE(str_isset(debug_buf)); } if (err) goto out;