blob: 3cc336fe4cb32c26e7b601be8d2cce8cdf5b7465 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
// File: option.test.cpp
// Purpose; Option test for OCL.
/// @brief This unit test checks if the 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);
}
|