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

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

Issue 2425223002: NetEq now works with packets as values, rather than pointers. (Closed)
Patch Set: Compare packets better in test. One more const. Created 4 years, 2 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/audio_coding/neteq/decoder_database_unittest.cc
diff --git a/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc b/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
index a23816e77043a62030859fdc1be17ba778f90ac7..6c3b6c9b94c91f11be615ab1abbf0978ee0c0e1e 100644
--- a/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
@@ -175,16 +175,15 @@ TEST(DecoderDatabase, CheckPayloadTypes) {
for (int i = 0; i < kNumPayloads + 1; ++i) {
// Create packet with payload type |i|. The last packet will have a payload
// type that is not registered in the decoder database.
- Packet* packet = new Packet;
- packet->payload_type = i;
- packet_list.push_back(packet);
+ Packet packet;
+ packet.payload_type = i;
+ packet_list.push_back(std::move(packet));
}
// Expect to return false, since the last packet is of an unknown type.
EXPECT_EQ(DecoderDatabase::kDecoderNotFound,
db.CheckPayloadTypes(packet_list));
- delete packet_list.back();
packet_list.pop_back(); // Remove the unknown one.
EXPECT_EQ(DecoderDatabase::kOK, db.CheckPayloadTypes(packet_list));
@@ -192,7 +191,6 @@ TEST(DecoderDatabase, CheckPayloadTypes) {
// Delete all packets.
PacketList::iterator it = packet_list.begin();
while (it != packet_list.end()) {
- delete packet_list.front();
it = packet_list.erase(it);
}
}
« no previous file with comments | « webrtc/modules/audio_coding/neteq/decoder_database.cc ('k') | webrtc/modules/audio_coding/neteq/mock/mock_packet_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698