xref: /xnu-8792.41.9/tests/safe_allocation_src/ctor.copy.cpp (revision 5c2921b07a2480ab43ec66f5b9e41cb872bc554f)
1*5c2921b0SApple OSS Distributions //
2*5c2921b0SApple OSS Distributions // Tests for
3*5c2921b0SApple OSS Distributions //  safe_allocation(safe_allocation const&) = delete;
4*5c2921b0SApple OSS Distributions //
5*5c2921b0SApple OSS Distributions 
6*5c2921b0SApple OSS Distributions #include <libkern/c++/safe_allocation.h>
7*5c2921b0SApple OSS Distributions #include <type_traits>
8*5c2921b0SApple OSS Distributions #include <darwintest.h>
9*5c2921b0SApple OSS Distributions #include "test_utils.h"
10*5c2921b0SApple OSS Distributions 
11*5c2921b0SApple OSS Distributions struct T {
12*5c2921b0SApple OSS Distributions 	int i;
13*5c2921b0SApple OSS Distributions };
14*5c2921b0SApple OSS Distributions 
15*5c2921b0SApple OSS Distributions T_DECL(ctor_copy, "safe_allocation.ctor.copy") {
16*5c2921b0SApple OSS Distributions 	static_assert(!std::is_copy_constructible_v<test_safe_allocation<T> >);
17*5c2921b0SApple OSS Distributions 	T_PASS("safe_allocation.ctor.copy passed");
18*5c2921b0SApple OSS Distributions }
19