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

Unified Diff: webrtc/modules/audio_coding/neteq/packet_buffer_unittest.cc

Issue 2290153002: NetEq: Change member variables for current RTP types to rtc::Optionals (Closed)
Patch Set: Updates after review Created 4 years, 4 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
« no previous file with comments | « webrtc/modules/audio_coding/neteq/packet_buffer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/packet_buffer_unittest.cc
diff --git a/webrtc/modules/audio_coding/neteq/packet_buffer_unittest.cc b/webrtc/modules/audio_coding/neteq/packet_buffer_unittest.cc
index 73dbd6203f81f48d7451afe9a8d08cdc997419ec..f1d2ad00464a928fa268157070617421f6fc82ae 100644
--- a/webrtc/modules/audio_coding/neteq/packet_buffer_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/packet_buffer_unittest.cc
@@ -174,16 +174,17 @@ TEST(PacketBuffer, InsertPacketList) {
}
MockDecoderDatabase decoder_database;
- uint8_t current_pt = 0xFF;
- uint8_t current_cng_pt = 0xFF;
+ rtc::Optional<uint8_t> current_pt;
+ rtc::Optional<uint8_t> current_cng_pt;
EXPECT_EQ(PacketBuffer::kOK, buffer.InsertPacketList(&list,
decoder_database,
&current_pt,
&current_cng_pt));
EXPECT_TRUE(list.empty()); // The PacketBuffer should have depleted the list.
EXPECT_EQ(10u, buffer.NumPacketsInBuffer());
- EXPECT_EQ(0, current_pt); // Current payload type changed to 0.
- EXPECT_EQ(0xFF, current_cng_pt); // CNG payload type not changed.
+ EXPECT_EQ(rtc::Optional<uint8_t>(0),
+ current_pt); // Current payload type changed to 0.
+ EXPECT_FALSE(current_cng_pt); // CNG payload type not changed.
buffer.Flush(); // Clean up.
@@ -212,16 +213,17 @@ TEST(PacketBuffer, InsertPacketListChangePayloadType) {
MockDecoderDatabase decoder_database;
- uint8_t current_pt = 0xFF;
- uint8_t current_cng_pt = 0xFF;
+ rtc::Optional<uint8_t> current_pt;
+ rtc::Optional<uint8_t> current_cng_pt;
EXPECT_EQ(PacketBuffer::kFlushed, buffer.InsertPacketList(&list,
decoder_database,
&current_pt,
&current_cng_pt));
EXPECT_TRUE(list.empty()); // The PacketBuffer should have depleted the list.
EXPECT_EQ(1u, buffer.NumPacketsInBuffer()); // Only the last packet.
- EXPECT_EQ(1, current_pt); // Current payload type changed to 0.
- EXPECT_EQ(0xFF, current_cng_pt); // CNG payload type not changed.
+ EXPECT_EQ(rtc::Optional<uint8_t>(1),
+ current_pt); // Current payload type changed to 1.
+ EXPECT_FALSE(current_cng_pt); // CNG payload type not changed.
buffer.Flush(); // Clean up.
@@ -341,8 +343,8 @@ TEST(PacketBuffer, Reordering) {
}
MockDecoderDatabase decoder_database;
- uint8_t current_pt = 0xFF;
- uint8_t current_cng_pt = 0xFF;
+ rtc::Optional<uint8_t> current_pt;
+ rtc::Optional<uint8_t> current_cng_pt;
EXPECT_EQ(PacketBuffer::kOK, buffer.InsertPacketList(&list,
decoder_database,
@@ -412,8 +414,8 @@ TEST(PacketBuffer, Failures) {
list.push_back(packet);
list.push_back(gen.NextPacket(payload_len)); // Valid packet.
MockDecoderDatabase decoder_database;
- uint8_t current_pt = 0xFF;
- uint8_t current_cng_pt = 0xFF;
+ rtc::Optional<uint8_t> current_pt;
+ rtc::Optional<uint8_t> current_cng_pt;
EXPECT_EQ(PacketBuffer::kInvalidPacket,
buffer->InsertPacketList(&list,
decoder_database,
« no previous file with comments | « webrtc/modules/audio_coding/neteq/packet_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698