diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-24 02:13:48 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-24 02:13:48 +0100 |
| commit | 65a8349aa5526d071b18cd4d42586c46faaa3823 (patch) | |
| tree | f6e2063319ceaaa02f523fb5c289e4f37411a2df /dev/lib/tests | |
| parent | df4ec096491ded6d58b9ee094d6942e3188c2d4a (diff) | |
feat! breaking changes for OCL v1.0.48.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/lib/tests')
| -rw-r--r-- | dev/lib/tests/gtest.hpp | 10 | ||||
| -rw-r--r-- | dev/lib/tests/hpptest.hpp | 90 |
2 files changed, 0 insertions, 100 deletions
diff --git a/dev/lib/tests/gtest.hpp b/dev/lib/tests/gtest.hpp deleted file mode 100644 index ee328b0..0000000 --- a/dev/lib/tests/gtest.hpp +++ /dev/null @@ -1,10 +0,0 @@ -/* - * File: tests/gtest.hpp - * Purpose: Google Test wrapper for the OCL library. - * Author: Amlal El Mahrouss (amlal@nekernel.org) - * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License. - */ - -#pragma once - -#include <gtest/gtest.h> diff --git a/dev/lib/tests/hpptest.hpp b/dev/lib/tests/hpptest.hpp deleted file mode 100644 index a3136b7..0000000 --- a/dev/lib/tests/hpptest.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * File: tests/hpptest.hpp - * Purpose: HPP Test wrapper for the OCL library. - * Author: Amlal El Mahrouss (amlal@nekernel.org) - * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License. - */ - -#pragma once - -#include <lib/io/print.hpp> -#include <cstdlib> - -namespace ocl::hpptest -{ - /// @brief Standard termination error handler, called when a test fails. - struct standard_terminate final - { - template <bool stop_execution = true> - static void error() noexcept - { - ocl::io::print("standard_terminate::error, terminating...\n"); - - if (stop_execution) - std::terminate(); - } - }; - - struct posix_terminate final - { - template <bool stop_execution = true, errno_t args> - static void error(errno_t err) noexcept - { - ocl::io::print("posix_terminate::error: expected=", strerror(args), ", got=", strerror(err), "\n"); - - if (stop_execution) - std::terminate(); - } - }; - - typedef bool condition_type; - - template <condition_type expr = true> - consteval inline void must_pass() - { -#ifdef OCL_HPPTEST - OCL_HPPTEST_ASSERT(expr); -#endif // _WIN32 - } - - template <condition_type expect, typename on_fail> - inline void must_pass(condition_type cond) noexcept - { - if (cond != expect) - { - on_fail::template error<true>(); - } - } - - template <errno_t expect = 0> - inline void must_pass(errno_t ern) noexcept - { - if (ern != expect) - { - posix_terminate::error<true, expect>(ern); - } - } - -#ifdef _WIN32 - struct win32_terminate final - { - template <bool stop_execution = false> - static void error(HRESULT err) noexcept - { - ocl::io::print("win32_terminate::error: expected=S_OK, got=", err, "\n"); - - if (stop_execution) - std::terminate(); - } - }; - - template <HRESULT expect = S_OK> - inline void must_pass(HRESULT hr) noexcept - { - if (hr != expect) - { - win32_terminate::error<true>(hr); - } - } -#endif // _WIN32 -} // namespace ocl::hpptest |
