From a2c6ea09b0383bb2e8af106b8f17fabae3ae961b Mon Sep 17 00:00:00 2001 From: "bjornv@google.com" Date: Tue, 27 Sep 2011 08:04:45 +0000 Subject: [PATCH] Removed a segmentation fault error when processing near_file only. Review URL: http://webrtc-codereview.appspot.com/174001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@650 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../main/test/process_test/process_test.cc | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/modules/audio_processing/main/test/process_test/process_test.cc b/src/modules/audio_processing/main/test/process_test/process_test.cc index c24d822e0..eb3174c1f 100644 --- a/src/modules/audio_processing/main/test/process_test/process_test.cc +++ b/src/modules/audio_processing/main/test/process_test/process_test.cc @@ -482,13 +482,6 @@ void void_main(int argc, char* argv[]) { << aecm_echo_path_out_filename; } - enum Events { - kInitializeEvent, - kRenderEvent, - kCaptureEvent, - kResetEventDeprecated - }; - int16_t event = 0; size_t read_count = 0; int reverse_count = 0; int primary_count = 0; @@ -666,6 +659,13 @@ void void_main(int argc, char* argv[]) { ASSERT_TRUE(feof(pb_file)); } else { + enum Events { + kInitializeEvent, + kRenderEvent, + kCaptureEvent, + kResetEventDeprecated + }; + int16_t event = 0; while (simulating || feof(event_file) == 0) { std::ostringstream trace_stream; trace_stream << "Processed frames: " << reverse_count << " (reverse), " @@ -778,10 +778,6 @@ void void_main(int argc, char* argv[]) { } if (simulating) { if (read_count != near_frame._payloadDataLengthInSamples) { - // Read an equal amount from the far file to avoid errors due to - // not reaching end-of-file. - EXPECT_EQ(0, fseek(far_file, read_count * sizeof(WebRtc_Word16), - SEEK_CUR)); break; // This is expected. }