]> git.saurik.com Git - apple/xnu.git/blame - tests/bounded_array_src/test_policy.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / tests / bounded_array_src / test_policy.h
CommitLineData
f427ee49
A
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
10struct test_policy {
11 static void
12 trap(char const*)
13 {
14 assert(false);
15 }
16};
17
18template <typename T, size_t N>
19using test_bounded_array = libkern::bounded_array<T, N, test_policy>;
20
21template <typename T>
22using 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