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

Side by Side Diff: webrtc/base/array_view_unittest.cc

Issue 1418423010: Pass audio to AudioEncoder::Encode() in an ArrayView (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: disconvert to bool Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « webrtc/base/array_view.h ('k') | webrtc/modules/audio_coding/codecs/audio_encoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 ++i; 207 ++i;
208 } 208 }
209 i = 0; 209 i = 0;
210 for (auto& e : ArrayView<const char>(av)) { 210 for (auto& e : ArrayView<const char>(av)) {
211 EXPECT_EQ(arr + i, &e); 211 EXPECT_EQ(arr + i, &e);
212 // e = 'q' + i; // Compile error, because e is a const char&. 212 // e = 'q' + i; // Compile error, because e is a const char&.
213 ++i; 213 ++i;
214 } 214 }
215 } 215 }
216 216
217 TEST(ArrayViewTest, TestEmpty) {
218 EXPECT_TRUE(ArrayView<int>().empty());
219 const int a[] = {1, 2, 3};
220 EXPECT_FALSE(ArrayView<const int>(a).empty());
221 }
222
223 TEST(ArrayViewTest, TestCompare) {
hlundin-webrtc 2015/11/05 15:22:28 Is it conceivable to have two ArrayViews with the
kwiberg-webrtc 2015/11/05 19:00:07 Yes, that's of course entirely possible. Will add
224 int a[] = {1, 2, 3};
225 int b[] = {1, 2, 3};
226 EXPECT_EQ(ArrayView<int>(a), ArrayView<int>(a));
227 EXPECT_EQ(ArrayView<int>(), ArrayView<int>());
228 EXPECT_NE(ArrayView<int>(a), ArrayView<int>(b));
229 EXPECT_NE(ArrayView<int>(a), ArrayView<int>());
230 }
231
217 } // namespace rtc 232 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/array_view.h ('k') | webrtc/modules/audio_coding/codecs/audio_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698