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

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

Issue 101773003: Linux sandbox: cleanup sandbox-bpf naming. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address namespace sandbox nits. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « sandbox/linux/seccomp-bpf/codegen.cc ('k') | sandbox/linux/seccomp-bpf/demo.cc » ('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 (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 <errno.h> 5 #include <errno.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
11 #include "sandbox/linux/seccomp-bpf/codegen.h" 11 #include "sandbox/linux/seccomp-bpf/codegen.h"
12 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" 12 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
13 #include "sandbox/linux/tests/unit_tests.h" 13 #include "sandbox/linux/tests/unit_tests.h"
14 14
15 namespace playground2 { 15 namespace sandbox {
16 16
17 class SandboxUnittestHelper : public Sandbox { 17 class SandboxUnittestHelper : public SandboxBPF {
18 public: 18 public:
19 typedef Sandbox::Program Program; 19 typedef SandboxBPF::Program Program;
20 }; 20 };
21 21
22 // We want to access some of the private methods in the code generator. We 22 // We want to access some of the private methods in the code generator. We
23 // do so by defining a "friend" that makes these methods public for us. 23 // do so by defining a "friend" that makes these methods public for us.
24 class CodeGenUnittestHelper : public CodeGen { 24 class CodeGenUnittestHelper : public CodeGen {
25 public: 25 public:
26 void FindBranchTargets(const Instruction& instructions, 26 void FindBranchTargets(const Instruction& instructions,
27 BranchTargets *branch_targets) { 27 BranchTargets *branch_targets) {
28 CodeGen::FindBranchTargets(instructions, branch_targets); 28 CodeGen::FindBranchTargets(instructions, branch_targets);
29 } 29 }
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 assembly.append(reinterpret_cast<char *>(&insn.code), sizeof(insn.code)); 437 assembly.append(reinterpret_cast<char *>(&insn.code), sizeof(insn.code));
438 assembly.append(reinterpret_cast<char *>(&insn.k), sizeof(insn.k)); 438 assembly.append(reinterpret_cast<char *>(&insn.k), sizeof(insn.k));
439 } 439 }
440 SANDBOX_ASSERT(source == assembly); 440 SANDBOX_ASSERT(source == assembly);
441 } 441 }
442 442
443 SANDBOX_TEST(CodeGen, All) { 443 SANDBOX_TEST(CodeGen, All) {
444 ForAllPrograms(CompileAndCompare); 444 ForAllPrograms(CompileAndCompare);
445 } 445 }
446 446
447 } // namespace playground2 447 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf/codegen.cc ('k') | sandbox/linux/seccomp-bpf/demo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698