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

Side by Side Diff: chromeos/binder/buffer_reader_unittest.cc

Issue 1540803002: Switch to standard integer types in chromeos/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more includes Created 5 years 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 | « chromeos/binder/buffer_reader.h ('k') | chromeos/binder/command_broker.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stddef.h>
6
5 #include "chromeos/binder/buffer_reader.h" 7 #include "chromeos/binder/buffer_reader.h"
6 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
7 9
8 namespace binder { 10 namespace binder {
9 11
10 TEST(BinderBufferReaderTest, Read) { 12 TEST(BinderBufferReaderTest, Read) {
11 // Prepare data. 13 // Prepare data.
12 const size_t N = 4; 14 const size_t N = 4;
13 int data[N]; 15 int data[N];
14 for (size_t i = 0; i < N; ++i) { 16 for (size_t i = 0; i < N; ++i) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 int value = 0; 48 int value = 0;
47 EXPECT_TRUE(reader.Read(&value, sizeof(value))); 49 EXPECT_TRUE(reader.Read(&value, sizeof(value)));
48 EXPECT_EQ(data[i], value); 50 EXPECT_EQ(data[i], value);
49 } 51 }
50 EXPECT_FALSE(reader.HasMoreData()); 52 EXPECT_FALSE(reader.HasMoreData());
51 // No longer able to skip. 53 // No longer able to skip.
52 EXPECT_FALSE(reader.Skip(sizeof(data[0]))); 54 EXPECT_FALSE(reader.Skip(sizeof(data[0])));
53 } 55 }
54 56
55 } // namespace binder 57 } // namespace binder
OLDNEW
« no previous file with comments | « chromeos/binder/buffer_reader.h ('k') | chromeos/binder/command_broker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698