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

Unified Diff: webrtc/base/buffer_unittest.cc

Issue 2804673002: Add [c]begin() and [c]end() member functions to rtc::Buffer (Closed)
Patch Set: Remove redundant "this->" Created 3 years, 8 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/base/buffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/buffer_unittest.cc
diff --git a/webrtc/base/buffer_unittest.cc b/webrtc/base/buffer_unittest.cc
index c84efb4009093dc25e966bb9376f963f6a60c9c6..82baedb5656e5bfba13eca13e8b565c5dad57954 100644
--- a/webrtc/base/buffer_unittest.cc
+++ b/webrtc/base/buffer_unittest.cc
@@ -356,6 +356,24 @@ TEST(BufferTest, TestBracketWrite) {
}
}
+TEST(BufferTest, TestBeginEnd) {
+ const Buffer cbuf(kTestData);
+ Buffer buf(kTestData);
+ auto b1 = cbuf.begin();
+ for (auto& x : buf) {
+ EXPECT_EQ(*b1, x);
+ ++b1;
+ ++x;
+ }
+ EXPECT_EQ(cbuf.end(), b1);
+ auto b2 = buf.begin();
+ for (auto& y : cbuf) {
+ EXPECT_EQ(*b2, y + 1);
+ ++b2;
+ }
+ EXPECT_EQ(buf.end(), b2);
+}
+
TEST(BufferTest, TestInt16) {
static constexpr int16_t test_data[] = {14, 15, 16, 17, 18};
BufferT<int16_t> buf(test_data);
« no previous file with comments | « webrtc/base/buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698