diff options
Diffstat (limited to 'webrtc/common_audio/lapped_transform_unittest.cc')
-rw-r--r-- | webrtc/common_audio/lapped_transform_unittest.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/webrtc/common_audio/lapped_transform_unittest.cc b/webrtc/common_audio/lapped_transform_unittest.cc index f688cc240a..a78488e326 100644 --- a/webrtc/common_audio/lapped_transform_unittest.cc +++ b/webrtc/common_audio/lapped_transform_unittest.cc @@ -25,23 +25,23 @@ class NoopCallback : public webrtc::LappedTransform::Callback { NoopCallback() : block_num_(0) {} virtual void ProcessAudioBlock(const complex<float>* const* in_block, - int in_channels, + size_t in_channels, size_t frames, - int out_channels, + size_t out_channels, complex<float>* const* out_block) { RTC_CHECK_EQ(in_channels, out_channels); - for (int i = 0; i < out_channels; ++i) { + for (size_t i = 0; i < out_channels; ++i) { memcpy(out_block[i], in_block[i], sizeof(**in_block) * frames); } ++block_num_; } - int block_num() { + size_t block_num() { return block_num_; } private: - int block_num_; + size_t block_num_; }; class FftCheckerCallback : public webrtc::LappedTransform::Callback { @@ -49,9 +49,9 @@ class FftCheckerCallback : public webrtc::LappedTransform::Callback { FftCheckerCallback() : block_num_(0) {} virtual void ProcessAudioBlock(const complex<float>* const* in_block, - int in_channels, + size_t in_channels, size_t frames, - int out_channels, + size_t out_channels, complex<float>* const* out_block) { RTC_CHECK_EQ(in_channels, out_channels); @@ -69,12 +69,12 @@ class FftCheckerCallback : public webrtc::LappedTransform::Callback { } } - int block_num() { + size_t block_num() { return block_num_; } private: - int block_num_; + size_t block_num_; }; void SetFloatArray(float value, int rows, int cols, float* const* array) { @@ -90,10 +90,10 @@ void SetFloatArray(float value, int rows, int cols, float* const* array) { namespace webrtc { TEST(LappedTransformTest, Windowless) { - const int kChannels = 3; - const int kChunkLength = 512; - const int kBlockLength = 64; - const int kShiftAmount = 64; + const size_t kChannels = 3; + const size_t kChunkLength = 512; + const size_t kBlockLength = 64; + const size_t kShiftAmount = 64; NoopCallback noop; // Rectangular window. @@ -118,8 +118,8 @@ TEST(LappedTransformTest, Windowless) { trans.ProcessChunk(in_chunk, out_chunk); - for (int i = 0; i < kChannels; ++i) { - for (int j = 0; j < kChunkLength; ++j) { + for (size_t i = 0; i < kChannels; ++i) { + for (size_t j = 0; j < kChunkLength; ++j) { ASSERT_NEAR(out_chunk[i][j], 2.0f, 1e-5f); } } @@ -128,9 +128,9 @@ TEST(LappedTransformTest, Windowless) { } TEST(LappedTransformTest, IdentityProcessor) { - const int kChunkLength = 512; - const int kBlockLength = 64; - const int kShiftAmount = 32; + const size_t kChunkLength = 512; + const size_t kBlockLength = 64; + const size_t kShiftAmount = 32; NoopCallback noop; // Identity window for |overlap = block_size / 2|. @@ -149,7 +149,7 @@ TEST(LappedTransformTest, IdentityProcessor) { trans.ProcessChunk(&in_chunk, &out_chunk); - for (int i = 0; i < kChunkLength; ++i) { + for (size_t i = 0; i < kChunkLength; ++i) { ASSERT_NEAR(out_chunk[i], (i < kBlockLength - kShiftAmount) ? 0.0f : 2.0f, 1e-5f); @@ -159,8 +159,8 @@ TEST(LappedTransformTest, IdentityProcessor) { } TEST(LappedTransformTest, Callbacks) { - const int kChunkLength = 512; - const int kBlockLength = 64; + const size_t kChunkLength = 512; + const size_t kBlockLength = 64; FftCheckerCallback call; // Rectangular window. @@ -183,7 +183,7 @@ TEST(LappedTransformTest, Callbacks) { } TEST(LappedTransformTest, chunk_length) { - const int kBlockLength = 64; + const size_t kBlockLength = 64; FftCheckerCallback call; const float window[kBlockLength] = {}; |