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

Side by Side Diff: webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc

Issue 1368843003: Don't link with audio codecs that we don't use (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add comment Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 EXPECT_EQ(DecoderDatabase::kOK, db.CheckPayloadTypes(packet_list)); 165 EXPECT_EQ(DecoderDatabase::kOK, db.CheckPayloadTypes(packet_list));
166 166
167 // Delete all packets. 167 // Delete all packets.
168 PacketList::iterator it = packet_list.begin(); 168 PacketList::iterator it = packet_list.begin();
169 while (it != packet_list.end()) { 169 while (it != packet_list.end()) {
170 delete packet_list.front(); 170 delete packet_list.front();
171 it = packet_list.erase(it); 171 it = packet_list.erase(it);
172 } 172 }
173 } 173 }
174 174
175 #if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)
176 #define IF_ISAC(x) x
177 #else
178 #define IF_ISAC(x) DISABLED_##x
179 #endif
180
175 // Test the methods for setting and getting active speech and CNG decoders. 181 // Test the methods for setting and getting active speech and CNG decoders.
176 TEST(DecoderDatabase, ActiveDecoders) { 182 TEST(DecoderDatabase, IF_ISAC(ActiveDecoders)) {
177 DecoderDatabase db; 183 DecoderDatabase db;
178 // Load payload types. 184 // Load payload types.
179 ASSERT_EQ(DecoderDatabase::kOK, db.RegisterPayload(0, kDecoderPCMu)); 185 ASSERT_EQ(DecoderDatabase::kOK, db.RegisterPayload(0, kDecoderPCMu));
180 ASSERT_EQ(DecoderDatabase::kOK, db.RegisterPayload(103, kDecoderISAC)); 186 ASSERT_EQ(DecoderDatabase::kOK, db.RegisterPayload(103, kDecoderISAC));
181 ASSERT_EQ(DecoderDatabase::kOK, db.RegisterPayload(13, kDecoderCNGnb)); 187 ASSERT_EQ(DecoderDatabase::kOK, db.RegisterPayload(13, kDecoderCNGnb));
182 // Verify that no decoders are active from the start. 188 // Verify that no decoders are active from the start.
183 EXPECT_EQ(NULL, db.GetActiveDecoder()); 189 EXPECT_EQ(NULL, db.GetActiveDecoder());
184 EXPECT_EQ(NULL, db.GetActiveCngDecoder()); 190 EXPECT_EQ(NULL, db.GetActiveCngDecoder());
185 191
186 // Set active speech codec. 192 // Set active speech codec.
(...skipping 28 matching lines...) Expand all
215 EXPECT_EQ(DecoderDatabase::kOK, db.Remove(13)); 221 EXPECT_EQ(DecoderDatabase::kOK, db.Remove(13));
216 EXPECT_EQ(NULL, db.GetActiveCngDecoder()); 222 EXPECT_EQ(NULL, db.GetActiveCngDecoder());
217 223
218 // Try to set non-existing codecs as active. 224 // Try to set non-existing codecs as active.
219 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, 225 EXPECT_EQ(DecoderDatabase::kDecoderNotFound,
220 db.SetActiveDecoder(17, &changed)); 226 db.SetActiveDecoder(17, &changed));
221 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, 227 EXPECT_EQ(DecoderDatabase::kDecoderNotFound,
222 db.SetActiveCngDecoder(17)); 228 db.SetActiveCngDecoder(17));
223 } 229 }
224 } // namespace webrtc 230 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/audio_decoder_unittest.cc ('k') | webrtc/modules/audio_coding/neteq/neteq.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698