OLD | NEW |
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 |
11 #include "webrtc/voice_engine/test/auto_test/voe_standard_test.h" | 11 #include "webrtc/voice_engine/test/auto_test/voe_standard_test.h" |
12 | 12 |
13 #include <assert.h> | 13 #include <assert.h> |
14 #include <stdio.h> | 14 #include <stdio.h> |
15 #include <string.h> | 15 #include <string.h> |
16 | 16 |
17 #include "webrtc/system_wrappers/include/event_wrapper.h" | 17 #include "webrtc/system_wrappers/include/event_wrapper.h" |
18 #include "webrtc/voice_engine/include/voe_neteq_stats.h" | 18 #include "webrtc/voice_engine/include/voe_neteq_stats.h" |
19 #include "webrtc/voice_engine/test/auto_test/automated_mode.h" | 19 #include "webrtc/voice_engine/test/auto_test/automated_mode.h" |
20 #include "webrtc/voice_engine/test/auto_test/voe_cpu_test.h" | 20 #include "webrtc/voice_engine/test/auto_test/voe_cpu_test.h" |
21 #include "webrtc/voice_engine/test/auto_test/voe_stress_test.h" | 21 #include "webrtc/voice_engine/test/auto_test/voe_stress_test.h" |
22 #include "webrtc/voice_engine/test/auto_test/voe_test_defines.h" | 22 #include "webrtc/voice_engine/test/auto_test/voe_test_defines.h" |
23 #include "webrtc/voice_engine/voice_engine_defines.h" | 23 #include "webrtc/voice_engine/voice_engine_defines.h" |
24 #include "webrtc/voice_engine_configurations.h" | 24 #include "webrtc/voice_engine_configurations.h" |
25 | 25 |
26 #ifndef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API | |
27 #error "Deprecated" | |
28 #endif | |
29 | |
30 DEFINE_bool(include_timing_dependent_tests, true, | 26 DEFINE_bool(include_timing_dependent_tests, true, |
31 "If true, we will include tests / parts of tests that are known " | 27 "If true, we will include tests / parts of tests that are known " |
32 "to break in slow execution environments (such as valgrind)."); | 28 "to break in slow execution environments (such as valgrind)."); |
33 DEFINE_bool(automated, false, | 29 DEFINE_bool(automated, false, |
34 "If true, we'll run the automated tests we have in noninteractive " | 30 "If true, we'll run the automated tests we have in noninteractive " |
35 "mode."); | 31 "mode."); |
36 | 32 |
37 using namespace webrtc; | 33 using namespace webrtc; |
38 | 34 |
39 namespace voetest { | 35 namespace voetest { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 89 |
94 VoETestManager::VoETestManager() | 90 VoETestManager::VoETestManager() |
95 : initialized_(false), | 91 : initialized_(false), |
96 voice_engine_(NULL), | 92 voice_engine_(NULL), |
97 voe_base_(0), | 93 voe_base_(0), |
98 voe_codec_(0), | 94 voe_codec_(0), |
99 voe_xmedia_(0), | 95 voe_xmedia_(0), |
100 voe_file_(0), | 96 voe_file_(0), |
101 voe_hardware_(0), | 97 voe_hardware_(0), |
102 voe_network_(0), | 98 voe_network_(0), |
103 #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API | |
104 voe_neteq_stats_(NULL), | 99 voe_neteq_stats_(NULL), |
105 #endif | |
106 voe_rtp_rtcp_(0), | 100 voe_rtp_rtcp_(0), |
107 voe_vsync_(0), | 101 voe_vsync_(0), |
108 voe_volume_control_(0), | 102 voe_volume_control_(0), |
109 voe_apm_(0) { | 103 voe_apm_(0) { |
110 } | 104 } |
111 | 105 |
112 VoETestManager::~VoETestManager() { | 106 VoETestManager::~VoETestManager() { |
113 } | 107 } |
114 | 108 |
115 bool VoETestManager::Init() { | 109 bool VoETestManager::Init() { |
(...skipping 29 matching lines...) Expand all Loading... |
145 printf("\nERROR: failed to set audio layer to use in " | 139 printf("\nERROR: failed to set audio layer to use in " |
146 "testing\n"); | 140 "testing\n"); |
147 } else { | 141 } else { |
148 printf("\nAudio layer %d will be used in testing\n", | 142 printf("\nAudio layer %d will be used in testing\n", |
149 TESTED_AUDIO_LAYER); | 143 TESTED_AUDIO_LAYER); |
150 } | 144 } |
151 } | 145 } |
152 #ifdef _TEST_XMEDIA_ | 146 #ifdef _TEST_XMEDIA_ |
153 voe_xmedia_ = VoEExternalMedia::GetInterface(voice_engine_); | 147 voe_xmedia_ = VoEExternalMedia::GetInterface(voice_engine_); |
154 #endif | 148 #endif |
155 #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API | |
156 voe_neteq_stats_ = VoENetEqStats::GetInterface(voice_engine_); | 149 voe_neteq_stats_ = VoENetEqStats::GetInterface(voice_engine_); |
157 #endif | |
158 } | 150 } |
159 } | 151 } |
160 | 152 |
161 int VoETestManager::ReleaseInterfaces() { | 153 int VoETestManager::ReleaseInterfaces() { |
162 bool releaseOK(true); | 154 bool releaseOK(true); |
163 | 155 |
164 if (voe_base_) { | 156 if (voe_base_) { |
165 voe_base_->Release(); | 157 voe_base_->Release(); |
166 voe_base_ = NULL; | 158 voe_base_ = NULL; |
167 } | 159 } |
(...skipping 30 matching lines...) Expand all Loading... |
198 if (voe_hardware_) { | 190 if (voe_hardware_) { |
199 voe_hardware_->Release(); | 191 voe_hardware_->Release(); |
200 voe_hardware_ = NULL; | 192 voe_hardware_ = NULL; |
201 } | 193 } |
202 #ifdef _TEST_XMEDIA_ | 194 #ifdef _TEST_XMEDIA_ |
203 if (voe_xmedia_) { | 195 if (voe_xmedia_) { |
204 voe_xmedia_->Release(); | 196 voe_xmedia_->Release(); |
205 voe_xmedia_ = NULL; | 197 voe_xmedia_ = NULL; |
206 } | 198 } |
207 #endif | 199 #endif |
208 #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API | |
209 if (voe_neteq_stats_) { | 200 if (voe_neteq_stats_) { |
210 voe_neteq_stats_->Release(); | 201 voe_neteq_stats_->Release(); |
211 voe_neteq_stats_ = NULL; | 202 voe_neteq_stats_ = NULL; |
212 } | 203 } |
213 #endif | |
214 if (false == VoiceEngine::Delete(voice_engine_)) { | 204 if (false == VoiceEngine::Delete(voice_engine_)) { |
215 TEST_LOG("\n\nVoiceEngine::Delete() failed. \n"); | 205 TEST_LOG("\n\nVoiceEngine::Delete() failed. \n"); |
216 releaseOK = false; | 206 releaseOK = false; |
217 } | 207 } |
218 | 208 |
219 return (releaseOK == true) ? 0 : -1; | 209 return (releaseOK == true) ? 0 : -1; |
220 } | 210 } |
221 | 211 |
222 int run_auto_test(TestType test_type) { | 212 int run_auto_test(TestType test_type) { |
223 assert(test_type != Standard); | 213 assert(test_type != Standard); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 google::AllowCommandLineReparsing(); | 317 google::AllowCommandLineReparsing(); |
328 google::ParseCommandLineFlags(&argc, &argv, true); | 318 google::ParseCommandLineFlags(&argc, &argv, true); |
329 | 319 |
330 if (FLAGS_automated) { | 320 if (FLAGS_automated) { |
331 return RunInAutomatedMode(); | 321 return RunInAutomatedMode(); |
332 } | 322 } |
333 | 323 |
334 return RunInManualMode(); | 324 return RunInManualMode(); |
335 } | 325 } |
336 #endif //#if !defined(WEBRTC_IOS) | 326 #endif //#if !defined(WEBRTC_IOS) |
OLD | NEW |