| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 EXPECT_NE(buf.data(), nullptr); | 350 EXPECT_NE(buf.data(), nullptr); |
| 351 BufferT<BloodStone*> buf2(4); | 351 BufferT<BloodStone*> buf2(4); |
| 352 for (size_t i = 0; i < buf2.size(); ++i) { | 352 for (size_t i = 0; i < buf2.size(); ++i) { |
| 353 buf2[i] = &buf[i]; | 353 buf2[i] = &buf[i]; |
| 354 } | 354 } |
| 355 static const char kObsidian[] = "obsidian"; | 355 static const char kObsidian[] = "obsidian"; |
| 356 buf2[2]->stone = kObsidian; | 356 buf2[2]->stone = kObsidian; |
| 357 EXPECT_EQ(kObsidian, buf[2].stone); | 357 EXPECT_EQ(kObsidian, buf[2].stone); |
| 358 } | 358 } |
| 359 | 359 |
| 360 TEST(BufferTest, TestEmpty) { |
| 361 Buffer buf; |
| 362 EXPECT_TRUE(buf.empty()); |
| 363 buf.SetData(kTestData, 15); |
| 364 EXPECT_FALSE(buf.empty()); |
| 365 buf.Clear(); |
| 366 EXPECT_TRUE(buf.empty()); |
| 367 } |
| 368 |
| 360 } // namespace rtc | 369 } // namespace rtc |
| OLD | NEW |