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

Unified Diff: webrtc/common_audio/vad/vad_unittest.cc

Issue 1227203003: Update audio code to use size_t more correctly, webrtc/common_audio/ portion. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 5 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/vad/vad_unittest.h ('k') | webrtc/common_audio/vad/webrtc_vad.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/vad/vad_unittest.cc
diff --git a/webrtc/common_audio/vad/vad_unittest.cc b/webrtc/common_audio/vad/vad_unittest.cc
index 48eddbf935e5ab34cf91446756370500359e78e5..ecc47342d0df1b3823964125d8692338df1dd42a 100644
--- a/webrtc/common_audio/vad/vad_unittest.cc
+++ b/webrtc/common_audio/vad/vad_unittest.cc
@@ -27,7 +27,7 @@ void VadTest::SetUp() {}
void VadTest::TearDown() {}
// Returns true if the rate and frame length combination is valid.
-bool VadTest::ValidRatesAndFrameLengths(int rate, int frame_length) {
+bool VadTest::ValidRatesAndFrameLengths(int rate, size_t frame_length) {
if (rate == 8000) {
if (frame_length == 80 || frame_length == 160 || frame_length == 240) {
return true;
@@ -65,7 +65,7 @@ TEST_F(VadTest, ApiTest) {
// Construct a speech signal that will trigger the VAD in all modes. It is
// known that (i * i) will wrap around, but that doesn't matter in this case.
int16_t speech[kMaxFrameLength];
- for (int16_t i = 0; i < kMaxFrameLength; i++) {
+ for (size_t i = 0; i < kMaxFrameLength; i++) {
speech[i] = static_cast<int16_t>(i * i);
}
@@ -134,8 +134,8 @@ TEST_F(VadTest, ValidRatesFrameLengths) {
-8000, -4000, 0, 4000, 8000, 8001, 15999, 16000, 32000, 48000, 48001, 96000
};
- const int kFrameLengths[] = {
- -10, 0, 80, 81, 159, 160, 240, 320, 480, 640, 960, 1440, 2000
+ const size_t kFrameLengths[] = {
+ 0, 80, 81, 159, 160, 240, 320, 480, 640, 960, 1440, 2000
};
for (size_t i = 0; i < arraysize(kRates); i++) {
« no previous file with comments | « webrtc/common_audio/vad/vad_unittest.h ('k') | webrtc/common_audio/vad/webrtc_vad.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698