From 4c65791784813d00cb976da9ad7b4215f0ad03db Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 23 Mar 2026 22:59:53 +0100 Subject: [CHORE] Cleanup examples and tests directories. Signed-off-by: Amlal El Mahrouss --- test/standard_tests/allocator_op.test.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/standard_tests/allocator_op.test.cpp (limited to 'test/standard_tests/allocator_op.test.cpp') diff --git a/test/standard_tests/allocator_op.test.cpp b/test/standard_tests/allocator_op.test.cpp new file mode 100644 index 0000000..0982dcd --- /dev/null +++ b/test/standard_tests/allocator_op.test.cpp @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: BSL-1.0 +// Copyright 2025-2026, Amlal El Mahrouss (amlal@nekernel.org) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// Official repository: https://github.com/ocl-foss-org/core + +/// @author Amlal El Mahrouss + +#include + +#define BOOST_TEST_MODULE allocator_op +#include + +BOOST_AUTO_TEST_CASE(allocator_should_succeed) +{ + auto ptr = ocl::allocator{}.construct_array<10>(); + int* arr = ptr.get(); + BOOST_TEST(arr != nullptr); + + for (auto i{0ul}; i < 10; ++i) + { + *(arr + i) = 10; + BOOST_TEST(*(arr + i) == 10); + } +} -- cgit v1.2.3