From 200ac007efc0576f8e9db60cf4c20a308b72ec14 Mon Sep 17 00:00:00 2001 From: "pbos@webrtc.org" Date: Tue, 3 Feb 2015 14:14:01 +0000 Subject: [PATCH] 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 --- .../audio_processing/test/audio_processing_unittest.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webrtc/modules/audio_processing/test/audio_processing_unittest.cc b/webrtc/modules/audio_processing/test/audio_processing_unittest.cc index 093c72ede5..d9ebe8eca9 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 @@ std::string OutputFilePath(std::string name, 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 @@ class ApmTest : public ::testing::Test { static void TearDownTestCase() { Trace::ReturnTrace(); + ClearTempFiles(); } // Used to select between int and float interface tests. @@ -2262,6 +2268,9 @@ class AudioProcessingTest } } + 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,