1 // 2 // Tests for 3 // bounded_array_ref(); 4 // 5 6 #include <libkern/c++/bounded_array_ref.h> 7 #include "test_policy.h" 8 #include <darwintest.h> 9 #include <darwintest_utils.h> 10 11 struct T { int i; }; 12 13 template <typename T> 14 static void tests()15tests() 16 { 17 { 18 test_bounded_array_ref<T> view; 19 CHECK(view.data() == nullptr); 20 CHECK(view.size() == 0); 21 } 22 { 23 test_bounded_array_ref<T> view{}; 24 CHECK(view.data() == nullptr); 25 CHECK(view.size() == 0); 26 } 27 { 28 test_bounded_array_ref<T> view = test_bounded_array_ref<T>(); 29 CHECK(view.data() == nullptr); 30 CHECK(view.size() == 0); 31 } 32 } 33 34 T_DECL(ctor_default, "bounded_array_ref.ctor.default", T_META_TAG_VM_PREFERRED) { 35 tests<T>(); 36 tests<T const>(); 37 } 38