| 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 0da4d640f3d905dd514574785c32f687ac531e60..91ca606d65bbeb0acf9eabd01ff7d0f044b47318 100644
|
| --- a/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
|
| +++ b/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
|
| @@ -19,17 +19,21 @@
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| #include "webrtc/modules/audio_coding/neteq/mock/mock_audio_decoder.h"
|
| +#include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h"
|
| +#include "webrtc/modules/audio_coding/codecs/mock/mock_audio_decoder_factory.h"
|
|
|
| namespace webrtc {
|
|
|
| TEST(DecoderDatabase, CreateAndDestroy) {
|
| - DecoderDatabase db;
|
| + std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
|
| + DecoderDatabase db(std::move(factory));
|
| EXPECT_EQ(0, db.Size());
|
| EXPECT_TRUE(db.Empty());
|
| }
|
|
|
| TEST(DecoderDatabase, InsertAndRemove) {
|
| - DecoderDatabase db;
|
| + std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
|
| + DecoderDatabase db(std::move(factory));
|
| const uint8_t kPayloadType = 0;
|
| const std::string kCodecName = "Robert\'); DROP TABLE Students;";
|
| EXPECT_EQ(
|
| @@ -43,7 +47,8 @@ TEST(DecoderDatabase, InsertAndRemove) {
|
| }
|
|
|
| TEST(DecoderDatabase, GetDecoderInfo) {
|
| - DecoderDatabase db;
|
| + std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
|
| + DecoderDatabase db(std::move(factory));
|
| const uint8_t kPayloadType = 0;
|
| const std::string kCodecName = "Robert\'); DROP TABLE Students;";
|
| EXPECT_EQ(
|
| @@ -61,7 +66,8 @@ TEST(DecoderDatabase, GetDecoderInfo) {
|
| }
|
|
|
| TEST(DecoderDatabase, GetRtpPayloadType) {
|
| - DecoderDatabase db;
|
| + std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
|
| + DecoderDatabase db(std::move(factory));
|
| const uint8_t kPayloadType = 0;
|
| const std::string kCodecName = "Robert\'); DROP TABLE Students;";
|
| EXPECT_EQ(
|
| @@ -75,7 +81,7 @@ TEST(DecoderDatabase, GetRtpPayloadType) {
|
| }
|
|
|
| TEST(DecoderDatabase, GetDecoder) {
|
| - DecoderDatabase db;
|
| + DecoderDatabase db(CreateBuiltinAudioDecoderFactory());
|
| const uint8_t kPayloadType = 0;
|
| const std::string kCodecName = "Robert\'); DROP TABLE Students;";
|
| EXPECT_EQ(DecoderDatabase::kOK,
|
| @@ -86,7 +92,8 @@ TEST(DecoderDatabase, GetDecoder) {
|
| }
|
|
|
| TEST(DecoderDatabase, TypeTests) {
|
| - DecoderDatabase db;
|
| + std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
|
| + DecoderDatabase db(std::move(factory));
|
| const uint8_t kPayloadTypePcmU = 0;
|
| const uint8_t kPayloadTypeCng = 13;
|
| const uint8_t kPayloadTypeDtmf = 100;
|
| @@ -121,7 +128,8 @@ TEST(DecoderDatabase, TypeTests) {
|
| }
|
|
|
| TEST(DecoderDatabase, ExternalDecoder) {
|
| - DecoderDatabase db;
|
| + std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
|
| + DecoderDatabase db(std::move(factory));
|
| const uint8_t kPayloadType = 0;
|
| const std::string kCodecName = "Robert\'); DROP TABLE Students;";
|
| MockAudioDecoder decoder;
|
| @@ -150,7 +158,8 @@ TEST(DecoderDatabase, ExternalDecoder) {
|
| }
|
|
|
| TEST(DecoderDatabase, CheckPayloadTypes) {
|
| - DecoderDatabase db;
|
| + std::unique_ptr<MockAudioDecoderFactory> factory(new MockAudioDecoderFactory);
|
| + DecoderDatabase db(std::move(factory));
|
| // Load a number of payloads into the database. Payload types are 0, 1, ...,
|
| // while the decoder type is the same for all payload types (this does not
|
| // matter for the test).
|
| @@ -194,7 +203,7 @@ TEST(DecoderDatabase, CheckPayloadTypes) {
|
|
|
| // Test the methods for setting and getting active speech and CNG decoders.
|
| TEST(DecoderDatabase, IF_ISAC(ActiveDecoders)) {
|
| - DecoderDatabase db;
|
| + DecoderDatabase db(CreateBuiltinAudioDecoderFactory());
|
| // Load payload types.
|
| ASSERT_EQ(DecoderDatabase::kOK,
|
| db.RegisterPayload(0, NetEqDecoder::kDecoderPCMu, "pcmu"));
|
|
|