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

Side by Side Diff: sandbox/linux/bpf_dsl/cons_unittest.cc

Issue 467183005: Remove implicit conversions from scoped_refptr to T* in sandbox/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « sandbox/linux/bpf_dsl/bpf_dsl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "sandbox/linux/bpf_dsl/cons.h" 5 #include "sandbox/linux/bpf_dsl/cons.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace sandbox { 11 namespace sandbox {
12 namespace { 12 namespace {
13 13
14 std::string Join(Cons<char>::List char_list) { 14 std::string Join(Cons<char>::List char_list) {
15 std::string res; 15 std::string res;
16 for (Cons<char>::List it = char_list; it; it = it->tail()) { 16 for (Cons<char>::List it = char_list; it.get(); it = it->tail()) {
17 res.push_back(it->head()); 17 res.push_back(it->head());
18 } 18 }
19 return res; 19 return res;
20 } 20 }
21 21
22 TEST(ConsListTest, Basic) { 22 TEST(ConsListTest, Basic) {
23 Cons<char>::List ba = 23 Cons<char>::List ba =
24 Cons<char>::Make('b', Cons<char>::Make('a', Cons<char>::List())); 24 Cons<char>::Make('b', Cons<char>::Make('a', Cons<char>::List()));
25 EXPECT_EQ("ba", Join(ba)); 25 EXPECT_EQ("ba", Join(ba));
26 26
27 Cons<char>::List cba = Cons<char>::Make('c', ba); 27 Cons<char>::List cba = Cons<char>::Make('c', ba);
28 Cons<char>::List dba = Cons<char>::Make('d', ba); 28 Cons<char>::List dba = Cons<char>::Make('d', ba);
29 EXPECT_EQ("cba", Join(cba)); 29 EXPECT_EQ("cba", Join(cba));
30 EXPECT_EQ("dba", Join(dba)); 30 EXPECT_EQ("dba", Join(dba));
31 } 31 }
32 32
33 } // namespace 33 } // namespace
34 } // namespace sandbox 34 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/bpf_dsl/bpf_dsl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698