2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #ifndef WEBRTC_VOICE_ENGINE_VOE_TEST_DEFINES_H
12 #define WEBRTC_VOICE_ENGINE_VOE_TEST_DEFINES_H
14 #include "webrtc/voice_engine/test/auto_test/voe_test_common.h"
16 // Read WEBRTC_VOICE_ENGINE_XXX_API compiler flags
17 #include "webrtc/engine_configurations.h"
19 // Select the tests to execute, list order below is same as they will be
20 // executed. Note that, all settings below will be overriden by sub-API
21 // settings in engine_configurations.h.
23 #define _TEST_RTP_RTCP_
24 #define _TEST_HARDWARE_
28 #define _TEST_AUDIO_PROCESSING_
30 #define _TEST_NETWORK_
31 #define _TEST_VIDEO_SYNC_
32 #define _TEST_NETEQ_STATS_
35 #define TESTED_AUDIO_LAYER kAudioPlatformDefault
36 //#define TESTED_AUDIO_LAYER kAudioLinuxPulse
38 // #define _ENABLE_VISUAL_LEAK_DETECTOR_ // Enables VLD to find memory leaks
39 // #define _ENABLE_IPV6_TESTS_ // Enables IPv6 tests in network xtest
40 // #define _USE_EXTENDED_TRACE_ // Adds unique trace files for extended test
41 // #define _MEMORY_TEST_
43 // Enable this when running instrumentation of some kind to exclude tests
44 // that will not pass due to slowed down execution.
45 // #define _INSTRUMENTATION_TESTING_
47 // Exclude (override) API tests given preprocessor settings in
48 // engine_configurations.h
49 #ifndef WEBRTC_VOICE_ENGINE_CODEC_API
52 #ifndef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
55 #ifndef WEBRTC_VOICE_ENGINE_DTMF_API
58 #ifndef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
59 #undef _TEST_RTP_RTCP_
61 #ifndef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
62 #undef _TEST_AUDIO_PROCESSING_
64 #ifndef WEBRTC_VOICE_ENGINE_FILE_API
67 #ifndef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
68 #undef _TEST_VIDEO_SYNC_
70 #ifndef WEBRTC_VOICE_ENGINE_HARDWARE_API
71 #undef _TEST_HARDWARE_
73 #ifndef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
76 #ifndef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
77 #undef _TEST_NETEQ_STATS_
80 // Some parts can cause problems while running Insure
82 #define _INSTRUMENTATION_TESTING_
85 #define MARK() TEST_LOG("."); fflush(NULL); // Add test marker
86 #define ANL() TEST_LOG("\n") // Add New Line
87 #define AOK() TEST_LOG("[Test is OK]"); fflush(NULL); // Add OK
91 TEST_LOG("Press any key to continue..."); \
98 TEST_LOG("Continuing (pause not supported)\n"); \
104 TEST_LOG("Testing: %s", #s); \
107 #ifdef _INSTRUMENTATION_TESTING_
108 // Don't stop execution if error occurs
109 #define TEST_MUSTPASS(expr) \
113 TEST_LOG_ERROR("Error at line:%i, %s \n",__LINE__, #expr); \
114 TEST_LOG_ERROR("Error code: %i\n",voe_base_->LastError()); \
117 #define TEST_ERROR(code) \
119 int err = voe_base_->LastError(); \
122 TEST_LOG_ERROR("Invalid error code (%d, should be %d) at line %d\n",
123 code, err, __LINE__);
127 #define ASSERT_TRUE(expr) TEST_MUSTPASS(!(expr))
128 #define ASSERT_FALSE(expr) TEST_MUSTPASS(expr)
129 #define TEST_MUSTFAIL(expr) TEST_MUSTPASS(!((expr) == -1))
130 #define TEST_MUSTPASS(expr) \
134 TEST_LOG_ERROR("\nError at line:%i, %s \n",__LINE__, #expr); \
135 TEST_LOG_ERROR("Error code: %i\n", voe_base_->LastError()); \
140 #define TEST_ERROR(code) \
142 int err = voe_base_->LastError(); \
145 TEST_LOG_ERROR("Invalid error code (%d, should be %d) at line %d\n", \
146 err, code, __LINE__); \
151 #endif // #ifdef _INSTRUMENTATION_TESTING_
154 TEST_LOG("\n>>> Excluding test at line: %i <<<\n\n",__LINE__); \
157 #define INCOMPLETE() \
159 TEST_LOG("\n>>> Incomplete test at line: %i <<<\n\n",__LINE__); \
162 #endif // WEBRTC_VOICE_ENGINE_VOE_TEST_DEFINES_H