]>
git.saurik.com Git - apple/xnu.git/blob - tests/intrusive_shared_ptr_src/ctor.ptr.no_retain.cpp
df0894f2b10ada14615b7aeac23d2ca4ba139237
3 // explicit intrusive_shared_ptr(pointer p, no_retain_t);
6 #include <libkern/c++/intrusive_shared_ptr.h>
7 #include <darwintest.h>
8 #include <darwintest_utils.h>
9 #include "test_policy.h"
13 template <typename T
, typename TQual
>
20 test_policy::retain_count
= 0;
21 libkern::intrusive_shared_ptr
<TQual
, test_policy
> ptr(&obj
, libkern::no_retain
);
22 CHECK(ptr
.get() == &obj
);
23 CHECK(test_policy::retain_count
== 0);
26 test_policy::retain_count
= 0;
27 libkern::intrusive_shared_ptr
<TQual
, test_policy
> ptr
{&obj
, libkern::no_retain
};
28 CHECK(ptr
.get() == &obj
);
29 CHECK(test_policy::retain_count
== 0);
33 T_DECL(ctor_ptr_no_retain
, "intrusive_shared_ptr.ctor.ptr.no_retain") {