diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-21 15:16:21 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-21 15:16:21 +0100 |
| commit | cd5f71ead79201619a651a6467dd86ab72b93e23 (patch) | |
| tree | 2998e2a036681c89e0cee00d2e2e18699edda21a /test/option.test.cpp | |
| parent | 185335e8efcac46e96e25e5a50e0d4b93152f983 (diff) | |
feat: add option test file.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'test/option.test.cpp')
| -rw-r--r-- | test/option.test.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/option.test.cpp b/test/option.test.cpp new file mode 100644 index 0000000..098d0aa --- /dev/null +++ b/test/option.test.cpp @@ -0,0 +1,33 @@ +// File: option.test.cpp +// Purpose; Option test for OCL. +/// @brief This unit test checks if the unit test fails with the expected value. +/// @author Amlal El Mahrouss + +#include <ocl/option.hpp> + +#define BOOST_TEST_MODULE option +#include <boost/test/included/unit_test.hpp> + +BOOST_AUTO_TEST_CASE( option_should_fail ) +{ + bool ret = false; + try { + ocl::option opt(ocl::eval_false()); + opt.expect(""); + } catch (...) { + ret = true; + } + BOOST_TEST( ret == true ); +} + +BOOST_AUTO_TEST_CASE( option_should_succeed ) +{ + bool ret = true; + try { + ocl::option opt(ocl::eval_true()); + opt.expect(""); + } catch (...) { + ret = false; + } + BOOST_TEST( ret == true ); +}
\ No newline at end of file |
