2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-04-12 11:02:38 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2011-12-21 13:34:18 +00:00
|
|
|
#include <string>
|
2011-07-07 08:21:25 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
2013-03-15 13:29:17 +00:00
|
|
|
#include "testing/gtest/include/gtest/gtest.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/main/test/APITest.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/main/test/EncodeDecodeTest.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/main/test/iSACTest.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/main/test/opus_test.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/main/test/TestAllCodecs.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/main/test/TestFEC.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/main/test/TestStereo.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/main/test/TestVADDTX.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/main/test/TwoWayCommunication.h"
|
|
|
|
|
#include "webrtc/system_wrappers/interface/trace.h"
|
|
|
|
|
#include "webrtc/test/testsupport/fileutils.h"
|
2013-08-02 16:53:47 +00:00
|
|
|
#include "webrtc/test/testsupport/gtest_disable.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-16 10:09:04 +00:00
|
|
|
using webrtc::Trace;
|
|
|
|
|
|
2012-06-18 13:35:52 +00:00
|
|
|
// This parameter is used to describe how to run the tests. It is normally
|
2013-08-27 07:33:51 +00:00
|
|
|
// set to 0, and all tests are run in quite mode.
|
|
|
|
|
#define ACM_TEST_MODE 0
|
2012-06-18 13:35:52 +00:00
|
|
|
|
2013-08-27 07:33:51 +00:00
|
|
|
TEST(AudioCodingModuleTest, TestAllCodecs) {
|
|
|
|
|
Trace::CreateTrace();
|
|
|
|
|
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
|
|
|
|
"acm_allcodecs_trace.txt").c_str());
|
2014-04-17 08:29:10 +00:00
|
|
|
webrtc::TestAllCodecs(ACM_TEST_MODE).Perform();
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::ReturnTrace();
|
|
|
|
|
}
|
2012-06-18 13:35:52 +00:00
|
|
|
|
2014-01-13 13:15:59 +00:00
|
|
|
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestEncodeDecode)) {
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::CreateTrace();
|
|
|
|
|
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
|
|
|
|
"acm_encodedecode_trace.txt").c_str());
|
2014-04-17 08:29:10 +00:00
|
|
|
webrtc::EncodeDecodeTest(ACM_TEST_MODE).Perform();
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::ReturnTrace();
|
|
|
|
|
}
|
2012-06-18 13:35:52 +00:00
|
|
|
|
2014-01-13 13:15:59 +00:00
|
|
|
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestFEC)) {
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::CreateTrace();
|
|
|
|
|
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
|
|
|
|
"acm_fec_trace.txt").c_str());
|
2014-04-17 08:29:10 +00:00
|
|
|
webrtc::TestFEC().Perform();
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::ReturnTrace();
|
|
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-01-13 13:15:59 +00:00
|
|
|
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestIsac)) {
|
2012-06-12 07:16:24 +00:00
|
|
|
Trace::CreateTrace();
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
|
|
|
|
"acm_isac_trace.txt").c_str());
|
2014-04-17 08:29:10 +00:00
|
|
|
webrtc::ISACTest(ACM_TEST_MODE).Perform();
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::ReturnTrace();
|
|
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-01-13 13:15:59 +00:00
|
|
|
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TwoWayCommunication)) {
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::CreateTrace();
|
|
|
|
|
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
|
|
|
|
"acm_twowaycom_trace.txt").c_str());
|
2014-04-17 08:29:10 +00:00
|
|
|
webrtc::TwoWayCommunication(ACM_TEST_MODE).Perform();
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::ReturnTrace();
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2014-01-13 13:15:59 +00:00
|
|
|
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestStereo)) {
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::CreateTrace();
|
|
|
|
|
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
|
|
|
|
"acm_stereo_trace.txt").c_str());
|
2014-04-17 08:29:10 +00:00
|
|
|
webrtc::TestStereo(ACM_TEST_MODE).Perform();
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::ReturnTrace();
|
|
|
|
|
}
|
2012-06-18 13:35:52 +00:00
|
|
|
|
2014-01-13 13:15:59 +00:00
|
|
|
TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(TestVADDTX)) {
|
2012-06-18 13:35:52 +00:00
|
|
|
Trace::CreateTrace();
|
|
|
|
|
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
2013-08-27 07:33:51 +00:00
|
|
|
"acm_vaddtx_trace.txt").c_str());
|
2014-04-17 08:29:10 +00:00
|
|
|
webrtc::TestVADDTX().Perform();
|
2012-06-18 13:35:52 +00:00
|
|
|
Trace::ReturnTrace();
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-15 13:29:17 +00:00
|
|
|
TEST(AudioCodingModuleTest, TestOpus) {
|
|
|
|
|
Trace::CreateTrace();
|
|
|
|
|
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
2013-08-27 07:33:51 +00:00
|
|
|
"acm_opus_trace.txt").c_str());
|
2014-04-17 08:29:10 +00:00
|
|
|
webrtc::OpusTest().Perform();
|
2013-03-15 13:29:17 +00:00
|
|
|
Trace::ReturnTrace();
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-27 07:33:51 +00:00
|
|
|
// The full API test is too long to run automatically on bots, but can be used
|
|
|
|
|
// for offline testing. User interaction is needed.
|
|
|
|
|
#ifdef ACM_TEST_FULL_API
|
|
|
|
|
TEST(AudioCodingModuleTest, TestAPI) {
|
|
|
|
|
Trace::CreateTrace();
|
|
|
|
|
Trace::SetTraceFile((webrtc::test::OutputPath() +
|
|
|
|
|
"acm_apitest_trace.txt").c_str());
|
2014-04-17 08:29:10 +00:00
|
|
|
webrtc::APITest().Perform();
|
2013-08-27 07:33:51 +00:00
|
|
|
Trace::ReturnTrace();
|
2012-06-12 07:16:24 +00:00
|
|
|
}
|
2013-08-27 07:33:51 +00:00
|
|
|
#endif
|