diff --git a/webrtc/voice_engine/include/mock/mock_voe_connection_observer.h b/webrtc/voice_engine/include/mock/mock_voe_connection_observer.h index 12ca63956a..2d3c5e845a 100644 --- a/webrtc/voice_engine/include/mock/mock_voe_connection_observer.h +++ b/webrtc/voice_engine/include/mock/mock_voe_connection_observer.h @@ -13,6 +13,8 @@ #include "voice_engine/include/voe_network.h" +#include "testing/gmock/include/gmock/gmock.h" + namespace webrtc { class MockVoeConnectionObserver : public VoEConnectionObserver { diff --git a/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h b/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h index 77d8305621..22fb541f00 100644 --- a/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h +++ b/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h @@ -31,14 +31,10 @@ #include "voice_engine/include/voe_rtp_rtcp.h" #include "voice_engine/include/voe_video_sync.h" #include "voice_engine/include/voe_volume_control.h" -#include "voice_engine/test/auto_test/voe_test_defines.h" +#include "webrtc/voice_engine/test/auto_test/voe_test_common.h" -// TODO(qhogpat): Remove these undefs once the clashing macros are gone. -#undef TEST -#undef ASSERT_TRUE -#undef ASSERT_FALSE -#include "gtest/gtest.h" -#include "gmock/gmock.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" // This convenient fixture sets up all voice engine interfaces automatically for // use by testing subclasses. It allocates each interface and releases it once diff --git a/webrtc/voice_engine/test/auto_test/standard/codec_test.cc b/webrtc/voice_engine/test/auto_test/standard/codec_test.cc index d861452034..50c1f2fb63 100644 --- a/webrtc/voice_engine/test/auto_test/standard/codec_test.cc +++ b/webrtc/voice_engine/test/auto_test/standard/codec_test.cc @@ -9,7 +9,6 @@ */ #include "after_streaming_fixture.h" -#include "voe_test_defines.h" #include "voice_engine_defines.h" class CodecTest : public AfterStreamingFixture { diff --git a/webrtc/voice_engine/test/auto_test/standard/hardware_test.cc b/webrtc/voice_engine/test/auto_test/standard/hardware_test.cc index d026f516ca..1d9dfa2704 100644 --- a/webrtc/voice_engine/test/auto_test/standard/hardware_test.cc +++ b/webrtc/voice_engine/test/auto_test/standard/hardware_test.cc @@ -10,7 +10,6 @@ #include "after_streaming_fixture.h" #include "modules/audio_device/include/audio_device.h" -#include "voe_test_defines.h" class HardwareTest : public AfterStreamingFixture { }; diff --git a/webrtc/voice_engine/test/auto_test/voe_cpu_test.cc b/webrtc/voice_engine/test/auto_test/voe_cpu_test.cc index 45b1d7fae1..0836e8e3c7 100644 --- a/webrtc/voice_engine/test/auto_test/voe_cpu_test.cc +++ b/webrtc/voice_engine/test/auto_test/voe_cpu_test.cc @@ -20,6 +20,7 @@ #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/test/channel_transport/include/channel_transport.h" +#include "webrtc/voice_engine/test/auto_test/voe_test_defines.h" using namespace webrtc; using namespace test; diff --git a/webrtc/voice_engine/test/auto_test/voe_extended_test.cc b/webrtc/voice_engine/test/auto_test/voe_extended_test.cc index 90d12d6b39..04628dacf8 100644 --- a/webrtc/voice_engine/test/auto_test/voe_extended_test.cc +++ b/webrtc/voice_engine/test/auto_test/voe_extended_test.cc @@ -16,6 +16,7 @@ #include "webrtc/test/testsupport/fileutils.h" #include "webrtc/voice_engine/voice_engine_defines.h" +#include "webrtc/voice_engine/test/auto_test/voe_test_defines.h" #if defined(_WIN32) #include diff --git a/webrtc/voice_engine/test/auto_test/voe_standard_test.cc b/webrtc/voice_engine/test/auto_test/voe_standard_test.cc index 9977e98a88..06e75f26b2 100644 --- a/webrtc/voice_engine/test/auto_test/voe_standard_test.cc +++ b/webrtc/voice_engine/test/auto_test/voe_standard_test.cc @@ -20,6 +20,7 @@ #include "voice_engine/test/auto_test/voe_cpu_test.h" #include "voice_engine/test/auto_test/voe_extended_test.h" #include "voice_engine/test/auto_test/voe_stress_test.h" +#include "voice_engine/test/auto_test/voe_test_defines.h" #include "voice_engine/test/auto_test/voe_unit_test.h" #include "voice_engine/voice_engine_defines.h" @@ -256,7 +257,7 @@ VoETestManager::VoETestManager() voe_file_(0), voe_hardware_(0), voe_network_(0), -#ifdef _TEST_NETEQ_STATS_ +#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API voe_neteq_stats_(NULL), #endif voe_rtp_rtcp_(0), @@ -322,7 +323,7 @@ void VoETestManager::GetInterfaces() { #ifdef _TEST_CALL_REPORT_ voe_call_report_ = VoECallReport::GetInterface(voice_engine_); #endif -#ifdef _TEST_NETEQ_STATS_ +#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API voe_neteq_stats_ = VoENetEqStats::GetInterface(voice_engine_); #endif } @@ -389,7 +390,7 @@ int VoETestManager::ReleaseInterfaces() { voe_call_report_ = NULL; } #endif -#ifdef _TEST_NETEQ_STATS_ +#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API if (voe_neteq_stats_) { voe_neteq_stats_->Release(); voe_neteq_stats_ = NULL; diff --git a/webrtc/voice_engine/test/auto_test/voe_standard_test.h b/webrtc/voice_engine/test/auto_test/voe_standard_test.h index b64a7920c9..df03e63b3e 100644 --- a/webrtc/voice_engine/test/auto_test/voe_standard_test.h +++ b/webrtc/voice_engine/test/auto_test/voe_standard_test.h @@ -22,7 +22,7 @@ #include "voe_errors.h" #include "voe_file.h" #include "voe_rtp_rtcp.h" -#include "voe_test_defines.h" +#include "voe_test_common.h" #include "voe_test_interface.h" #ifdef WEBRTC_VOICE_ENGINE_CALL_REPORT_API #include "voe_call_report.h" @@ -47,7 +47,7 @@ #include "voe_volume_control.h" #endif -#ifdef _TEST_NETEQ_STATS_ +#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API namespace webrtc { class CriticalSectionWrapper; class ThreadWrapper; @@ -199,11 +199,10 @@ class VoETestManager { return voe_call_report_; } -#ifdef _TEST_NETEQ_STATS_ +#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API VoENetEqStats* NetEqStatsPtr() const { return voe_neteq_stats_; } - #endif private: @@ -219,7 +218,7 @@ class VoETestManager { VoEFile* voe_file_; VoEHardware* voe_hardware_; VoENetwork* voe_network_; -#ifdef _TEST_NETEQ_STATS_ +#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API VoENetEqStats* voe_neteq_stats_; #endif VoERTP_RTCP* voe_rtp_rtcp_; diff --git a/webrtc/voice_engine/test/auto_test/voe_stress_test.cc b/webrtc/voice_engine/test/auto_test/voe_stress_test.cc index be8e42c12e..3c0bc8a830 100644 --- a/webrtc/voice_engine/test/auto_test/voe_stress_test.cc +++ b/webrtc/voice_engine/test/auto_test/voe_stress_test.cc @@ -29,6 +29,7 @@ #include "webrtc/system_wrappers/interface/thread_wrapper.h" #include "webrtc/test/channel_transport/include/channel_transport.h" #include "webrtc/voice_engine/test/auto_test/voe_standard_test.h" +#include "webrtc/voice_engine/test/auto_test/voe_test_defines.h" #include "webrtc/voice_engine/voice_engine_defines.h" // defines build macros using namespace webrtc; diff --git a/webrtc/voice_engine/test/auto_test/voe_test_common.h b/webrtc/voice_engine/test/auto_test/voe_test_common.h new file mode 100644 index 0000000000..55787adada --- /dev/null +++ b/webrtc/voice_engine/test/auto_test/voe_test_common.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. + * + * 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. + */ + +#ifndef WEBRTC_VOICE_ENGINE_VOE_TEST_COMMON_H_ +#define WEBRTC_VOICE_ENGINE_VOE_TEST_COMMON_H_ + +#ifdef WEBRTC_ANDROID +#include +#define ANDROID_LOG_TAG "VoiceEngine Auto Test" +#define TEST_LOG(...) \ + __android_log_print(ANDROID_LOG_DEBUG, ANDROID_LOG_TAG, __VA_ARGS__) +#define TEST_LOG_ERROR(...) \ + __android_log_print(ANDROID_LOG_ERROR, ANDROID_LOG_TAG, __VA_ARGS__) +#define TEST_LOG_FLUSH +#else +#define TEST_LOG printf +#define TEST_LOG_ERROR printf +#define TEST_LOG_FLUSH fflush(NULL) +#endif + +// Read WEBRTC_VOICE_ENGINE_XXX_API compiler flags +#include "webrtc/engine_configurations.h" + +// Time in ms to test each packet size for each codec +#define CODEC_TEST_TIME 400 + +#endif // WEBRTC_VOICE_ENGINE_VOE_TEST_COMMON_H_ diff --git a/webrtc/voice_engine/test/auto_test/voe_test_defines.h b/webrtc/voice_engine/test/auto_test/voe_test_defines.h index e71f3cfe8c..98297c9b41 100644 --- a/webrtc/voice_engine/test/auto_test/voe_test_defines.h +++ b/webrtc/voice_engine/test/auto_test/voe_test_defines.h @@ -11,23 +11,11 @@ #ifndef WEBRTC_VOICE_ENGINE_VOE_TEST_DEFINES_H #define WEBRTC_VOICE_ENGINE_VOE_TEST_DEFINES_H +#include "webrtc/voice_engine/test/auto_test/voe_test_common.h" + // Read WEBRTC_VOICE_ENGINE_XXX_API compiler flags #include "engine_configurations.h" -#ifdef WEBRTC_ANDROID -#include -#define ANDROID_LOG_TAG "VoiceEngine Auto Test" -#define TEST_LOG(...) \ - __android_log_print(ANDROID_LOG_DEBUG, ANDROID_LOG_TAG, __VA_ARGS__) -#define TEST_LOG_ERROR(...) \ - __android_log_print(ANDROID_LOG_ERROR, ANDROID_LOG_TAG, __VA_ARGS__) -#define TEST_LOG_FLUSH -#else -#define TEST_LOG printf -#define TEST_LOG_ERROR printf -#define TEST_LOG_FLUSH fflush(NULL) -#endif - // Select the tests to execute, list order below is same as they will be // executed. Note that, all settings below will be overriden by sub-API // settings in engine_configurations.h. @@ -102,9 +90,6 @@ #define _INSTRUMENTATION_TESTING_ #endif -// Time in ms to test each packet size for each codec -#define CODEC_TEST_TIME 400 - #define MARK() TEST_LOG("."); fflush(NULL); // Add test marker #define ANL() TEST_LOG("\n") // Add New Line #define AOK() TEST_LOG("[Test is OK]"); fflush(NULL); // Add OK diff --git a/webrtc/voice_engine/test/auto_test/voe_unit_test.cc b/webrtc/voice_engine/test/auto_test/voe_unit_test.cc index 94656f598d..bc03446558 100644 --- a/webrtc/voice_engine/test/auto_test/voe_unit_test.cc +++ b/webrtc/voice_engine/test/auto_test/voe_unit_test.cc @@ -22,6 +22,7 @@ #include "webrtc/system_wrappers/interface/sleep.h" #include "webrtc/test/testsupport/fileutils.h" #include "webrtc/voice_engine/voice_engine_defines.h" +#include "webrtc/voice_engine/test/auto_test/voe_test_defines.h" #include "webrtc/voice_engine/test/auto_test/fakes/fake_media_process.h" using namespace webrtc;