]> git.saurik.com Git - apple/xnu.git/blob - tests/bounded_array_ref_src/ctor.default.cpp
xnu-7195.101.1.tar.gz
[apple/xnu.git] / tests / bounded_array_ref_src / ctor.default.cpp
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
15 tests()
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") {
35 tests<T>();
36 tests<T const>();
37 }