Skip to content

Commit

Permalink
test: add usage of rtcp_msg_print() (#1105)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh authored Apr 29, 2024
1 parent b5da6fc commit 06ce16c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 06ce16c

Please sign in to comment.