1 //
2 // Tests for
3 //  explicit bounded_ptr();
4 //
5 
6 #include <libkern/c++/bounded_ptr.h>
7 #include <darwintest.h>
8 #include <darwintest_utils.h>
9 #include "test_utils.h"
10 
11 #define _assert(...) T_ASSERT_TRUE((__VA_ARGS__), # __VA_ARGS__)
12 
13 struct T { };
14 
15 template <typename T>
16 static void
17 tests()
18 {
19 	{
20 		test_bounded_ptr<T> p;
21 		_assert(p == nullptr);
22 	}
23 	{
24 		test_bounded_ptr<T> p{};
25 		_assert(p == nullptr);
26 	}
27 }
28 
29 T_DECL(ctor_default, "bounded_ptr.ctor.default") {
30 	tests<T>();
31 	tests<T const>();
32 	tests<T volatile>();
33 	tests<T const volatile>();
34 }
35