]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/log/test/run/src_record_ostream.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / log / test / run / src_record_ostream.cpp
index adba3408e182a2bfa0135693312e574838c55cb5..dd321f922c94ca8efb68fefd354852d6f577ce89 100644 (file)
@@ -21,6 +21,9 @@
 #include <iostream>
 #include <algorithm>
 #include <boost/config.hpp>
+#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
+#include <string_view>
+#endif
 #include <boost/test/unit_test.hpp>
 #include <boost/utility/string_view.hpp>
 #include <boost/log/core/record.hpp>
@@ -243,6 +246,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(width_formatting, CharT, char_types)
     test::BOOST_NESTED_TEMPLATE width_formatting< const CharT* >();
     test::BOOST_NESTED_TEMPLATE width_formatting< typename test::string_type >();
     test::BOOST_NESTED_TEMPLATE width_formatting< boost::basic_string_view< CharT > >();
+#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
+    test::BOOST_NESTED_TEMPLATE width_formatting< std::basic_string_view< CharT > >();
+#endif
 }
 
 // Test support for filler character setup
@@ -252,6 +258,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(fill_formatting, CharT, char_types)
     test::BOOST_NESTED_TEMPLATE fill_formatting< const CharT* >();
     test::BOOST_NESTED_TEMPLATE fill_formatting< typename test::string_type >();
     test::BOOST_NESTED_TEMPLATE fill_formatting< boost::basic_string_view< CharT > >();
+#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
+    test::BOOST_NESTED_TEMPLATE fill_formatting< std::basic_string_view< CharT > >();
+#endif
 }
 
 // Test support for text alignment
@@ -261,6 +270,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(alignment, CharT, char_types)
     test::BOOST_NESTED_TEMPLATE alignment< const CharT* >();
     test::BOOST_NESTED_TEMPLATE alignment< typename test::string_type >();
     test::BOOST_NESTED_TEMPLATE alignment< boost::basic_string_view< CharT > >();
+#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
+    test::BOOST_NESTED_TEMPLATE alignment< std::basic_string_view< CharT > >();
+#endif
 }
 
 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
@@ -271,6 +283,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(rvalue_stream, CharT, char_types)
     test::BOOST_NESTED_TEMPLATE rvalue_stream< const CharT* >();
     test::BOOST_NESTED_TEMPLATE rvalue_stream< typename test::string_type >();
     test::BOOST_NESTED_TEMPLATE rvalue_stream< boost::basic_string_view< CharT > >();
+#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
+    test::BOOST_NESTED_TEMPLATE rvalue_stream< std::basic_string_view< CharT > >();
+#endif
 }
 #endif
 
@@ -306,6 +321,20 @@ inline std::basic_ostream< CharT, TraitsT >& operator<< (std::basic_ostream< Cha
     return strm;
 }
 
+template< typename CharT, typename TraitsT >
+inline std::basic_ostream< CharT, TraitsT >& operator<< (std::basic_ostream< CharT, TraitsT >& strm, B*)
+{
+    strm << "B*";
+    return strm;
+}
+
+template< typename CharT, typename TraitsT >
+inline std::basic_ostream< CharT, TraitsT >& operator<< (std::basic_ostream< CharT, TraitsT >& strm, const B*)
+{
+    strm << "const B*";
+    return strm;
+}
+
 class C {};
 template< typename CharT, typename TraitsT >
 inline std::basic_ostream< CharT, TraitsT >& operator<< (std::basic_ostream< CharT, TraitsT >& strm, C const&)
@@ -340,11 +369,12 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(operator_forwarding, CharT, char_types)
     my_namespace::B b; // lvalue
     strm_fmt << a << b << my_namespace::C(); // rvalue
     strm_fmt << my_namespace::eee;
+    strm_fmt << &b << (my_namespace::B const*)&b;
     strm_fmt.flush();
     string_type rec_message = logging::extract_or_throw< string_type >(expr::message.get_name(), rec);
 
     ostream_type strm_correct;
-    strm_correct << a << b << my_namespace::C() << my_namespace::eee;
+    strm_correct << a << b << my_namespace::C() << my_namespace::eee << &b << (my_namespace::B const*)&b;
 
     BOOST_CHECK(equal_strings(rec_message, strm_correct.str()));
 }