]>
git.saurik.com Git - apple/xnu.git/blob - tests/intrusive_shared_ptr_src/test_policy.h
1 #ifndef TESTS_INTRUSIVE_SHARED_PTR_TEST_POLICY_H
2 #define TESTS_INTRUSIVE_SHARED_PTR_TEST_POLICY_H
4 #include <libkern/c++/intrusive_shared_ptr.h>
5 #include <darwintest_utils.h>
8 static inline int retain_count
= 0;
24 struct tracking_policy
{
25 static inline int retains
= 0;
26 static inline int releases
= 0;
27 static inline int refcount
= 0;
28 static inline bool hit_zero
= false;
73 using tracked_shared_ptr
= libkern::intrusive_shared_ptr
<T
, tracking_policy
>;
76 using test_shared_ptr
= libkern::intrusive_shared_ptr
<T
, test_policy
>;
78 #define CHECK(...) T_ASSERT_TRUE((__VA_ARGS__), # __VA_ARGS__)
80 #endif // !TESTS_INTRUSIVE_SHARED_PTR_TEST_POLICY_H