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

Unified 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: rebase 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/array_view_unittest.cc
diff --git a/webrtc/base/array_view_unittest.cc b/webrtc/base/array_view_unittest.cc
index 0d1bff03d11de11ec3efccf91502b9d4d0ad6416..8bb1bcc4c6ce259a8d1c61c2d3618bc2594f35e5 100644
--- a/webrtc/base/array_view_unittest.cc
+++ b/webrtc/base/array_view_unittest.cc
@@ -214,4 +214,20 @@ TEST(ArrayViewTest, TestIteration) {
}
}
+TEST(ArrayViewTest, TestEmpty) {
+ EXPECT_TRUE(ArrayView<int>().empty());
+ const int a[] = {1, 2, 3};
+ EXPECT_FALSE(ArrayView<const int>(a).empty());
+}
+
+TEST(ArrayViewTest, TestCompare) {
+ int a[] = {1, 2, 3};
+ int b[] = {1, 2, 3};
+ EXPECT_EQ(ArrayView<int>(a), ArrayView<int>(a));
+ EXPECT_EQ(ArrayView<int>(), ArrayView<int>());
+ EXPECT_NE(ArrayView<int>(a), ArrayView<int>(b));
+ EXPECT_NE(ArrayView<int>(a), ArrayView<int>());
+ EXPECT_NE(ArrayView<int>(a), ArrayView<int>(a, 2));
+}
+
} // namespace rtc
« 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