diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-22 08:00:32 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-22 08:01:51 +0100 |
| commit | 11c218683eccb6cd5166aa8dcb8a051b421b0b40 (patch) | |
| tree | 9bc4c76b54fbdcb54f53540301588ba46aa32c66 /test | |
| parent | cd5f71ead79201619a651a6467dd86ab72b93e23 (diff) | |
feat: Add more tests and Jamfile. Improve allocator_op and basic_hash APIs.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'test')
| -rw-r--r-- | test/.keep | 0 | ||||
| -rw-r--r-- | test/Jamfile | 17 | ||||
| -rw-r--r-- | test/allocator_op.test.cpp | 16 | ||||
| -rw-r--r-- | test/option.test.cpp | 2 |
4 files changed, 34 insertions, 1 deletions
diff --git a/test/.keep b/test/.keep deleted file mode 100644 index e69de29..0000000 --- a/test/.keep +++ /dev/null diff --git a/test/Jamfile b/test/Jamfile new file mode 100644 index 0000000..853d246 --- /dev/null +++ b/test/Jamfile @@ -0,0 +1,17 @@ +# /* +# * File: Jamfile +# * Author: Amlal El Mahrouss, +# * Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License +# */ + +project tests +: default-build debug +; + +exe option.test.o + : option.test.cpp + : <toolset>gcc : <cxxflags>-std=c++20 ; + +exe allocator_op.test.o + : allocator_op.test.cpp + : <toolset>gcc : <cxxflags>-std=c++20 ;
\ No newline at end of file diff --git a/test/allocator_op.test.cpp b/test/allocator_op.test.cpp new file mode 100644 index 0000000..fa2a049 --- /dev/null +++ b/test/allocator_op.test.cpp @@ -0,0 +1,16 @@ +// File: allocator.test.cpp +// Purpose; Allocator test for OCL. +/// @brief This unit test checks if the test succeeds. +/// @author Amlal El Mahrouss + +#include <ocl/allocator_op.hpp> + +#define BOOST_TEST_MODULE allocator_op +#include <boost/test/included/unit_test.hpp> + +BOOST_AUTO_TEST_CASE( allocator_should_succeed ) +{ + auto ptr = ocl::allocator<int>{}.construct_array<10>(); + int* arr = ptr.get(); + BOOST_TEST( arr != nullptr ); +}
\ No newline at end of file diff --git a/test/option.test.cpp b/test/option.test.cpp index 098d0aa..211f044 100644 --- a/test/option.test.cpp +++ b/test/option.test.cpp @@ -1,6 +1,6 @@ // File: option.test.cpp // Purpose; Option test for OCL. -/// @brief This unit test checks if the unit test fails with the expected value. +/// @brief This unit test checks if the test fails with the expected value. /// @author Amlal El Mahrouss #include <ocl/option.hpp> |
