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

Side by Side Diff: media/base/data_buffer_unittest.cc

Issue 1542013004: Switch to standard integer types in media/, take 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more stddef Created 4 years, 12 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 unified diff | Download patch
« no previous file with comments | « media/base/data_buffer.h ('k') | media/base/data_source.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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h>
6
7 #include "base/macros.h"
5 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
6 #include "media/base/data_buffer.h" 9 #include "media/base/data_buffer.h"
7 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
8 11
9 namespace media { 12 namespace media {
10 13
11 TEST(DataBufferTest, Constructor_ZeroSize) { 14 TEST(DataBufferTest, Constructor_ZeroSize) {
12 // Zero-sized buffers are valid. In practice they aren't used very much but it 15 // Zero-sized buffers are valid. In practice they aren't used very much but it
13 // eliminates clients from worrying about null data pointers. 16 // eliminates clients from worrying about null data pointers.
14 scoped_refptr<DataBuffer> buffer = new DataBuffer(0); 17 scoped_refptr<DataBuffer> buffer = new DataBuffer(0);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 ASSERT_TRUE(data); 118 ASSERT_TRUE(data);
116 memcpy(data, kNewData, kNewDataSize); 119 memcpy(data, kNewData, kNewDataSize);
117 buffer2->set_data_size(kNewDataSize); 120 buffer2->set_data_size(kNewDataSize);
118 read_only_data = buffer2->data(); 121 read_only_data = buffer2->data();
119 EXPECT_EQ(kNewDataSize, buffer2->data_size()); 122 EXPECT_EQ(kNewDataSize, buffer2->data_size());
120 ASSERT_EQ(data, read_only_data); 123 ASSERT_EQ(data, read_only_data);
121 EXPECT_EQ(0, memcmp(read_only_data, kNewData, kNewDataSize)); 124 EXPECT_EQ(0, memcmp(read_only_data, kNewData, kNewDataSize));
122 } 125 }
123 126
124 } // namespace media 127 } // namespace media
OLDNEW
« no previous file with comments | « media/base/data_buffer.h ('k') | media/base/data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698