| OLD | NEW |
| 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/codegen.h" |
| 6 |
| 5 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <linux/filter.h> |
| 6 | 9 |
| 7 #include <algorithm> | |
| 8 #include <set> | 10 #include <set> |
| 11 #include <string> |
| 9 #include <vector> | 12 #include <vector> |
| 10 | 13 |
| 11 #include "sandbox/linux/seccomp-bpf/codegen.h" | 14 #include "sandbox/linux/seccomp-bpf/basicblock.h" |
| 15 #include "sandbox/linux/seccomp-bpf/errorcode.h" |
| 16 #include "sandbox/linux/seccomp-bpf/instruction.h" |
| 12 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" | 17 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
| 13 #include "sandbox/linux/tests/unit_tests.h" | 18 #include "sandbox/linux/tests/unit_tests.h" |
| 14 | 19 |
| 15 namespace sandbox { | 20 namespace sandbox { |
| 16 | 21 |
| 17 class SandboxUnittestHelper : public SandboxBPF { | 22 class SandboxUnittestHelper : public SandboxBPF { |
| 18 public: | 23 public: |
| 19 typedef SandboxBPF::Program Program; | 24 typedef SandboxBPF::Program Program; |
| 20 }; | 25 }; |
| 21 | 26 |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 assembly.append(reinterpret_cast<char*>(&insn.k), sizeof(insn.k)); | 534 assembly.append(reinterpret_cast<char*>(&insn.k), sizeof(insn.k)); |
| 530 } | 535 } |
| 531 SANDBOX_ASSERT(source == assembly); | 536 SANDBOX_ASSERT(source == assembly); |
| 532 } | 537 } |
| 533 | 538 |
| 534 SANDBOX_TEST(CodeGen, All) { | 539 SANDBOX_TEST(CodeGen, All) { |
| 535 ForAllPrograms(CompileAndCompare); | 540 ForAllPrograms(CompileAndCompare); |
| 536 } | 541 } |
| 537 | 542 |
| 538 } // namespace sandbox | 543 } // namespace sandbox |
| OLD | NEW |