Skip to content

Commit

Permalink
Revert unrelated test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankiesz committed Nov 9, 2024
1 parent 556891c commit 861e409
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 116 deletions.
86 changes: 0 additions & 86 deletions tst/RtcpFunctionalityTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,92 +365,6 @@ TEST_F(RtcpFunctionalityTest, twcc3)
parseTwcc("4487A9E754B3E6FD04B60036147CAA852024C002D999D6407800000000000000000000000000040000000000000000", 43, 11);
parseTwcc("4487A9E754B3E6FD040200E4147C9F81202700B7E6649000000000000000000004000000000008000018000000001", 43, 185);
}

TEST_F(RtcpFunctionalityTest, onRtcpPacketTwccReport)
{
PRtcPeerConnection pRtcPeerConnection = nullptr;
PKvsPeerConnection pKvsPeerConnection;
RtcpPacket rtcpPacket;
RtcConfiguration config{};
auto hexpacket = (PCHAR) "8FCD00054487A9E754B3E6FD01810001147A75A62001C801";
BYTE rawpacket[256] = {0};
UINT32 rawpacketSize = 256;
EXPECT_EQ(hexDecode(hexpacket, strlen(hexpacket), rawpacket, &rawpacketSize), STATUS_SUCCESS);

EXPECT_EQ(onRtcpTwccPacket(NULL, NULL), STATUS_NULL_ARG);
EXPECT_EQ(createPeerConnection(&config, &pRtcPeerConnection), STATUS_SUCCESS);
pKvsPeerConnection = reinterpret_cast<PKvsPeerConnection>(pRtcPeerConnection);
EXPECT_EQ(onRtcpTwccPacket(NULL, pKvsPeerConnection), STATUS_NULL_ARG);
EXPECT_EQ(onRtcpTwccPacket(&rtcpPacket, pKvsPeerConnection), STATUS_SUCCESS); // Testing before setting callback
EXPECT_EQ(peerConnectionOnSenderBandwidthEstimation(pRtcPeerConnection, 0, testBwHandler), STATUS_SUCCESS);
EXPECT_EQ(onRtcpPacket(pKvsPeerConnection, rawpacket, rawpacketSize), STATUS_SUCCESS);
EXPECT_EQ(freePeerConnection(&pRtcPeerConnection), STATUS_SUCCESS);
}

TEST_F(RtcpFunctionalityTest, onRtcpPacketFirReport)
{
RtcOutboundRtpStreamStats stats{};
auto hexpacket = (PCHAR) "80C000014487A9E7";
BYTE rawpacket[256] = {0};
UINT32 rawpacketSize = 256;
BOOL onPictureLossCalled = FALSE;


EXPECT_EQ(hexDecode(hexpacket, strlen(hexpacket), rawpacket, &rawpacketSize), STATUS_SUCCESS);
initTransceiver(0x4487A9E7);
pKvsRtpTransceiver->onPictureLossCustomData = (UINT64) &onPictureLossCalled;
pKvsRtpTransceiver->onPictureLoss = [](UINT64 customData) -> void { *(PBOOL) customData = TRUE; };

EXPECT_EQ(onRtcpPacket(pKvsPeerConnection, rawpacket, rawpacketSize), STATUS_SUCCESS);
EXPECT_EQ(getRtpOutboundStats(pRtcPeerConnection, nullptr, &stats), STATUS_SUCCESS);
EXPECT_EQ(stats.firCount, 1);
EXPECT_TRUE(onPictureLossCalled);
EXPECT_EQ(freePeerConnection(&pRtcPeerConnection), STATUS_SUCCESS);
}

TEST_F(RtcpFunctionalityTest, onRtcpPacketSliReport)
{
RtcOutboundRtpStreamStats stats{};
auto hexpacket = (PCHAR) "82CE00014487A9E7";
BYTE rawpacket[256] = {0};
UINT32 rawpacketSize = 256;

EXPECT_EQ(hexDecode(hexpacket, strlen(hexpacket), rawpacket, &rawpacketSize), STATUS_SUCCESS);
initTransceiver(0x4487A9E7);

EXPECT_EQ(onRtcpSLIPacket(NULL, NULL), STATUS_NULL_ARG);
EXPECT_EQ(onRtcpSLIPacket(NULL, pKvsPeerConnection), STATUS_NULL_ARG);
EXPECT_EQ(onRtcpPacket(pKvsPeerConnection, rawpacket, rawpacketSize), STATUS_SUCCESS);
EXPECT_EQ(getRtpOutboundStats(pRtcPeerConnection, nullptr, &stats), STATUS_SUCCESS);
EXPECT_EQ(stats.sliCount, 1);
EXPECT_EQ(freePeerConnection(&pRtcPeerConnection), STATUS_SUCCESS);
}

TEST_F(RtcpFunctionalityTest, onRtcpPacketPliReport)
{
RtcOutboundRtpStreamStats stats{};
auto hexpacket = (PCHAR) "81CE00014487A9E7";
BYTE rawpacket[256] = {0};
UINT32 rawpacketSize = 256;
BOOL onPictureLossCalled = FALSE;

EXPECT_EQ(hexDecode(hexpacket, strlen(hexpacket), rawpacket, &rawpacketSize), STATUS_SUCCESS);
initTransceiver(0x4487A9E7);

EXPECT_EQ(transceiverOnPictureLoss(NULL, (UINT64) &onPictureLossCalled, NULL), STATUS_NULL_ARG);
EXPECT_EQ(transceiverOnPictureLoss(pRtcRtpTransceiver, (UINT64) &onPictureLossCalled, NULL), STATUS_NULL_ARG);
EXPECT_EQ(transceiverOnPictureLoss(NULL, (UINT64) &onPictureLossCalled, testPictureLossCb), STATUS_NULL_ARG);
EXPECT_EQ(transceiverOnPictureLoss(pRtcRtpTransceiver, (UINT64) &onPictureLossCalled, testPictureLossCb), STATUS_SUCCESS);

EXPECT_EQ(onRtcpPLIPacket(NULL, NULL), STATUS_NULL_ARG);
EXPECT_EQ(onRtcpPLIPacket(NULL, pKvsPeerConnection), STATUS_NULL_ARG);
EXPECT_EQ(onRtcpPacket(pKvsPeerConnection, rawpacket, rawpacketSize), STATUS_SUCCESS);
EXPECT_EQ(getRtpOutboundStats(pRtcPeerConnection, nullptr, &stats), STATUS_SUCCESS);
EXPECT_EQ(stats.pliCount, 1);
EXPECT_TRUE(onPictureLossCalled);
EXPECT_EQ(freePeerConnection(&pRtcPeerConnection), STATUS_SUCCESS);
}

} // namespace webrtcclient
} // namespace video
} // namespace kinesis
Expand Down
30 changes: 0 additions & 30 deletions tst/RtpFunctionalityTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,36 +631,6 @@ TEST_F(RtpFunctionalityTest, twccPayload)
EXPECT_EQ(0, ptr[3]);
}

TEST_F(RtpFunctionalityTest, createKvsRtpTransceiverInvalidArg)
{
RtcMediaStreamTrack mediaTrack{};
KvsPeerConnection kvsPeerConnection;
EXPECT_EQ(createKvsRtpTransceiver(RTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV, NULL, 0, 0, &mediaTrack, NULL, RTC_CODEC_OPUS, NULL), STATUS_NULL_ARG);
EXPECT_EQ(createKvsRtpTransceiver(RTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV, &kvsPeerConnection, 0, 0, &mediaTrack, NULL, RTC_CODEC_OPUS, NULL), STATUS_NULL_ARG);
EXPECT_EQ(createKvsRtpTransceiver(RTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV, &kvsPeerConnection, 0, 0, NULL, NULL, RTC_CODEC_OPUS, NULL), STATUS_NULL_ARG);
}

TEST_F(RtpFunctionalityTest, freeTransceiverApiTest)
{
EXPECT_EQ(freeTransceiver(NULL), STATUS_NOT_IMPLEMENTED);
}

TEST_F(RtpFunctionalityTest, convertRtpErrorCodeTest)
{
RtpResult_t rtpResult;

rtpResult = RTP_RESULT_OK;
EXPECT_EQ(convertRtpErrorCode(rtpResult), STATUS_SUCCESS);
rtpResult = RTP_RESULT_BAD_PARAM;
EXPECT_EQ(convertRtpErrorCode(rtpResult), STATUS_INVALID_ARG);
rtpResult = RTP_RESULT_OUT_OF_MEMORY;
EXPECT_EQ(convertRtpErrorCode(rtpResult), STATUS_NOT_ENOUGH_MEMORY);
rtpResult = RTP_RESULT_WRONG_VERSION;
EXPECT_EQ(convertRtpErrorCode(rtpResult), STATUS_RTP_INVALID_VERSION);
rtpResult = RTP_RESULT_MALFORMED_PACKET;
EXPECT_EQ(convertRtpErrorCode(rtpResult), STATUS_RTP_INPUT_PACKET_TOO_SMALL);
}

} // namespace webrtcclient
} // namespace video
} // namespace kinesis
Expand Down

0 comments on commit 861e409

Please sign in to comment.