Compile-out functions only used by the bit-exact test.
Causes errors on platforms where the test is unused.
TBR=bjornv
Review URL: https://webrtc-codereview.appspot.com/4869004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5207 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_processing/test/audio_processing_unittest.cc b/webrtc/modules/audio_processing/test/audio_processing_unittest.cc
index fffc498..6be12c2 100644
--- a/webrtc/modules/audio_processing/test/audio_processing_unittest.cc
+++ b/webrtc/modules/audio_processing/test/audio_processing_unittest.cc
@@ -113,21 +113,6 @@
}
}
-template <class T>
-T AbsValue(T a) {
- return a > 0 ? a: -a;
-}
-
-int16_t MaxAudioFrame(const AudioFrame& frame) {
- const int length = frame.samples_per_channel_ * frame.num_channels_;
- int16_t max_data = AbsValue(frame.data_[0]);
- for (int i = 1; i < length; i++) {
- max_data = std::max(max_data, AbsValue(frame.data_[i]));
- }
-
- return max_data;
-}
-
bool FrameDataAreEqual(const AudioFrame& frame1, const AudioFrame& frame2) {
if (frame1.samples_per_channel_ !=
frame2.samples_per_channel_) {
@@ -145,6 +130,23 @@
return true;
}
+#ifdef WEBRTC_AUDIOPROC_BIT_EXACT
+// These functions are only used by the bit-exact test.
+template <class T>
+T AbsValue(T a) {
+ return a > 0 ? a: -a;
+}
+
+int16_t MaxAudioFrame(const AudioFrame& frame) {
+ const int length = frame.samples_per_channel_ * frame.num_channels_;
+ int16_t max_data = AbsValue(frame.data_[0]);
+ for (int i = 1; i < length; i++) {
+ max_data = std::max(max_data, AbsValue(frame.data_[i]));
+ }
+
+ return max_data;
+}
+
void TestStats(const AudioProcessing::Statistic& test,
const webrtc::audioproc::Test::Statistic& reference) {
EXPECT_EQ(reference.instant(), test.instant);
@@ -196,6 +198,7 @@
delete [] array;
fclose(file);
}
+#endif // WEBRTC_AUDIOPROC_BIT_EXACT
struct ThreadData {
ThreadData(int thread_num_, AudioProcessing* ap_)