提交 e176a2b3 authored 作者: José Luis Millán's avatar José Luis Millán

Tests: gulp format

上级 0b447b04
#include "include/catch.hpp"
#include "common.hpp" #include "common.hpp"
#include "DepLibUV.hpp" #include "DepLibUV.hpp"
#include "include/catch.hpp"
#include "RTC/RtpDataCounter.hpp" #include "RTC/RtpDataCounter.hpp"
#include <vector> #include <vector>
......
#include "include/catch.hpp"
#include "common.hpp" #include "common.hpp"
#include "RTC/NackGenerator.hpp" #include "include/catch.hpp"
#include "RTC/Codecs/PayloadDescriptorHandler.hpp" #include "RTC/Codecs/PayloadDescriptorHandler.hpp"
#include "RTC/NackGenerator.hpp"
#include "RTC/RtpPacket.hpp" #include "RTC/RtpPacket.hpp"
#include <vector> #include <vector>
...@@ -10,9 +10,17 @@ using namespace RTC; ...@@ -10,9 +10,17 @@ using namespace RTC;
struct TestNackGeneratorInput struct TestNackGeneratorInput
{ {
TestNackGeneratorInput() = default; TestNackGeneratorInput() = default;
TestNackGeneratorInput(uint16_t seq, bool isKeyFrame, uint16_t firstNacked, size_t numNacked, bool keyFrameRequired = false, size_t nackListSize = 0) TestNackGeneratorInput(
: seq(seq), isKeyFrame(isKeyFrame), firstNacked(firstNacked), numNacked(numNacked), keyFrameRequired(keyFrameRequired), nackListSize(nackListSize) uint16_t seq,
{} bool isKeyFrame,
uint16_t firstNacked,
size_t numNacked,
bool keyFrameRequired = false,
size_t nackListSize = 0)
: seq(seq), isKeyFrame(isKeyFrame), firstNacked(firstNacked), numNacked(numNacked),
keyFrameRequired(keyFrameRequired), nackListSize(nackListSize)
{
}
uint16_t seq{ 0 }; uint16_t seq{ 0 };
bool isKeyFrame{ false }; bool isKeyFrame{ false };
...@@ -24,16 +32,28 @@ struct TestNackGeneratorInput ...@@ -24,16 +32,28 @@ struct TestNackGeneratorInput
class TestPayloadDescriptorHandler : public RTC::Codecs::PayloadDescriptorHandler class TestPayloadDescriptorHandler : public RTC::Codecs::PayloadDescriptorHandler
{ {
public: public:
TestPayloadDescriptorHandler(bool isKeyFrame): isKeyFrame(isKeyFrame) {}; TestPayloadDescriptorHandler(bool isKeyFrame) : isKeyFrame(isKeyFrame){};
~TestPayloadDescriptorHandler() = default; ~TestPayloadDescriptorHandler() = default;
void Dump() const { return; }; void Dump() const
void Encode(RTC::Codecs::EncodingContext* /*context*/, uint8_t* /*data*/) { return; }; {
void Restore(uint8_t* /*data*/) { return; }; return;
bool IsKeyFrame() const { return this->isKeyFrame; }; };
void Encode(RTC::Codecs::EncodingContext* /*context*/, uint8_t* /*data*/)
{
return;
};
void Restore(uint8_t* /*data*/)
{
return;
};
bool IsKeyFrame() const
{
return this->isKeyFrame;
};
private: private:
bool isKeyFrame { false }; bool isKeyFrame{ false };
}; };
class TestNackGeneratorListener : public NackGenerator::Listener class TestNackGeneratorListener : public NackGenerator::Listener
......
#include "include/catch.hpp"
#include "common.hpp" #include "common.hpp"
#include "RTC/RtpPacket.hpp" #include "include/catch.hpp"
#include "RTC/RTCP/FeedbackRtpNack.hpp" #include "RTC/RTCP/FeedbackRtpNack.hpp"
#include "RTC/RtpPacket.hpp"
#include "RTC/RtpStream.hpp" #include "RTC/RtpStream.hpp"
#include "RTC/RtpStreamSend.hpp" #include "RTC/RtpStreamSend.hpp"
#include <vector> #include <vector>
......
#include "common.hpp"
#include "include/catch.hpp" #include "include/catch.hpp"
#include "include/helpers.hpp" #include "include/helpers.hpp"
#include "common.hpp"
#include "RTC/RTCP/Packet.hpp"
#include "RTC/RTCP/Sdes.hpp"
#include "RTC/RTCP/SenderReport.hpp"
#include "RTC/RTCP/ReceiverReport.hpp"
#include "RTC/RTCP/Bye.hpp" #include "RTC/RTCP/Bye.hpp"
#include "RTC/RTCP/FeedbackRtpNack.hpp" #include "RTC/RTCP/FeedbackPsAfb.hpp"
#include "RTC/RTCP/FeedbackRtpTmmb.hpp"
#include "RTC/RTCP/FeedbackRtpTllei.hpp"
#include "RTC/RTCP/FeedbackRtpEcn.hpp"
#include "RTC/RTCP/FeedbackPsSli.hpp"
#include "RTC/RTCP/FeedbackPsRpsi.hpp"
#include "RTC/RTCP/FeedbackPsFir.hpp" #include "RTC/RTCP/FeedbackPsFir.hpp"
#include "RTC/RTCP/FeedbackPsTst.hpp"
#include "RTC/RTCP/FeedbackPsVbcm.hpp"
#include "RTC/RTCP/FeedbackPsLei.hpp" #include "RTC/RTCP/FeedbackPsLei.hpp"
#include "RTC/RTCP/FeedbackPsAfb.hpp"
#include "RTC/RTCP/FeedbackPsRemb.hpp" #include "RTC/RTCP/FeedbackPsRemb.hpp"
#include "RTC/RTCP/FeedbackPsRpsi.hpp"
#include "RTC/RTCP/FeedbackPsSli.hpp"
#include "RTC/RTCP/FeedbackPsTst.hpp"
#include "RTC/RTCP/FeedbackPsVbcm.hpp"
#include "RTC/RTCP/FeedbackRtpEcn.hpp"
#include "RTC/RTCP/FeedbackRtpNack.hpp"
#include "RTC/RTCP/FeedbackRtpTllei.hpp"
#include "RTC/RTCP/FeedbackRtpTmmb.hpp"
#include "RTC/RTCP/Packet.hpp"
#include "RTC/RTCP/ReceiverReport.hpp"
#include "RTC/RTCP/Sdes.hpp"
#include "RTC/RTCP/SenderReport.hpp"
#include <string> #include <string>
using namespace RTC::RTCP; using namespace RTC::RTCP;
...@@ -342,7 +342,6 @@ SCENARIO("parse RTCP packets", "[parser][rtcp]") ...@@ -342,7 +342,6 @@ SCENARIO("parse RTCP packets", "[parser][rtcp]")
auto rIt = rr->Begin(); auto rIt = rr->Begin();
auto rReport = *rIt; auto rReport = *rIt;
ssrc = 0x01932db4; ssrc = 0x01932db4;
auto fractionLost = 0; auto fractionLost = 0;
auto totalLost = 1; auto totalLost = 1;
......
#include "common.hpp"
#include "include/catch.hpp" #include "include/catch.hpp"
#include "include/helpers.hpp" #include "include/helpers.hpp"
#include "common.hpp"
#include "RTC/RtpPacket.hpp"
#include "RTC/RtpDictionaries.hpp" #include "RTC/RtpDictionaries.hpp"
#include <map> #include "RTC/RtpPacket.hpp"
#include <cstring> // std::memcmp() #include <cstring> // std::memcmp()
#include <map>
using namespace RTC; using namespace RTC;
...@@ -182,7 +182,8 @@ SCENARIO("parse RTP packets", "[parser][rtp]") ...@@ -182,7 +182,8 @@ SCENARIO("parse RTP packets", "[parser][rtp]")
REQUIRE(clonedPacket->ReadAbsSendTime(&absSendTime) == true); REQUIRE(clonedPacket->ReadAbsSendTime(&absSendTime) == true);
REQUIRE(absSendTime == 0x65341e); REQUIRE(absSendTime == 0x65341e);
REQUIRE(std::memcmp(clonedPacket->GetPayload(), packet->GetPayload(), packet->GetPayloadLength()) == 0); REQUIRE(
std::memcmp(clonedPacket->GetPayload(), packet->GetPayload(), packet->GetPayloadLength()) == 0);
delete clonedPacket; delete clonedPacket;
} }
......
#include "common.hpp"
#include "include/catch.hpp" #include "include/catch.hpp"
#include "include/helpers.hpp" #include "include/helpers.hpp"
#include "common.hpp"
#include "RTC/RtpPacket.hpp" #include "RTC/RtpPacket.hpp"
#include "RTC/RtpStream.hpp" #include "RTC/RtpStream.hpp"
#include "RTC/RtpStreamRecv.hpp" #include "RTC/RtpStreamRecv.hpp"
...@@ -10,8 +10,7 @@ using namespace RTC; ...@@ -10,8 +10,7 @@ using namespace RTC;
SCENARIO("receive RTP packets and trigger NACK", "[rtp][rtpstream]") SCENARIO("receive RTP packets and trigger NACK", "[rtp][rtpstream]")
{ {
class RtpStreamRecvListener : class RtpStreamRecvListener : public RtpStreamRecv::Listener
public RtpStreamRecv::Listener
{ {
public: public:
virtual void OnRtpStreamDied(RTC::RtpStream* rtpStream) override virtual void OnRtpStreamDied(RTC::RtpStream* rtpStream) override
...@@ -26,7 +25,8 @@ SCENARIO("receive RTP packets and trigger NACK", "[rtp][rtpstream]") ...@@ -26,7 +25,8 @@ SCENARIO("receive RTP packets and trigger NACK", "[rtp][rtpstream]")
{ {
} }
virtual void OnRtpStreamRecvNackRequired(RTC::RtpStreamRecv* rtpStream, const std::vector<uint16_t>& seqNumbers) override virtual void OnRtpStreamRecvNackRequired(
RTC::RtpStreamRecv* rtpStream, const std::vector<uint16_t>& seqNumbers) override
{ {
INFO("NACK required"); INFO("NACK required");
......
#include "include/catch.hpp"
#include "common.hpp" #include "common.hpp"
#include <vector> #include "include/catch.hpp"
#include "RTC/SeqManager.hpp" #include "RTC/SeqManager.hpp"
#include <vector>
using namespace RTC; using namespace RTC;
struct TestSeqManagerInput struct TestSeqManagerInput
{ {
TestSeqManagerInput(uint16_t input, uint16_t output, bool sync=false, bool drop=false) TestSeqManagerInput(uint16_t input, uint16_t output, bool sync = false, bool drop = false)
: input(input), output(output), sync(sync), drop(drop) : input(input), output(output), sync(sync), drop(drop)
{} {
}
uint16_t input{ 0 }; uint16_t input{ 0 };
uint16_t output{ 0 }; uint16_t output{ 0 };
......
#define CATCH_CONFIG_RUNNER #define CATCH_CONFIG_RUNNER
#include "include/catch.hpp"
#include "Settings.hpp"
#include "LogLevel.hpp"
#include "Logger.hpp"
#include "DepLibUV.hpp" #include "DepLibUV.hpp"
#include "DepOpenSSL.hpp" #include "DepOpenSSL.hpp"
#include "LogLevel.hpp"
#include "Logger.hpp"
#include "Settings.hpp"
#include "Utils.hpp" #include "Utils.hpp"
#include "include/catch.hpp"
#include <string> #include <string>
static void init(); static void init();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论