1 #ifndef TESTS_BOUNDED_ARRAY_SRC_TEST_POLICY_H 2 #define TESTS_BOUNDED_ARRAY_SRC_TEST_POLICY_H 3 4 #include <assert.h> 5 #include <darwintest_utils.h> 6 #include <libkern/c++/bounded_array.h> 7 #include <libkern/c++/bounded_ptr.h> 8 #include <stddef.h> 9 10 struct test_policy { 11 static void traptest_policy12 trap(char const*) 13 { 14 assert(false); 15 } 16 }; 17 18 template <typename T, size_t N> 19 using test_bounded_array = libkern::bounded_array<T, N, test_policy>; 20 21 template <typename T> 22 using test_bounded_ptr = libkern::bounded_ptr<T, test_policy>; 23 24 #define CHECK(...) T_ASSERT_TRUE((__VA_ARGS__), # __VA_ARGS__) 25 26 #endif // !TESTS_BOUNDED_ARRAY_SRC_TEST_POLICY_H 27