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_CALL_REPORT_
32 #define _TEST_VIDEO_SYNC_
33 #define _TEST_ENCRYPT_
34 #define _TEST_NETEQ_STATS_
37 #define TESTED_AUDIO_LAYER kAudioPlatformDefault
38 //#define TESTED_AUDIO_LAYER kAudioLinuxPulse
40 // #define _ENABLE_VISUAL_LEAK_DETECTOR_ // Enables VLD to find memory leaks
41 // #define _ENABLE_IPV6_TESTS_ // Enables IPv6 tests in network xtest
42 // #define _USE_EXTENDED_TRACE_ // Adds unique trace files for extended test
43 // #define _MEMORY_TEST_
45 // Enable this when running instrumentation of some kind to exclude tests
46 // that will not pass due to slowed down execution.
47 // #define _INSTRUMENTATION_TESTING_
49 // Exclude (override) API tests given preprocessor settings in
50 // engine_configurations.h
51 #ifndef WEBRTC_VOICE_ENGINE_CODEC_API
54 #ifndef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
57 #ifndef WEBRTC_VOICE_ENGINE_DTMF_API
60 #ifndef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
61 #undef _TEST_RTP_RTCP_
63 #ifndef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
64 #undef _TEST_AUDIO_PROCESSING_
66 #ifndef WEBRTC_VOICE_ENGINE_FILE_API
69 #ifndef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
70 #undef _TEST_VIDEO_SYNC_
72 #ifndef WEBRTC_VOICE_ENGINE_ENCRYPTION_API
75 #ifndef WEBRTC_VOICE_ENGINE_HARDWARE_API
76 #undef _TEST_HARDWARE_
78 #ifndef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
81 #ifndef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
82 #undef _TEST_NETEQ_STATS_
84 #ifndef WEBRTC_VOICE_ENGINE_CALL_REPORT_API
85 #undef _TEST_CALL_REPORT_
88 // Some parts can cause problems while running Insure
90 #define _INSTRUMENTATION_TESTING_
93 #define MARK() TEST_LOG("."); fflush(NULL); // Add test marker
94 #define ANL() TEST_LOG("\n") // Add New Line
95 #define AOK() TEST_LOG("[Test is OK]"); fflush(NULL); // Add OK
99 TEST_LOG("Press any key to continue..."); \
106 TEST_LOG("Continuing (pause not supported)\n"); \
112 TEST_LOG("Testing: %s", #s); \
115 #ifdef _INSTRUMENTATION_TESTING_
116 // Don't stop execution if error occurs
117 #define TEST_MUSTPASS(expr) \
121 TEST_LOG_ERROR("Error at line:%i, %s \n",__LINE__, #expr); \
122 TEST_LOG_ERROR("Error code: %i\n",voe_base_->LastError()); \
125 #define TEST_ERROR(code) \
127 int err = voe_base_->LastError(); \
130 TEST_LOG_ERROR("Invalid error code (%d, should be %d) at line %d\n",
131 code, err, __LINE__);
135 #define ASSERT_TRUE(expr) TEST_MUSTPASS(!(expr))
136 #define ASSERT_FALSE(expr) TEST_MUSTPASS(expr)
137 #define TEST_MUSTFAIL(expr) TEST_MUSTPASS(!((expr) == -1))
138 #define TEST_MUSTPASS(expr) \
142 TEST_LOG_ERROR("\nError at line:%i, %s \n",__LINE__, #expr); \
143 TEST_LOG_ERROR("Error code: %i\n", voe_base_->LastError()); \
148 #define TEST_ERROR(code) \
150 int err = voe_base_->LastError(); \
153 TEST_LOG_ERROR("Invalid error code (%d, should be %d) at line %d\n", \
154 err, code, __LINE__); \
159 #endif // #ifdef _INSTRUMENTATION_TESTING_
162 TEST_LOG("\n>>> Excluding test at line: %i <<<\n\n",__LINE__); \
165 #define INCOMPLETE() \
167 TEST_LOG("\n>>> Incomplete test at line: %i <<<\n\n",__LINE__); \
170 #endif // WEBRTC_VOICE_ENGINE_VOE_TEST_DEFINES_H