OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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/bpf_dsl/test_trap_registry.h" |
| 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 |
| 9 namespace sandbox { |
| 10 namespace bpf_dsl { |
| 11 |
| 12 TestTrapRegistry::TestTrapRegistry() : map_() {} |
| 13 TestTrapRegistry::~TestTrapRegistry() {} |
| 14 |
| 15 uint16_t TestTrapRegistry::Add(TrapFnc fnc, const void* aux, bool safe) { |
| 16 EXPECT_TRUE(safe); |
| 17 |
| 18 const uint16_t next_id = map_.size() + 1; |
| 19 return map_.insert(std::make_pair(Key(fnc, aux), next_id)).first->second; |
| 20 } |
| 21 |
| 22 bool TestTrapRegistry::EnableUnsafeTraps() { |
| 23 ADD_FAILURE() << "Unimplemented"; |
| 24 return false; |
| 25 } |
| 26 |
| 27 } // namespace bpf_dsl |
| 28 } // namespace sandbox |
OLD | NEW |