summaryrefslogtreecommitdiffhomepage
path: root/test/option.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/option.test.cpp')
-rw-r--r--test/option.test.cpp33
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