95#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
96#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
103#include "gtest/internal/gtest-port.h"
104#include "gtest/internal/gtest-internal.h"
106#if GTEST_HAS_STD_TUPLE_
135template <
typename T, TypeKind kTypeKind>
136class TypeWithoutFormatter {
154 const ::testing::internal::string short_str =
value.ShortDebugString();
155 const ::testing::internal::string pretty_str =
157 short_str : (
"\n" +
value.DebugString());
158 *os << (
"<" + pretty_str +
">");
202template <
typename Char,
typename CharTraits,
typename T>
203::std::basic_ostream<Char, CharTraits>&
operator<<(
204 ::std::basic_ostream<Char, CharTraits>& os,
const T& x) {
205 TypeWithoutFormatter<
T,
234 using namespace ::testing::internal2;
272template <
typename ToPr
int,
typename OtherOperand>
276 return ::testing::PrintToString(
value);
281template <
typename ToPr
int,
size_t N,
typename OtherOperand>
282class FormatForComparison<ToPrint[N], OtherOperand> {
292#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
293 template <typename OtherOperand> \
294 class FormatForComparison<CharType*, OtherOperand> { \
296 static ::std::string Format(CharType* value) { \
297 return ::testing::PrintToString(static_cast<const void*>(value)); \
306#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
311#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
313 class FormatForComparison<CharType*, OtherStringType> { \
315 static ::std::string Format(CharType* value) { \
316 return ::testing::PrintToString(value); \
323#if GTEST_HAS_GLOBAL_STRING
328#if GTEST_HAS_GLOBAL_WSTRING
333#if GTEST_HAS_STD_WSTRING
338#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
348template <
typename T1,
typename T2>
350 const T1&
value,
const T2& ) {
372 const C& container, ::std::ostream* os) {
373 const size_t kMaxCount = 32;
376 for (
typename C::const_iterator it = container.begin();
377 it != container.end(); ++it, ++count) {
380 if (count == kMaxCount) {
406 T* p, ::std::ostream* os) {
427 *os << reinterpret_cast<const void*>(
438 const T&
value, ::std::ostream* os) {
487inline void PrintTo(
char c, ::std::ostream* os) {
491 PrintTo(
static_cast<unsigned char>(c), os);
495inline void PrintTo(
bool x, ::std::ostream* os) {
496 *os << (x ?
"true" :
"false");
510inline void PrintTo(
char*
s, ::std::ostream* os) {
516inline void PrintTo(
const signed char*
s, ::std::ostream* os) {
519inline void PrintTo(
signed char*
s, ::std::ostream* os) {
522inline void PrintTo(
const unsigned char*
s, ::std::ostream* os) {
525inline void PrintTo(
unsigned char*
s, ::std::ostream* os) {
534#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
537inline void PrintTo(
wchar_t*
s, ::std::ostream* os) {
550 for (
size_t i = 1;
i !=
count;
i++) {
557#if GTEST_HAS_GLOBAL_STRING
559inline void PrintTo(const ::string&
s, ::std::ostream* os) {
565inline void PrintTo(const ::std::string&
s, ::std::ostream* os) {
570#if GTEST_HAS_GLOBAL_WSTRING
571GTEST_API_ void PrintWideStringTo(const ::wstring&
s, ::std::ostream* os);
572inline void PrintTo(const ::wstring&
s, ::std::ostream* os) {
573 PrintWideStringTo(
s, os);
577#if GTEST_HAS_STD_WSTRING
578GTEST_API_ void PrintWideStringTo(const ::std::wstring&
s, ::std::ostream* os);
579inline void PrintTo(const ::std::wstring&
s, ::std::ostream* os) {
580 PrintWideStringTo(
s, os);
584#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
588void PrintTupleTo(
const T& t, ::std::ostream* os);
591#if GTEST_HAS_TR1_TUPLE
600inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
604template <
typename T1>
605void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
609template <
typename T1,
typename T2>
610void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
614template <
typename T1,
typename T2,
typename T3>
615void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
619template <
typename T1,
typename T2,
typename T3,
typename T4>
620void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
624template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
625void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
626 ::std::ostream* os) {
630template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
632void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
633 ::std::ostream* os) {
637template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
638 typename T6,
typename T7>
639void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
640 ::std::ostream* os) {
644template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
645 typename T6,
typename T7,
typename T8>
646void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
647 ::std::ostream* os) {
651template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
652 typename T6,
typename T7,
typename T8,
typename T9>
653void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
654 ::std::ostream* os) {
658template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
659 typename T6,
typename T7,
typename T8,
typename T9,
typename T10>
661 const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
662 ::std::ostream* os) {
667#if GTEST_HAS_STD_TUPLE_
668template <
typename... Types>
669void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
675template <
typename T1,
typename T2>
676void PrintTo(const ::std::pair<T1, T2>&
value, ::std::ostream* os) {
721 const size_t kThreshold = 18;
722 const size_t kChunkSize = 8;
727 if (len <= kThreshold) {
739 const char* begin,
size_t len, ::std::ostream* os);
743 const wchar_t* begin,
size_t len, ::std::ostream* os);
746template <
typename T,
size_t N>
751 static void Print(
const T (&
a)[N], ::std::ostream* os) {
758class UniversalPrinter<
T&> {
767 *os <<
"@" <<
reinterpret_cast<const void*
>(&
value) <<
" ";
781class UniversalTersePrinter {
788class UniversalTersePrinter<
T&> {
794template <
typename T,
size_t N>
795class UniversalTersePrinter<
T[N]> {
802class UniversalTersePrinter<
const char*> {
804 static void Print(
const char*
str, ::std::ostream* os) {
813class UniversalTersePrinter<char*> {
820#if GTEST_HAS_STD_WSTRING
822class UniversalTersePrinter<
const wchar_t*> {
824 static void Print(
const wchar_t*
str, ::std::ostream* os) {
837 static void Print(
wchar_t*
str, ::std::ostream* os) {
859typedef ::std::vector<string>
Strings;
868template <
typename TupleT>
871#if GTEST_HAS_TR1_TUPLE
872template <
typename TupleT>
874 typedef TupleT Tuple;
875 static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
878 struct tuple_element : ::std::tr1::tuple_element<I, Tuple> {};
881 static typename AddReference<
882 const typename ::std::tr1::tuple_element<I, Tuple>::type>::type
get(
883 const Tuple& tuple) {
884 return ::std::tr1::get<I>(tuple);
887template <
typename TupleT>
891#if GTEST_HAS_STD_TUPLE_
892template <
typename... Types>
894 typedef ::std::tuple<Types...> Tuple;
895 static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
898 struct tuple_element : ::std::tuple_element<I, Tuple> {};
901 static const typename ::std::tuple_element<I, Tuple>::type&
get(
902 const Tuple& tuple) {
903 return ::std::get<I>(tuple);
906template <
typename... Types>
907const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
910#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
920struct TuplePrefixPrinter {
922 template <
typename Tuple>
923 static void PrintPrefixTo(
const Tuple& t, ::std::ostream* os) {
924 TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
931 typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
932 ::Print(TuplePolicy<Tuple>::template
get<N - 1>(t), os);
937 template <
typename Tuple>
938 static void TersePrintPrefixToStrings(
const Tuple& t, Strings* strings) {
939 TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
940 ::std::stringstream ss;
942 strings->push_back(ss.str());
948struct TuplePrefixPrinter<0> {
949 template <
typename Tuple>
950 static void PrintPrefixTo(
const Tuple&, ::std::ostream*) {}
952 template <
typename Tuple>
953 static void TersePrintPrefixToStrings(
const Tuple&, Strings*) {}
958template <
typename Tuple>
959void PrintTupleTo(
const Tuple& t, ::std::ostream* os) {
961 TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
968template <
typename Tuple>
969Strings UniversalTersePrintTupleFieldsToStrings(
const Tuple&
value) {
971 TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
981 ::std::stringstream ss;
991#include "gtest/internal/custom/gtest-printers.h"
#define s(x, c)
Definition aesb.c:47
static const bool value
Definition gtest-internal.h:891
static void Print(const T &value, ::std::ostream *os)
Definition gtest-printers.h:764
static void Print(const T(&a)[N], ::std::ostream *os)
Definition gtest-printers.h:751
Definition gtest-printers.h:689
static void Print(const T &value, ::std::ostream *os)
Definition gtest-printers.h:698
static void Print(const T &value, ::std::ostream *os)
Definition gtest-printers.h:790
static void Print(const T(&value)[N], ::std::ostream *os)
Definition gtest-printers.h:797
static void Print(char *str, ::std::ostream *os)
Definition gtest-printers.h:815
static void Print(const char *str, ::std::ostream *os)
Definition gtest-printers.h:804
static void Print(wchar_t *str, ::std::ostream *os)
Definition gtest-printers.h:837
Definition gtest-printers.h:781
static void Print(const T &value, ::std::ostream *os)
Definition gtest-printers.h:783
#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)
Definition gtest-printers.h:292
#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType)
Definition gtest-printers.h:311
#define GTEST_INTENTIONAL_CONST_COND_PUSH_()
Definition gtest-port.h:897
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
Definition gtest-port.h:317
#define GTEST_API_
Definition gtest-port.h:934
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
Definition gtest-port.h:318
#define GTEST_INTENTIONAL_CONST_COND_POP_()
Definition gtest-port.h:899
void get(std::istream &input, bool &res)
Definition io.h:61
#define const
Definition ipfrdr.c:80
mdb_size_t count(MDB_cursor *cur)
Definition value_stream.cpp:40
int i
Definition pymoduletest.py:23
p
Definition pymoduletest.py:75
Definition gtest-printers.h:114
const size_t kProtobufOneLinerMaxLength
Definition gtest-printers.h:148
GTEST_API_ void PrintBytesInObjectTo(const unsigned char *obj_bytes, size_t count, ::std::ostream *os)
::std::basic_ostream< Char, CharTraits > & operator<<(::std::basic_ostream< Char, CharTraits > &os, const T &x)
Definition gtest-printers.h:203
TypeKind
Definition gtest-printers.h:124
@ kConvertibleToInteger
Definition gtest-printers.h:126
@ kOtherType
Definition gtest-printers.h:128
@ kProtobuf
Definition gtest-printers.h:125
Definition gmock-actions.h:64
bool_constant< true > true_type
Definition gtest-port.h:2210
long long BiggestInt
Definition gtest-port.h:2241
void UniversalPrint(const T &value, ::std::ostream *os)
Definition gtest-printers.h:852
GTEST_API_ bool IsTrue(bool condition)
Definition gtest.cc:4986
GTEST_API_ void PrintStringTo(const ::std::string &s, ::std::ostream *os)
::std::string string
Definition gtest-port.h:1097
void PrintTo(const ReferenceWrapper< T > &ref, ::std::ostream *os)
Definition gmock-actions.h:964
std::string FormatForComparisonFailureMessage(const T1 &value, const T2 &)
Definition gtest-printers.h:349
bool_constant< false > false_type
Definition gtest-port.h:2209
To ImplicitCast_(To x)
Definition gtest-port.h:1343
const bool ImplicitlyConvertible< From, To >::value
Definition gtest-internal.h:897
::std::vector< string > Strings
Definition gtest-printers.h:859
char IsNotContainer
Definition gtest-internal.h:938
void DefaultPrintTo(IsContainer, false_type, const C &container, ::std::ostream *os)
Definition gtest-printers.h:370
IsContainer IsContainerTest(int, typename C::iterator *=NULL, typename C::const_iterator *=NULL)
Definition gtest-internal.h:932
TypeWithSize< 8 >::UInt UInt64
Definition gtest-port.h:2497
void PrintRawArrayTo(const T a[], size_t count, ::std::ostream *os)
Definition gtest-printers.h:548
void UniversalPrintArray(const T *begin, size_t len, ::std::ostream *os)
Definition gtest-printers.h:716
int IsContainer
Definition gtest-internal.h:930
void UniversalTersePrint(const T &value, ::std::ostream *os)
Definition gtest-printers.h:843
Definition gtest-printers.h:217
void DefaultPrintNonContainerTo(const T &value, ::std::ostream *os)
Definition gtest-printers.h:222
Definition gmock-actions.h:53
::std::string PrintToString(const T &value)
Definition gtest-printers.h:980
const GenericPointer< typename T::ValueType > T2 value
Definition pointer.h:1225
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1124
const char *const str
Definition portlistingparse.c:23
tools::wallet2::message_signature_result_t result
Definition signature.cpp:62
if(!cryptonote::get_account_address_from_str_or_url(info, cryptonote::TESTNET, "9uVsvEryzpN8WH2t1WWhFFCG5tS8cBNdmJYNRuckLENFimfauV5pZKeS1P2CbxGkSDTUPHXWwiYE5ZGSXDAGbaZgDxobqDN"))
Definition signature.cpp:53
Definition gtest-printers.h:869
static const bool value
Definition gtest-port.h:2205
Definition gtest-port.h:2213