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