]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/test/test/writing-test-ts/fp-no-comparison-for-incomplete-types-test.cpp
1 // (C) Copyright Raffi Enficiaud 2019
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.
8 #define BOOST_TEST_MAIN
9 #include <boost/test/unit_test.hpp>
11 // https://github.com/boostorg/test/issues/209
12 // no floating point comparison for abstract types.
15 virtual ~abstract() = 0;
16 bool operator==(const abstract
&) const { return true; }
19 std::ostream
&operator<<(std::ostream
&ostr
, const abstract
&) {
20 return ostr
<< "compared";
23 // the test is checking the compilation of the following snippet
26 // pre-C++11 compilers use a copy of the arguments in the
27 // expansion of the BOOST_TEST macro
28 #if !defined(BOOST_TEST_MACRO_LIMITED_SUPPORT)
30 BOOST_TEST_CHECK(a
== a
);
31 BOOST_TEST_REQUIRE(a
== a
);
32 BOOST_TEST_WARN(a
== a
);
34 BOOST_CHECK_EQUAL(a
, a
);
37 // we need at least one test
38 BOOST_AUTO_TEST_CASE(dummy
)