]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/test/doc/examples/decorator_08.run-fail.cpp
1 // (C) Copyright Andrzej Krzemienski 2015.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
9 #define BOOST_TEST_MODULE decorator_08
10 #include <boost/test/included/unit_test.hpp>
11 namespace utf
= boost::unit_test
;
12 namespace tt
= boost::test_tools
;
14 BOOST_AUTO_TEST_CASE(test1
)
19 BOOST_AUTO_TEST_CASE(test2
)
27 if_either(std::string t1
, std::string t2
)
30 tt::assertion_result
operator()(utf::test_unit_id
)
32 auto& master
= utf::framework::master_test_suite();
33 auto& collector
= utf::results_collector_t::instance();
34 auto& test1_result
= collector
.results(master
.get(tc1
));
35 auto& test2_result
= collector
.results(master
.get(tc2
));
37 if (test1_result
.passed() || test2_result
.passed())
40 tt::assertion_result
ans(false);
41 ans
.message() << tc1
<< " and " << tc2
<< " failed";
46 BOOST_AUTO_TEST_CASE(test3
,
47 * utf::precondition(if_either("test1", "test2")))
52 BOOST_AUTO_TEST_CASE(test4
,
53 * utf::precondition(if_either("test2", "test3")))