From cd5f71ead79201619a651a6467dd86ab72b93e23 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 21 Dec 2025 15:16:21 +0100 Subject: feat: add option test file. Signed-off-by: Amlal El Mahrouss --- test/option.test.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/option.test.cpp 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 + +#define BOOST_TEST_MODULE option +#include + +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 -- cgit v1.2.3