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

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

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
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 "sandbox/linux/seccomp-bpf/errorcode.h" 5 #include "sandbox/linux/seccomp-bpf/errorcode.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "sandbox/linux/bpf_dsl/bpf_dsl.h" 10 #include "sandbox/linux/bpf_dsl/bpf_dsl.h"
11 #include "sandbox/linux/bpf_dsl/policy.h"
11 #include "sandbox/linux/bpf_dsl/policy_compiler.h" 12 #include "sandbox/linux/bpf_dsl/policy_compiler.h"
12 #include "sandbox/linux/seccomp-bpf/linux_seccomp.h" 13 #include "sandbox/linux/seccomp-bpf/linux_seccomp.h"
13 #include "sandbox/linux/seccomp-bpf/trap.h" 14 #include "sandbox/linux/seccomp-bpf/trap.h"
14 #include "sandbox/linux/tests/unit_tests.h" 15 #include "sandbox/linux/tests/unit_tests.h"
15 16
16 namespace sandbox { 17 namespace sandbox {
17 18
18 namespace { 19 namespace {
19 20
20 class DummyPolicy : public bpf_dsl::SandboxBPFDSLPolicy { 21 class DummyPolicy : public bpf_dsl::Policy {
21 public: 22 public:
22 DummyPolicy() {} 23 DummyPolicy() {}
23 virtual ~DummyPolicy() {} 24 virtual ~DummyPolicy() {}
24 25
25 virtual bpf_dsl::ResultExpr EvaluateSyscall(int sysno) const override { 26 virtual bpf_dsl::ResultExpr EvaluateSyscall(int sysno) const override {
26 return bpf_dsl::Allow(); 27 return bpf_dsl::Allow();
27 } 28 }
28 29
29 private: 30 private:
30 DISALLOW_COPY_AND_ASSIGN(DummyPolicy); 31 DISALLOW_COPY_AND_ASSIGN(DummyPolicy);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 SANDBOX_ASSERT(e1.LessThan(e4)); 111 SANDBOX_ASSERT(e1.LessThan(e4));
111 SANDBOX_ASSERT(e3.LessThan(e4)); 112 SANDBOX_ASSERT(e3.LessThan(e4));
112 SANDBOX_ASSERT(e4.LessThan(e5)); 113 SANDBOX_ASSERT(e4.LessThan(e5));
113 SANDBOX_ASSERT(!e4.LessThan(e6)); 114 SANDBOX_ASSERT(!e4.LessThan(e6));
114 SANDBOX_ASSERT(!e6.LessThan(e4)); 115 SANDBOX_ASSERT(!e6.LessThan(e4));
115 } 116 }
116 117
117 } // namespace 118 } // namespace
118 119
119 } // namespace sandbox 120 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf/bpf_tests_unittest.cc ('k') | sandbox/linux/seccomp-bpf/sandbox_bpf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698