]> git.saurik.com Git - apple/xnu.git/blob - tests/bounded_ptr_src/test_utils.h
xnu-7195.50.7.100.1.tar.gz
[apple/xnu.git] / tests / bounded_ptr_src / test_utils.h
1 #ifndef TESTS_BOUNDED_PTR_TEST_UTILS_H
2 #define TESTS_BOUNDED_PTR_TEST_UTILS_H
3
4 #include <cassert>
5 #include <libkern/c++/bounded_ptr.h>
6
7 namespace {
8 struct test_policy {
9 static void
10 trap(char const*)
11 {
12 assert(false);
13 }
14 };
15
16 template <typename T>
17 using test_bounded_ptr = libkern::bounded_ptr<T, test_policy>;
18 } // end anonymous namespace
19
20 #endif // !TESTS_BOUNDED_PTR_TEST_UTILS_H