Skip to content

Commit

Permalink
cont.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed Jul 4, 2024
1 parent 3b152b8 commit e028f7b
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 96 deletions.
6 changes: 2 additions & 4 deletions worker/test/src/RTC/RTCP/TestBye.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ SCENARIO("RTCP BYE parsing", "[parser][rtcp][bye]")
{
SECTION("parse BYE packet")
{
ByePacket* packet = ByePacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<ByePacket> packet{ ByePacket::Parse(buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -64,8 +64,6 @@ SCENARIO("RTCP BYE parsing", "[parser][rtcp][bye]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}

SECTION("create ByePacket")
Expand Down
6 changes: 2 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackPsAfb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ SCENARIO("RTCP Feedback PS AFB parsing", "[parser][rtcp][feedback-ps][afb]")
{
using namespace TestFeedbackPsAfb;

FeedbackPsAfbPacket* packet = FeedbackPsAfbPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackPsAfbPacket> packet{ FeedbackPsAfbPacket::Parse(buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -56,7 +56,5 @@ SCENARIO("RTCP Feedback PS AFB parsing", "[parser][rtcp][feedback-ps][afb]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}
}
6 changes: 2 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackPsLei.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ SCENARIO("RTCP Feedback PS LEI parsing", "[parser][rtcp][feedback-ps][lei]")

SECTION("parse FeedbackPsLeiPacket")
{
FeedbackPsLeiPacket* packet = FeedbackPsLeiPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackPsLeiPacket> packet{ FeedbackPsLeiPacket::Parse(buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -58,8 +58,6 @@ SCENARIO("RTCP Feedback PS LEI parsing", "[parser][rtcp][feedback-ps][lei]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}

SECTION("create FeedbackPsLeiPacket")
Expand Down
7 changes: 3 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackPsPli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "RTC/RTCP/FeedbackPsPli.hpp"
#include <catch2/catch_test_macros.hpp>
#include <cstring> // std::memcmp()
#include <memory>

using namespace RTC::RTCP;

Expand Down Expand Up @@ -35,11 +36,11 @@ SCENARIO("RTCP Feeback RTP PLI parsing", "[parser][rtcp][feedback-ps][pli]")

SECTION("parse FeedbackPsPliPacket")
{
FeedbackPsPliPacket* packet = FeedbackPsPliPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackPsPliPacket> packet{ FeedbackPsPliPacket::Parse(buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -52,8 +53,6 @@ SCENARIO("RTCP Feeback RTP PLI parsing", "[parser][rtcp][feedback-ps][pli]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}

SECTION("create FeedbackPsPliPacket")
Expand Down
6 changes: 2 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackPsRemb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ SCENARIO("RTCP Feedback PS parsing", "[parser][rtcp][feedback-ps][remb]")

SECTION("parse FeedbackPsRembPacket")
{
FeedbackPsRembPacket* packet = FeedbackPsRembPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackPsRembPacket> packet{ FeedbackPsRembPacket::Parse(buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -60,8 +60,6 @@ SCENARIO("RTCP Feedback PS parsing", "[parser][rtcp][feedback-ps][remb]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}

SECTION("create FeedbackPsRembPacket")
Expand Down
6 changes: 2 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackPsRpsi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ SCENARIO("RTCP Feedback PS RPSI parsing", "[parser][rtcp][feedback-ps][rpsi]")

SECTION("parse FeedbackPsRpsiPacket")
{
FeedbackPsRpsiPacket* packet = FeedbackPsRpsiPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackPsRpsiPacket> packet{ FeedbackPsRpsiPacket::Parse(buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -66,7 +66,5 @@ SCENARIO("RTCP Feedback PS RPSI parsing", "[parser][rtcp][feedback-ps][rpsi]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}
}
6 changes: 2 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackPsSli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ SCENARIO("RTCP Feedback PS SLI parsing", "[parser][rtcp][feedback-ps][sli]")

SECTION("parse FeedbackPsSliPacket")
{
FeedbackPsSliPacket* packet = FeedbackPsSliPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackPsSliPacket> packet{ FeedbackPsSliPacket::Parse(buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -63,7 +63,5 @@ SCENARIO("RTCP Feedback PS SLI parsing", "[parser][rtcp][feedback-ps][sli]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}
}
6 changes: 2 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackPsTst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ SCENARIO("RTCP Feedback PS TSTN parsing", "[parser][rtcp][feedback-ps][tstn]")

SECTION("parse FeedbackPsTstPacket")
{
FeedbackPsTstnPacket* packet = FeedbackPsTstnPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackPsTstnPacket> packet{ FeedbackPsTstnPacket::Parse(buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -62,8 +62,6 @@ SCENARIO("RTCP Feedback PS TSTN parsing", "[parser][rtcp][feedback-ps][tstn]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}

SECTION("create FeedbackPsTstPacket")
Expand Down
6 changes: 2 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackPsVbcm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ SCENARIO("RTCP Feedback PS VBCM parsing", "[parser][rtcp][feedback-ps][vbcm]")

SECTION("parse FeedbackPsVbcmPacket")
{
FeedbackPsVbcmPacket* packet = FeedbackPsVbcmPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackPsVbcmPacket> packet{ FeedbackPsVbcmPacket::Parse(buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -72,7 +72,5 @@ SCENARIO("RTCP Feedback PS VBCM parsing", "[parser][rtcp][feedback-ps][vbcm]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}
}
6 changes: 2 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ SCENARIO("RTCP Feeback RTP ECN parsing", "[parser][rtcp][feedback-rtp][ecn]")
{
using namespace TestFeedbackRtpEcn;

FeedbackRtpEcnPacket* packet = FeedbackRtpEcnPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackRtpEcnPacket> packet{ FeedbackRtpEcnPacket::Parse(buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -78,7 +78,5 @@ SCENARIO("RTCP Feeback RTP ECN parsing", "[parser][rtcp][feedback-rtp][ecn]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}
}
7 changes: 3 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackRtpNack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ SCENARIO("RTCP Feeback RTP NACK parsing", "[parser][rtcp][feedback-rtp][nack]")

SECTION("parse FeedbackRtpNackItem")
{
FeedbackRtpNackPacket* packet = FeedbackRtpNackPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackRtpNackPacket> packet{ FeedbackRtpNackPacket::Parse(
buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -62,8 +63,6 @@ SCENARIO("RTCP Feeback RTP NACK parsing", "[parser][rtcp][feedback-rtp][nack]")
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}

SECTION("create FeedbackRtpNackPacket")
Expand Down
7 changes: 3 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ SCENARIO("RTCP Feeback RTP SR-REQ parsing", "[parser][rtcp][feedback-rtp][sr-req

SECTION("parse FeedbackRtpSrReqPacket")
{
FeedbackRtpSrReqPacket* packet = FeedbackRtpSrReqPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackRtpSrReqPacket> packet{ FeedbackRtpSrReqPacket::Parse(
buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -52,8 +53,6 @@ SCENARIO("RTCP Feeback RTP SR-REQ parsing", "[parser][rtcp][feedback-rtp][sr-req
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}

SECTION("create FeedbackRtpSrReqPacket")
Expand Down
7 changes: 3 additions & 4 deletions worker/test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ SCENARIO("RTCP Feeback RTP TLLEI parsing", "[parser][rtcp][feedback-rtp][tllei]"
{
using namespace TestFeedbackRtpTllei;

FeedbackRtpTlleiPacket* packet = FeedbackRtpTlleiPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackRtpTlleiPacket> packet{ FeedbackRtpTlleiPacket::Parse(
buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -62,7 +63,5 @@ SCENARIO("RTCP Feeback RTP TLLEI parsing", "[parser][rtcp][feedback-rtp][tllei]"
REQUIRE(std::memcmp(buffer, serialized, sizeof(buffer)) == 0);
}
}

delete packet;
}
}
14 changes: 6 additions & 8 deletions worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ SCENARIO("RTCP Feeback RTP TMMBR parsing", "[parser][rtcp][feedback-rtp][tmmb]")

SECTION("parse FeedbackRtpTmmbrPacket")
{
FeedbackRtpTmmbrPacket* packet = FeedbackRtpTmmbrPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackRtpTmmbrPacket> packet{ FeedbackRtpTmmbrPacket::Parse(
buffer, sizeof(buffer)) };

REQUIRE(packet);

verify(packet);
verify(packet.get());

SECTION("serialize packet instance")
{
Expand All @@ -64,15 +65,12 @@ SCENARIO("RTCP Feeback RTP TMMBR parsing", "[parser][rtcp][feedback-rtp][tmmb]")
// represent the same content.
SECTION("create a packet out of the serialized buffer")
{
FeedbackRtpTmmbrPacket* packet = FeedbackRtpTmmbrPacket::Parse(buffer, sizeof(buffer));
std::unique_ptr<FeedbackRtpTmmbrPacket> packet{ FeedbackRtpTmmbrPacket::Parse(
buffer, sizeof(buffer)) };

verify(packet);

delete packet;
verify(packet.get());
}
}

delete packet;
}

SECTION("create FeedbackRtpTmmbrPacket")
Expand Down
Loading

0 comments on commit e028f7b

Please sign in to comment.