]>
git.saurik.com Git - apple/xnu.git/blob - tests/bounded_ptr_src/ctor.nullptr.cpp
3 // bounded_ptr(std::nullptr_t);
6 #include <libkern/c++/bounded_ptr.h>
7 #include <darwintest.h>
8 #include <darwintest_utils.h>
9 #include "test_utils.h"
11 #define _assert(...) T_ASSERT_TRUE((__VA_ARGS__), # __VA_ARGS__)
21 test_bounded_ptr
<T
> p
= nullptr;
22 _assert(p
== nullptr);
25 test_bounded_ptr
<T
> p
{nullptr};
26 _assert(p
== nullptr);
29 test_bounded_ptr
<T
> p(nullptr);
30 _assert(p
== nullptr);
33 test_bounded_ptr
<T
> p
= static_cast<test_bounded_ptr
<T
> >(nullptr);
34 _assert(p
== nullptr);
37 auto f
= [](test_bounded_ptr
<T
> p
) {
38 _assert(p
== nullptr);
45 test_bounded_ptr
<T
> p
= NULL
;
46 _assert(p
== nullptr);
49 test_bounded_ptr
<T
> p
{NULL
};
50 _assert(p
== nullptr);
53 test_bounded_ptr
<T
> p(NULL
);
54 _assert(p
== nullptr);
57 test_bounded_ptr
<T
> p
= static_cast<test_bounded_ptr
<T
> >(NULL
);
58 _assert(p
== nullptr);
61 auto f
= [](test_bounded_ptr
<T
> p
) {
62 _assert(p
== nullptr);
69 test_bounded_ptr
<T
> p
= 0;
70 _assert(p
== nullptr);
73 test_bounded_ptr
<T
> p
{0};
74 _assert(p
== nullptr);
77 test_bounded_ptr
<T
> p(0);
78 _assert(p
== nullptr);
81 test_bounded_ptr
<T
> p
= static_cast<test_bounded_ptr
<T
> >(0);
82 _assert(p
== nullptr);
85 auto f
= [](test_bounded_ptr
<T
> p
) {
86 _assert(p
== nullptr);
92 T_DECL(ctor_nullptr
, "bounded_ptr.ctor.nullptr") {
96 tests
<T
const volatile>();