1*c54f35caSApple OSS Distributions #ifndef TESTS_BOUNDED_PTR_TEST_UTILS_H 2*c54f35caSApple OSS Distributions #define TESTS_BOUNDED_PTR_TEST_UTILS_H 3*c54f35caSApple OSS Distributions 4*c54f35caSApple OSS Distributions #include <cassert> 5*c54f35caSApple OSS Distributions #include <libkern/c++/bounded_ptr.h> 6*c54f35caSApple OSS Distributions 7*c54f35caSApple OSS Distributions namespace { 8*c54f35caSApple OSS Distributions struct test_policy { 9*c54f35caSApple OSS Distributions static void traptest_policy10*c54f35caSApple OSS Distributions trap(char const*) 11*c54f35caSApple OSS Distributions { 12*c54f35caSApple OSS Distributions assert(false); 13*c54f35caSApple OSS Distributions } 14*c54f35caSApple OSS Distributions }; 15*c54f35caSApple OSS Distributions 16*c54f35caSApple OSS Distributions template <typename T> 17*c54f35caSApple OSS Distributions using test_bounded_ptr = libkern::bounded_ptr<T, test_policy>; 18*c54f35caSApple OSS Distributions } // end anonymous namespace 19*c54f35caSApple OSS Distributions 20*c54f35caSApple OSS Distributions #endif // !TESTS_BOUNDED_PTR_TEST_UTILS_H 21