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

Unified Diff: webrtc/common_audio/lapped_transform_unittest.cc

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 4 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
« no previous file with comments | « webrtc/common_audio/lapped_transform.cc ('k') | webrtc/common_audio/real_fourier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/lapped_transform_unittest.cc
diff --git a/webrtc/common_audio/lapped_transform_unittest.cc b/webrtc/common_audio/lapped_transform_unittest.cc
index a21398c2c9ad8e0aa6129b9e72b8407fdc1a822e..49751c0d9b4ccc5c14e3550bf2182ee9d5ff1b3c 100644
--- a/webrtc/common_audio/lapped_transform_unittest.cc
+++ b/webrtc/common_audio/lapped_transform_unittest.cc
@@ -26,7 +26,7 @@ class NoopCallback : public webrtc::LappedTransform::Callback {
virtual void ProcessAudioBlock(const complex<float>* const* in_block,
int in_channels,
- int frames,
+ size_t frames,
int out_channels,
complex<float>* const* out_block) {
CHECK_EQ(in_channels, out_channels);
@@ -50,19 +50,19 @@ class FftCheckerCallback : public webrtc::LappedTransform::Callback {
virtual void ProcessAudioBlock(const complex<float>* const* in_block,
int in_channels,
- int frames,
+ size_t frames,
int out_channels,
complex<float>* const* out_block) {
CHECK_EQ(in_channels, out_channels);
- int full_length = (frames - 1) * 2;
+ size_t full_length = (frames - 1) * 2;
++block_num_;
if (block_num_ > 0) {
ASSERT_NEAR(in_block[0][0].real(), static_cast<float>(full_length),
1e-5f);
ASSERT_NEAR(in_block[0][0].imag(), 0.0f, 1e-5f);
- for (int i = 1; i < frames; ++i) {
+ for (size_t i = 1; i < frames; ++i) {
ASSERT_NEAR(in_block[0][i].real(), 0.0f, 1e-5f);
ASSERT_NEAR(in_block[0][i].imag(), 0.0f, 1e-5f);
}
@@ -190,14 +190,14 @@ TEST(LappedTransformTest, chunk_length) {
// Make sure that chunk_length returns the same value passed to the
// LappedTransform constructor.
{
- const int kExpectedChunkLength = 512;
+ const size_t kExpectedChunkLength = 512;
const LappedTransform trans(1, 1, kExpectedChunkLength, window,
kBlockLength, kBlockLength, &call);
EXPECT_EQ(kExpectedChunkLength, trans.chunk_length());
}
{
- const int kExpectedChunkLength = 160;
+ const size_t kExpectedChunkLength = 160;
const LappedTransform trans(1, 1, kExpectedChunkLength, window,
kBlockLength, kBlockLength, &call);
« no previous file with comments | « webrtc/common_audio/lapped_transform.cc ('k') | webrtc/common_audio/real_fourier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698