From d1c310cbcad7835a52daae7f2b580bc6d4d1eca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joni=20R=C3=A4s=C3=A4nen?= Date: Wed, 13 Jul 2022 15:13:00 +0300 Subject: [PATCH] tests: Fix RTCP tests --- test/test_2_rtp.cpp | 4 ++-- test/test_3_rtcp.cpp | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/test/test_2_rtp.cpp b/test/test_2_rtp.cpp index 977a2ce..abf2ebb 100644 --- a/test/test_2_rtp.cpp +++ b/test/test_2_rtp.cpp @@ -55,7 +55,7 @@ TEST(RTPTests, rtp_hook) for (size_t& size : sizes) { std::unique_ptr test_frame = create_test_packet(RTP_FORMAT_GENERIC, 0, false, size, RTP_NO_FLAGS); - send_packets(std::move(test_frame), size, sess, sender, test_packets, 0, true, RTP_NO_FLAGS); + test_packet_size(std::move(test_frame), test_packets, size, sess, sender, receiver, RTP_NO_FLAGS); } cleanup_ms(sess, receiver); @@ -83,7 +83,7 @@ TEST(RTPTests, rtp_send_test) size_t size = 1500; std::unique_ptr test_frame = create_test_packet(RTP_FORMAT_GENERIC, 0, false, size, RTP_NO_FLAGS); - send_packets(std::move(test_frame), size, sess, sender, test_packets, 0, true, RTP_NO_FLAGS); + test_packet_size(std::move(test_frame), test_packets, size, sess, sender, receiver, RTP_NO_FLAGS); cleanup_ms(sess, sender); cleanup_sess(ctx, sess); diff --git a/test/test_3_rtcp.cpp b/test/test_3_rtcp.cpp index 64f766a..093abd4 100644 --- a/test/test_3_rtcp.cpp +++ b/test/test_3_rtcp.cpp @@ -53,7 +53,7 @@ TEST(RTCPTests, rtcp) { std::unique_ptr test_frame = std::unique_ptr(new uint8_t[PAYLOAD_LEN]); memset(test_frame.get(), 'b', PAYLOAD_LEN); - send_packets(std::move(test_frame), PAYLOAD_LEN, local_session, local_stream, SEND_TEST_PACKETS, 0, true, RTP_NO_FLAGS); + send_packets(std::move(test_frame), PAYLOAD_LEN, local_session, local_stream, SEND_TEST_PACKETS, PACKET_INTERVAL_MS, true, RTP_NO_FLAGS); cleanup(ctx, local_session, remote_session, local_stream, remote_stream); } @@ -96,7 +96,8 @@ TEST(RTCP_reopen_receiver, rtcp) { { std::unique_ptr test_frame = std::unique_ptr(new uint8_t[PAYLOAD_LEN]); memset(test_frame.get(), 'b', PAYLOAD_LEN); - send_packets(std::move(test_frame), PAYLOAD_LEN, local_session, local_stream, SEND_TEST_PACKETS/2, 0, true, RTP_NO_FLAGS); + send_packets(std::move(test_frame), PAYLOAD_LEN, local_session, local_stream, SEND_TEST_PACKETS/2, + PACKET_INTERVAL_MS, true, RTP_NO_FLAGS); if (remote_stream) { @@ -108,7 +109,8 @@ TEST(RTCP_reopen_receiver, rtcp) { test_frame = std::unique_ptr(new uint8_t[PAYLOAD_LEN]); memset(test_frame.get(), 'b', PAYLOAD_LEN); - send_packets(std::move(test_frame), PAYLOAD_LEN, local_session, local_stream, SEND_TEST_PACKETS / 2, 0, true, RTP_NO_FLAGS); + send_packets(std::move(test_frame), PAYLOAD_LEN, local_session, local_stream, SEND_TEST_PACKETS / 2, + PACKET_INTERVAL_MS, true, RTP_NO_FLAGS); } cleanup(ctx, local_session, remote_session, local_stream, remote_stream); @@ -146,7 +148,7 @@ TEST(RTCP_double_bind_test, rtcp) { void receiver_hook(uvgrtp::frame::rtcp_receiver_report* frame) { - std::cout << "RTCP receiver report! ----------" << std::endl; + std::cout << std::endl << "RTCP receiver report! ----------" << std::endl; for (auto& block : frame->report_blocks) { @@ -165,7 +167,7 @@ void receiver_hook(uvgrtp::frame::rtcp_receiver_report* frame) void sender_hook(uvgrtp::frame::rtcp_sender_report* frame) { - std::cout << "RTCP sender report! ----------" << std::endl; + std::cout << std::endl << "RTCP sender report! ----------" << std::endl; std::cout << "NTP msw: " << frame->sender_info.ntp_msw << std::endl; std::cout << "NTP lsw: " << frame->sender_info.ntp_lsw << std::endl; std::cout << "RTP timestamp: " << frame->sender_info.rtp_ts << std::endl;