Loading...
--- xnu/xnu-12377.101.15/tests/safe_allocation_src/operator.bool.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// Tests for
-// explicit operator bool() const;
-//
-
-#include <libkern/c++/safe_allocation.h>
-#include <darwintest.h>
-#include "test_utils.h"
-#include <type_traits>
-
-struct T {
- int i;
-};
-
-template <typename T>
-static void
-tests()
-{
- {
- test_safe_allocation<T> const array(10, libkern::allocate_memory);
- CHECK(static_cast<bool>(array));
- if (array) {
- } else {
- CHECK(FALSE);
- }
- }
- {
- test_safe_allocation<T> const array = nullptr;
- CHECK(!static_cast<bool>(array));
- if (!array) {
- } else {
- CHECK(FALSE);
- }
- }
-
- static_assert(!std::is_convertible_v<test_safe_allocation<T>, bool>);
-}
-
-T_DECL(operator_bool, "safe_allocation.operator.bool", T_META_TAG_VM_PREFERRED) {
- tests<T>();
- tests<T const>();
-}