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

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

Issue 1053603002: Introduce linux_filter.h and replace #include <linux/filter.h> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | sandbox/linux/bpf_dsl/codegen.cc » ('j') | sandbox/linux/bpf_dsl/dump_bpf.cc » ('J')
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/bpf_dsl.h" 5 #include "sandbox/linux/bpf_dsl/bpf_dsl.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <netinet/in.h> 9 #include <netinet/in.h>
10 #include <sys/socket.h> 10 #include <sys/socket.h>
11 #include <sys/syscall.h> 11 #include <sys/syscall.h>
12 #include <sys/utsname.h> 12 #include <sys/utsname.h>
13 #include <unistd.h> 13 #include <unistd.h>
14 14
15 #include <map> 15 #include <map>
16 #include <utility> 16 #include <utility>
17 17
18 #include "base/files/scoped_file.h" 18 #include "base/files/scoped_file.h"
19 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "build/build_config.h" 20 #include "build/build_config.h"
21 #include "sandbox/linux/bpf_dsl/bpf_dsl_impl.h" 21 #include "sandbox/linux/bpf_dsl/bpf_dsl_impl.h"
22 #include "sandbox/linux/bpf_dsl/codegen.h" 22 #include "sandbox/linux/bpf_dsl/codegen.h"
23 #include "sandbox/linux/bpf_dsl/policy.h" 23 #include "sandbox/linux/bpf_dsl/policy.h"
24 #include "sandbox/linux/bpf_dsl/policy_compiler.h" 24 #include "sandbox/linux/bpf_dsl/policy_compiler.h"
25 #include "sandbox/linux/bpf_dsl/seccomp_macros.h" 25 #include "sandbox/linux/bpf_dsl/seccomp_macros.h"
26 #include "sandbox/linux/bpf_dsl/trap_registry.h" 26 #include "sandbox/linux/bpf_dsl/trap_registry.h"
27 #include "sandbox/linux/bpf_dsl/verifier.h" 27 #include "sandbox/linux/bpf_dsl/verifier.h"
28 #include "sandbox/linux/seccomp-bpf/errorcode.h" 28 #include "sandbox/linux/seccomp-bpf/errorcode.h"
29 #include "sandbox/linux/system_headers/linux_filter.h"
mdempsky 2015/04/01 22:06:10 Why is this necessary?
hidehiko 2015/04/02 09:04:42 CodeGen::Program used below is actually the typede
29 #include "testing/gtest/include/gtest/gtest.h" 30 #include "testing/gtest/include/gtest/gtest.h"
30 31
31 #define CASES SANDBOX_BPF_DSL_CASES 32 #define CASES SANDBOX_BPF_DSL_CASES
32 33
33 namespace sandbox { 34 namespace sandbox {
34 namespace bpf_dsl { 35 namespace bpf_dsl {
35 namespace { 36 namespace {
36 37
37 // Helper function to construct fake arch_seccomp_data objects. 38 // Helper function to construct fake arch_seccomp_data objects.
38 struct arch_seccomp_data FakeSyscall(int nr, 39 struct arch_seccomp_data FakeSyscall(int nr,
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 EXPECT_TRUE(unsafe->HasUnsafeTraps()); 477 EXPECT_TRUE(unsafe->HasUnsafeTraps());
477 478
478 const Arg<int> arg(0); 479 const Arg<int> arg(0);
479 ResultExpr maybe = If(arg == 0, allow).Else(unsafe); 480 ResultExpr maybe = If(arg == 0, allow).Else(unsafe);
480 EXPECT_TRUE(maybe->HasUnsafeTraps()); 481 EXPECT_TRUE(maybe->HasUnsafeTraps());
481 } 482 }
482 483
483 } // namespace 484 } // namespace
484 } // namespace bpf_dsl 485 } // namespace bpf_dsl
485 } // namespace sandbox 486 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/bpf_dsl/codegen.cc » ('j') | sandbox/linux/bpf_dsl/dump_bpf.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698