diff --git a/modules/audio_processing/main/test/process_test/Android.mk b/modules/audio_processing/main/test/process_test/Android.mk index 269c689681..23080aab23 100644 --- a/modules/audio_processing/main/test/process_test/Android.mk +++ b/modules/audio_processing/main/test/process_test/Android.mk @@ -42,7 +42,7 @@ LOCAL_SHARED_LIBRARIES := \ libstlport \ libwebrtc_audio_preprocessing -LOCAL_MODULE:= webrtc-apmtest +LOCAL_MODULE:= webrtc_apm_process_test include external/stlport/libstlport.mk include $(BUILD_EXECUTABLE) diff --git a/modules/audio_processing/main/test/unit_test/Android.mk b/modules/audio_processing/main/test/unit_test/Android.mk new file mode 100644 index 0000000000..b2029cfb4d --- /dev/null +++ b/modules/audio_processing/main/test/unit_test/Android.mk @@ -0,0 +1,49 @@ +# Copyright (c) 2011 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. + +LOCAL_PATH:= $(call my-dir) + +# apm test app + +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := tests +LOCAL_CPP_EXTENSION := .cc +LOCAL_SRC_FILES:= \ + unit_test.cc + +# Flags passed to both C and C++ files. +LOCAL_CFLAGS := \ + '-DWEBRTC_TARGET_PC' \ + '-DWEBRTC_LINUX' \ + '-DWEBRTC_THREAD_RR' \ + '-DWEBRTC_ANDROID' \ + '-DANDROID' + +LOCAL_CPPFLAGS := +LOCAL_LDFLAGS := +LOCAL_C_INCLUDES := \ + external/gtest/include \ + $(LOCAL_PATH)/../../../../../system_wrappers/interface \ + $(LOCAL_PATH)/../../../../../common_audio/signal_processing_library/main/interface \ + $(LOCAL_PATH)/../../interface \ + $(LOCAL_PATH)/../../../../interface \ + $(LOCAL_PATH)/../../../../.. + +LOCAL_STATIC_LIBRARIES := \ + libgtest + +LOCAL_SHARED_LIBRARIES := \ + libutils \ + libstlport \ + libwebrtc_audio_preprocessing + +LOCAL_MODULE:= webrtc_apm_unit_test + +include external/stlport/libstlport.mk +include $(BUILD_EXECUTABLE) diff --git a/modules/audio_processing/main/test/unit_test/unit_test.cc b/modules/audio_processing/main/test/unit_test/unit_test.cc index 22ab417c94..eccd6ce101 100644 --- a/modules/audio_processing/main/test/unit_test/unit_test.cc +++ b/modules/audio_processing/main/test/unit_test/unit_test.cc @@ -10,15 +10,29 @@ #include "unit_test.h" +#include "tick_util.h" +#include "cpu_features_wrapper.h" #include "event_wrapper.h" #include "module_common_types.h" #include "thread_wrapper.h" #include "trace.h" #include "signal_processing_library.h" - #include "audio_processing.h" -namespace webrtc { +using webrtc::AudioProcessing; +using webrtc::AudioFrame; +using webrtc::GainControl; +using webrtc::NoiseSuppression; +using webrtc::EchoCancellation; +using webrtc::TickInterval; +using webrtc::TickTime; +using webrtc::EventWrapper; +using webrtc::Trace; +using webrtc::LevelEstimator; +using webrtc::EchoCancellation; +using webrtc::EchoControlMobile; +using webrtc::VoiceDetection; + namespace { // If false, this will write out a new statistics file. @@ -465,7 +479,7 @@ TEST_F(ApmTest, Process) { sizeof(WebRtc_Word16), render_audio._payloadDataLengthInSamples * 2, far_file_); - if (read_count != + if (read_count != static_cast (render_audio._payloadDataLengthInSamples * 2)) { break; // This is expected. @@ -1011,4 +1025,3 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -} diff --git a/modules/audio_processing/main/test/unit_test/unit_test.h b/modules/audio_processing/main/test/unit_test/unit_test.h index a68083b3d1..6de3bf916a 100644 --- a/modules/audio_processing/main/test/unit_test/unit_test.h +++ b/modules/audio_processing/main/test/unit_test/unit_test.h @@ -14,9 +14,9 @@ #include namespace webrtc { - class AudioProcessing; class AudioFrame; +} class ApmTest : public ::testing::Test { protected: @@ -28,9 +28,8 @@ class ApmTest : public ::testing::Test { FILE* far_file_; FILE* near_file_; FILE* stat_file_; - AudioFrame* frame_; - AudioFrame* reverse_frame_; + webrtc::AudioFrame* frame_; + webrtc::AudioFrame* reverse_frame_; }; -} // namespace webrtc #endif // WEBRTC_MODULES_AUDIO_PROCESSING_MAIN_TEST_UNIT_TEST_UNIT_TEST_H_