]>
git.saurik.com Git - apple/xnu.git/blob - tests/intrusive_shared_ptr_src/compare.equal.cpp
3 // template <typename T, typename U, typename R>
4 // bool operator==(intrusive_shared_ptr<T, R> const& x, intrusive_shared_ptr<U, R> const& y);
6 // template <typename T, typename U, typename R>
7 // bool operator!=(intrusive_shared_ptr<T, R> const& x, intrusive_shared_ptr<U, R> const& y);
10 #include <libkern/c++/intrusive_shared_ptr.h>
11 #include <darwintest.h>
12 #include "test_policy.h"
14 struct Base
{ int i
; };
15 struct Derived
: Base
{ };
19 template <typename T
, typename U
>
29 template <typename T
, typename U
>
39 template <typename T
, typename TQual
>
47 test_shared_ptr
<TQual
> const a(&obj1
, libkern::no_retain
);
48 test_shared_ptr
<TQual
> const b(&obj2
, libkern::no_retain
);
53 test_shared_ptr
<TQual
> const a(&obj1
, libkern::no_retain
);
54 test_shared_ptr
<TQual
> const b(&obj1
, libkern::no_retain
);
59 test_shared_ptr
<TQual
> const a
= nullptr;
60 test_shared_ptr
<TQual
> const b(&obj2
, libkern::no_retain
);
65 test_shared_ptr
<TQual
> const a
= nullptr;
66 test_shared_ptr
<TQual
> const b
= nullptr;
71 template <typename T
, typename RelatedT
>
76 test_shared_ptr
<T
> const a(&obj
, libkern::no_retain
);
77 test_shared_ptr
<RelatedT
> const b(&obj
, libkern::no_retain
);
81 T_DECL(compare_equal
, "intrusive_shared_ptr.compare.equal") {
84 tests_convert
<Derived
, Base
>();
85 tests_convert
<Derived
, Base
const>();