Loading...
tests/safe_allocation_src/data.cpp xnu-12377.101.15 /dev/null
--- xnu/xnu-12377.101.15/tests/safe_allocation_src/data.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// Tests for
-//      T* data();
-//      T const* data() const;
-//
-
-#include <libkern/c++/safe_allocation.h>
-#include <darwintest.h>
-#include "test_utils.h"
-
-struct T {
-	int i;
-};
-
-template <typename T>
-static void
-tests()
-{
-	{
-		test_safe_allocation<T> array(10, libkern::allocate_memory);
-		CHECK(array.data() != nullptr);
-	}
-	{
-		T* memory = reinterpret_cast<T*>(malloc_allocator::allocate(10 * sizeof(T)));
-		test_safe_allocation<T> array(memory, 10, libkern::adopt_memory);
-		T* data = array.data();
-		CHECK(data == memory);
-	}
-	{
-		T* memory = reinterpret_cast<T*>(malloc_allocator::allocate(10 * sizeof(T)));
-		test_safe_allocation<T> const array(memory, 10, libkern::adopt_memory);
-		T const* data = array.data();
-		CHECK(data == memory);
-	}
-}
-
-T_DECL(data, "safe_allocation.data", T_META_TAG_VM_PREFERRED) {
-	tests<T>();
-	tests<T const>();
-}