Remove temp files in audio_processing_unittest.cc.
These files are leaking, rapidly filling trybot disks.
BUG=4258
R=kjellander@webrtc.org
TBR=bjornv@webrtc.org
TEST=out/Debug/modules_unittests --gtest_filter=*AudioProcessingTest*Formats/0 && ls out
Review URL: https://webrtc-codereview.appspot.com/35979004
Cr-Commit-Position: refs/heads/master@{#8232}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8232 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 093c72e..d9ebe8e 100644
--- a/webrtc/modules/audio_processing/test/audio_processing_unittest.cc
+++ b/webrtc/modules/audio_processing/test/audio_processing_unittest.cc
@@ -271,6 +271,11 @@
return temp_filenames[filename];
}
+void ClearTempFiles() {
+ for (auto& kv : temp_filenames)
+ remove(kv.second.c_str());
+}
+
void OpenFileAndReadMessage(const std::string filename,
::google::protobuf::MessageLite* msg) {
FILE* file = fopen(filename.c_str(), "rb");
@@ -323,6 +328,7 @@
static void TearDownTestCase() {
Trace::ReturnTrace();
+ ClearTempFiles();
}
// Used to select between int and float interface tests.
@@ -2262,6 +2268,9 @@
}
}
+ static void TearDownTestCase() {
+ ClearTempFiles();
+ }
// Runs a process pass on files with the given parameters and dumps the output
// to a file specified with |output_file_prefix|.
static void ProcessFormat(int input_rate,