Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add usage of rtcp_msg_print() #1105

Merged
merged 12 commits into from
Apr 29, 2024
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
Loading