diff options
Diffstat (limited to 'webrtc/modules/audio_processing/transient/file_utils_unittest.cc')
-rw-r--r-- | webrtc/modules/audio_processing/transient/file_utils_unittest.cc | 96 |
1 files changed, 80 insertions, 16 deletions
diff --git a/webrtc/modules/audio_processing/transient/file_utils_unittest.cc b/webrtc/modules/audio_processing/transient/file_utils_unittest.cc index 7a035d2b41..7fb7d2d6a9 100644 --- a/webrtc/modules/audio_processing/transient/file_utils_unittest.cc +++ b/webrtc/modules/audio_processing/transient/file_utils_unittest.cc @@ -17,7 +17,6 @@ #include "webrtc/base/scoped_ptr.h" #include "webrtc/system_wrappers/include/file_wrapper.h" #include "webrtc/test/testsupport/fileutils.h" -#include "webrtc/test/testsupport/gtest_disable.h" #include "webrtc/typedefs.h" namespace webrtc { @@ -59,7 +58,12 @@ class TransientFileUtilsTest: public ::testing::Test { const std::string kTestFileNamef; }; -TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertByteArrayToFloat)) { +#if defined(WEBRTC_IOS) +#define MAYBE_ConvertByteArrayToFloat DISABLED_ConvertByteArrayToFloat +#else +#define MAYBE_ConvertByteArrayToFloat ConvertByteArrayToFloat +#endif +TEST_F(TransientFileUtilsTest, MAYBE_ConvertByteArrayToFloat) { float value = 0.0; EXPECT_EQ(0, ConvertByteArrayToFloat(kPiBytesf, &value)); @@ -72,7 +76,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertByteArrayToFloat)) { EXPECT_FLOAT_EQ(kAvogadro, value); } -TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertByteArrayToDouble)) { +#if defined(WEBRTC_IOS) +#define MAYBE_ConvertByteArrayToDouble DISABLED_ConvertByteArrayToDouble +#else +#define MAYBE_ConvertByteArrayToDouble ConvertByteArrayToDouble +#endif +TEST_F(TransientFileUtilsTest, MAYBE_ConvertByteArrayToDouble) { double value = 0.0; EXPECT_EQ(0, ConvertByteArrayToDouble(kPiBytes, &value)); @@ -85,7 +94,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertByteArrayToDouble)) { EXPECT_DOUBLE_EQ(kAvogadro, value); } -TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertFloatToByteArray)) { +#if defined(WEBRTC_IOS) +#define MAYBE_ConvertFloatToByteArray DISABLED_ConvertFloatToByteArray +#else +#define MAYBE_ConvertFloatToByteArray ConvertFloatToByteArray +#endif +TEST_F(TransientFileUtilsTest, MAYBE_ConvertFloatToByteArray) { rtc::scoped_ptr<uint8_t[]> bytes(new uint8_t[4]); EXPECT_EQ(0, ConvertFloatToByteArray(kPi, bytes.get())); @@ -98,7 +112,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertFloatToByteArray)) { EXPECT_EQ(0, memcmp(bytes.get(), kAvogadroBytesf, 4)); } -TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertDoubleToByteArray)) { +#if defined(WEBRTC_IOS) +#define MAYBE_ConvertDoubleToByteArray DISABLED_ConvertDoubleToByteArray +#else +#define MAYBE_ConvertDoubleToByteArray ConvertDoubleToByteArray +#endif +TEST_F(TransientFileUtilsTest, MAYBE_ConvertDoubleToByteArray) { rtc::scoped_ptr<uint8_t[]> bytes(new uint8_t[8]); EXPECT_EQ(0, ConvertDoubleToByteArray(kPi, bytes.get())); @@ -111,7 +130,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertDoubleToByteArray)) { EXPECT_EQ(0, memcmp(bytes.get(), kAvogadroBytes, 8)); } -TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadInt16BufferFromFile)) { +#if defined(WEBRTC_IOS) +#define MAYBE_ReadInt16BufferFromFile DISABLED_ReadInt16BufferFromFile +#else +#define MAYBE_ReadInt16BufferFromFile ReadInt16BufferFromFile +#endif +TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16BufferFromFile) { std::string test_filename = kTestFileName; rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create()); @@ -149,8 +173,13 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadInt16BufferFromFile)) { EXPECT_EQ(17631, buffer[kBufferLength - 1]); } -TEST_F(TransientFileUtilsTest, - DISABLED_ON_IOS(ReadInt16FromFileToFloatBuffer)) { +#if defined(WEBRTC_IOS) +#define MAYBE_ReadInt16FromFileToFloatBuffer \ + DISABLED_ReadInt16FromFileToFloatBuffer +#else +#define MAYBE_ReadInt16FromFileToFloatBuffer ReadInt16FromFileToFloatBuffer +#endif +TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16FromFileToFloatBuffer) { std::string test_filename = kTestFileName; rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create()); @@ -191,8 +220,13 @@ TEST_F(TransientFileUtilsTest, EXPECT_DOUBLE_EQ(17631, buffer[kBufferLength - 1]); } -TEST_F(TransientFileUtilsTest, - DISABLED_ON_IOS(ReadInt16FromFileToDoubleBuffer)) { +#if defined(WEBRTC_IOS) +#define MAYBE_ReadInt16FromFileToDoubleBuffer \ + DISABLED_ReadInt16FromFileToDoubleBuffer +#else +#define MAYBE_ReadInt16FromFileToDoubleBuffer ReadInt16FromFileToDoubleBuffer +#endif +TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16FromFileToDoubleBuffer) { std::string test_filename = kTestFileName; rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create()); @@ -232,7 +266,12 @@ TEST_F(TransientFileUtilsTest, EXPECT_DOUBLE_EQ(17631, buffer[kBufferLength - 1]); } -TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadFloatBufferFromFile)) { +#if defined(WEBRTC_IOS) +#define MAYBE_ReadFloatBufferFromFile DISABLED_ReadFloatBufferFromFile +#else +#define MAYBE_ReadFloatBufferFromFile ReadFloatBufferFromFile +#endif +TEST_F(TransientFileUtilsTest, MAYBE_ReadFloatBufferFromFile) { std::string test_filename = kTestFileNamef; rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create()); @@ -269,7 +308,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadFloatBufferFromFile)) { EXPECT_FLOAT_EQ(kAvogadro, buffer[2]); } -TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadDoubleBufferFromFile)) { +#if defined(WEBRTC_IOS) +#define MAYBE_ReadDoubleBufferFromFile DISABLED_ReadDoubleBufferFromFile +#else +#define MAYBE_ReadDoubleBufferFromFile ReadDoubleBufferFromFile +#endif +TEST_F(TransientFileUtilsTest, MAYBE_ReadDoubleBufferFromFile) { std::string test_filename = kTestFileName; rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create()); @@ -306,7 +350,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadDoubleBufferFromFile)) { EXPECT_DOUBLE_EQ(kAvogadro, buffer[2]); } -TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteInt16BufferToFile)) { +#if defined(WEBRTC_IOS) +#define MAYBE_WriteInt16BufferToFile DISABLED_WriteInt16BufferToFile +#else +#define MAYBE_WriteInt16BufferToFile WriteInt16BufferToFile +#endif +TEST_F(TransientFileUtilsTest, MAYBE_WriteInt16BufferToFile) { rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create()); std::string kOutFileName = test::TempFilename(test::OutputPath(), @@ -348,7 +397,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteInt16BufferToFile)) { kBufferLength * sizeof(written_buffer[0]))); } -TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteFloatBufferToFile)) { +#if defined(WEBRTC_IOS) +#define MAYBE_WriteFloatBufferToFile DISABLED_WriteFloatBufferToFile +#else +#define MAYBE_WriteFloatBufferToFile WriteFloatBufferToFile +#endif +TEST_F(TransientFileUtilsTest, MAYBE_WriteFloatBufferToFile) { rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create()); std::string kOutFileName = test::TempFilename(test::OutputPath(), @@ -390,7 +444,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteFloatBufferToFile)) { kBufferLength * sizeof(written_buffer[0]))); } -TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteDoubleBufferToFile)) { +#if defined(WEBRTC_IOS) +#define MAYBE_WriteDoubleBufferToFile DISABLED_WriteDoubleBufferToFile +#else +#define MAYBE_WriteDoubleBufferToFile WriteDoubleBufferToFile +#endif +TEST_F(TransientFileUtilsTest, MAYBE_WriteDoubleBufferToFile) { rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create()); std::string kOutFileName = test::TempFilename(test::OutputPath(), @@ -432,7 +491,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteDoubleBufferToFile)) { kBufferLength * sizeof(written_buffer[0]))); } -TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ExpectedErrorReturnValues)) { +#if defined(WEBRTC_IOS) +#define MAYBE_ExpectedErrorReturnValues DISABLED_ExpectedErrorReturnValues +#else +#define MAYBE_ExpectedErrorReturnValues ExpectedErrorReturnValues +#endif +TEST_F(TransientFileUtilsTest, MAYBE_ExpectedErrorReturnValues) { std::string test_filename = kTestFileName; double value; |