Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_fec_unittest.cc

Issue 2260803002: Generalize FEC header formatting. (pt. 4) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Lint fix. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtp_fec_unittest.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_fec_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_fec_unittest.cc
index 9f6dee2be9c3bc378c2b4877f43293d599f8c701..1334cb7be2bdff6dc0455c4a30af451c1245d6bc 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_fec_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_fec_unittest.cc
@@ -18,6 +18,7 @@
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
#include "webrtc/modules/rtp_rtcp/source/fec_test_helper.h"
#include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h"
+#include "webrtc/modules/rtp_rtcp/source/ulpfec_header_reader_writer.h"
namespace webrtc {
@@ -46,6 +47,15 @@ void DeepCopyEveryNthPacket(const ForwardErrorCorrection::PacketList& src,
using ::testing::Types;
+// Subclass ForwardErrorCorrection to use gTest typed tests.
+class UlpfecForwardErrorCorrection : public ForwardErrorCorrection {
+ public:
+ UlpfecForwardErrorCorrection()
+ : ForwardErrorCorrection(
+ std::unique_ptr<FecHeaderReader>(new UlpfecHeaderReader()),
+ std::unique_ptr<FecHeaderWriter>(new UlpfecHeaderWriter())) {}
+};
+
template <typename ForwardErrorCorrectionType>
class RtpFecTest : public ::testing::Test {
protected:
@@ -86,15 +96,15 @@ class RtpFecTest : public ::testing::Test {
ForwardErrorCorrection::ReceivedPacketList received_packets_;
ForwardErrorCorrection::RecoveredPacketList recovered_packets_;
- int media_loss_mask_[ForwardErrorCorrection::kMaxMediaPackets];
- int fec_loss_mask_[ForwardErrorCorrection::kMaxMediaPackets];
+ int media_loss_mask_[kUlpfecMaxMediaPackets];
+ int fec_loss_mask_[kUlpfecMaxMediaPackets];
};
// Define gTest typed test to loop over both ULPFEC and FlexFEC.
// Since the tests now are parameterized, we need to access
// member variables using |this|, thereby enforcing runtime
// resolution.
-using FecTypes = Types<ForwardErrorCorrection>;
+using FecTypes = Types<UlpfecForwardErrorCorrection>;
TYPED_TEST_CASE(RtpFecTest, FecTypes);
TYPED_TEST(RtpFecTest, FecRecoveryNoLoss) {
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/producer_fec.cc ('k') | webrtc/modules/rtp_rtcp/source/ulpfec_header_reader_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698