Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Unified Diff: webrtc/modules/audio_processing/transient/file_utils_unittest.cc

Issue 2054373002: FileWrapper[Impl] modifications and actually remove the "Impl" class. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix compile error in func_test_manager.cc Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/transient/file_utils_unittest.cc
diff --git a/webrtc/modules/audio_processing/transient/file_utils_unittest.cc b/webrtc/modules/audio_processing/transient/file_utils_unittest.cc
index 8520413154cb4d1e3c652032e87285a48c1b4cd5..68477712f24667c7338151920af4233e99311cbb 100644
--- a/webrtc/modules/audio_processing/transient/file_utils_unittest.cc
+++ b/webrtc/modules/audio_processing/transient/file_utils_unittest.cc
@@ -163,11 +163,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16BufferFromFile) {
std::unique_ptr<FileWrapper> file(FileWrapper::Create());
- file->OpenFile(test_filename.c_str(),
- true, // Read only.
- true, // Loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(test_filename.c_str(), true); // Read only.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kTestFileName.c_str();
const size_t kBufferLength = 12;
@@ -207,11 +204,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16FromFileToFloatBuffer) {
std::unique_ptr<FileWrapper> file(FileWrapper::Create());
- file->OpenFile(test_filename.c_str(),
- true, // Read only.
- true, // Loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(test_filename.c_str(), true); // Read only.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kTestFileName.c_str();
const size_t kBufferLength = 12;
@@ -254,11 +248,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16FromFileToDoubleBuffer) {
std::unique_ptr<FileWrapper> file(FileWrapper::Create());
- file->OpenFile(test_filename.c_str(),
- true, // Read only.
- true, // Loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(test_filename.c_str(), true); // Read only.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kTestFileName.c_str();
const size_t kBufferLength = 12;
@@ -299,11 +290,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_ReadFloatBufferFromFile) {
std::unique_ptr<FileWrapper> file(FileWrapper::Create());
- file->OpenFile(test_filename.c_str(),
- true, // Read only.
- true, // Loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(test_filename.c_str(), true); // Read only.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kTestFileNamef.c_str();
const size_t kBufferLength = 3;
@@ -341,11 +329,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_ReadDoubleBufferFromFile) {
std::unique_ptr<FileWrapper> file(FileWrapper::Create());
- file->OpenFile(test_filename.c_str(),
- true, // Read only.
- true, // Loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(test_filename.c_str(), true); // Read only.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kTestFileName.c_str();
const size_t kBufferLength = 3;
@@ -384,11 +369,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteInt16BufferToFile) {
std::string kOutFileName = CreateTempFilename(test::OutputPath(),
"utils_test");
- file->OpenFile(kOutFileName.c_str(),
- false, // Write mode.
- false, // No loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(kOutFileName.c_str(), false); // Write mode.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kOutFileName.c_str();
const size_t kBufferLength = 3;
@@ -405,11 +387,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteInt16BufferToFile) {
file->CloseFile();
- file->OpenFile(kOutFileName.c_str(),
- true, // Read only.
- false, // No loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(kOutFileName.c_str(), true); // Read only.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kOutFileName.c_str();
EXPECT_EQ(kBufferLength, ReadInt16BufferFromFile(file.get(),
@@ -431,11 +410,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteFloatBufferToFile) {
std::string kOutFileName = CreateTempFilename(test::OutputPath(),
"utils_test");
- file->OpenFile(kOutFileName.c_str(),
- false, // Write mode.
- false, // No loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(kOutFileName.c_str(), false); // Write mode.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kOutFileName.c_str();
const size_t kBufferLength = 3;
@@ -452,11 +428,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteFloatBufferToFile) {
file->CloseFile();
- file->OpenFile(kOutFileName.c_str(),
- true, // Read only.
- false, // No loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(kOutFileName.c_str(), true); // Read only.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kOutFileName.c_str();
EXPECT_EQ(kBufferLength, ReadFloatBufferFromFile(file.get(),
@@ -478,11 +451,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteDoubleBufferToFile) {
std::string kOutFileName = CreateTempFilename(test::OutputPath(),
"utils_test");
- file->OpenFile(kOutFileName.c_str(),
- false, // Write mode.
- false, // No loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(kOutFileName.c_str(), false); // Write mode.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kOutFileName.c_str();
const size_t kBufferLength = 3;
@@ -499,11 +469,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_WriteDoubleBufferToFile) {
file->CloseFile();
- file->OpenFile(kOutFileName.c_str(),
- true, // Read only.
- false, // No loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(kOutFileName.c_str(), true); // Read only.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kOutFileName.c_str();
EXPECT_EQ(kBufferLength, ReadDoubleBufferFromFile(file.get(),
@@ -541,11 +508,8 @@ TEST_F(TransientFileUtilsTest, MAYBE_ExpectedErrorReturnValues) {
EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 1, int16_buffer.get()));
EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 1, double_buffer.get()));
- file->OpenFile(test_filename.c_str(),
- true, // Read only.
- true, // Loop.
- false); // No text.
- ASSERT_TRUE(file->Open()) << "File could not be opened:\n"
+ file->OpenFile(test_filename.c_str(), true); // Read only.
+ ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
<< kTestFileName.c_str();
EXPECT_EQ(0u, ReadInt16BufferFromFile(NULL, 1, int16_buffer.get()));

Powered by Google App Engine
This is Rietveld 408576698