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

Side by Side Diff: sandbox/linux/seccomp-bpf-helpers/cons_unittest.cc

Issue 299743002: Add domain-specific language for BPF policies (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add explicit virtual destructors to test policies Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "sandbox/linux/seccomp-bpf-helpers/cons.h"
6
7 #include <string>
8
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace sandbox {
12
13 namespace {
14
15 std::string Join(Cons<char>::List char_list) {
16 std::string res;
17 for (Cons<char>::List it = char_list; it; it = it->tail()) {
18 res.push_back(it->head());
19 }
20 return res;
21 }
22
23 } // namespace
jln (very slow on Chromium) 2014/06/27 01:45:50 It's perfectly ok to have TEST() in the anonymous
mdempsky 2014/06/28 00:36:42 Oops, done.
24
25 TEST(ConsListTest, Basic) {
26 Cons<char>::List ba =
27 Cons<char>::Make('b', Cons<char>::Make('a', Cons<char>::List()));
28 EXPECT_EQ("ba", Join(ba));
29
30 Cons<char>::List cba = Cons<char>::Make('c', ba);
31 Cons<char>::List dba = Cons<char>::Make('d', ba);
32 EXPECT_EQ("cba", Join(cba));
33 EXPECT_EQ("dba", Join(dba));
34 }
35
36 } // namespace sandbox
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698