]> git.saurik.com Git - apple/xnu.git/blobdiff - 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
diff --git a/tests/bounded_ptr_src/test_utils.h b/tests/bounded_ptr_src/test_utils.h
new file mode 100644 (file)
index 0000000..3e1601f
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef TESTS_BOUNDED_PTR_TEST_UTILS_H
+#define TESTS_BOUNDED_PTR_TEST_UTILS_H
+
+#include <cassert>
+#include <libkern/c++/bounded_ptr.h>
+
+namespace {
+struct test_policy {
+       static void
+       trap(char const*)
+       {
+               assert(false);
+       }
+};
+
+template <typename T>
+using test_bounded_ptr = libkern::bounded_ptr<T, test_policy>;
+} // end anonymous namespace
+
+#endif // !TESTS_BOUNDED_PTR_TEST_UTILS_H