40 #include <forward_list>
46 #include <unordered_map>
47 #include <unordered_set>
51 #include "gtest/gtest-printers.h"
52 #include "gtest/gtest.h"
74 return os << (e ==
kEWS1 ?
"kEWS1" :
"invalid");
83 *os << (e ==
kEWPT1 ?
"kEWPT1" :
"invalid");
108 os <<
"StreamableInGlobal";
112 os <<
"StreamableInGlobal*";
121 double z()
const {
return z_; }
133 void PrintTo(
const PrintableViaPrintTo& x, ::std::ostream* os) {
134 *os <<
"PrintableViaPrintTo: " <<
x.value;
142 const PointerPrintable* ) {
143 return os <<
"PointerPrintable*";
147 template <
typename T>
157 template <
typename T>
158 void PrintTo(
const PrintableViaPrintToTemplate<T>& x, ::std::ostream* os) {
159 *os <<
"PrintableViaPrintToTemplate: " <<
x.value();
163 template <
typename T>
173 template <
typename T>
175 const StreamableTemplateInFoo<T>& x) {
176 return os <<
"StreamableTemplateInFoo: " <<
x.value();
200 return os <<
"Streamable-PathLike";
207 namespace gtest_printers_test {
211 using ::std::make_pair;
213 using ::std::multimap;
214 using ::std::multiset;
221 using ::testing::internal::NativeArray;
222 using ::testing::internal::RE;
223 using ::testing::internal::RelationToSourceReference;
226 using ::testing::internal::UniversalPrinter;
232 template <
typename T>
234 ::std::stringstream ss;
242 template <
typename T>
244 ::std::stringstream ss;
280 TEST(PrintCharTest, PlainChar) {
300 TEST(PrintCharTest, SignedChar) {
303 Print(
static_cast<signed char>(-50)));
307 TEST(PrintCharTest, UnsignedChar) {
310 Print(
static_cast<unsigned char>(
'b')));
322 TEST(PrintBuiltInTypeTest, Wchar_t) {
339 EXPECT_EQ(
"L'\\x576' (1398)",
Print(
static_cast<wchar_t>(0x576)));
340 EXPECT_EQ(
"L'\\xC74D' (51021)",
Print(
static_cast<wchar_t>(0xC74D)));
344 TEST(PrintTypeSizeTest, Wchar_t) {
349 TEST(PrintBuiltInTypeTest, Integer) {
350 EXPECT_EQ(
"'\\xFF' (255)",
Print(
static_cast<unsigned char>(255)));
351 EXPECT_EQ(
"'\\x80' (-128)",
Print(
static_cast<signed char>(-128)));
363 TEST(PrintBuiltInTypeTest, Size_t) {
365 #if !GTEST_OS_WINDOWS
368 #endif // !GTEST_OS_WINDOWS
372 TEST(PrintBuiltInTypeTest, FloatingPoints) {
381 ::std::stringstream expected_result_stream;
382 expected_result_stream << p;
383 return expected_result_stream.str();
390 const char* p =
"World";
395 TEST(PrintCStringTest, NonConst) {
398 Print(
static_cast<char*
>(p)));
403 const char* p =
nullptr;
408 TEST(PrintCStringTest, EscapesProperly) {
409 const char* p =
"'\"?\\\a\b\f\n\r\t\v\x7F\xFF a";
411 "\\n\\r\\t\\v\\x7F\\xFF a\"",
421 #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
425 const wchar_t* p =
L"World";
430 TEST(PrintWideCStringTest, NonConst) {
433 Print(
static_cast<wchar_t*
>(p)));
437 TEST(PrintWideCStringTest, Null) {
438 const wchar_t* p =
nullptr;
443 TEST(PrintWideCStringTest, EscapesProperly) {
444 const wchar_t s[] = {
'\'',
'"',
'?',
'\\',
'\a',
'\b',
'\f',
'\n',
'\r',
445 '\t',
'\v', 0xD3, 0x576, 0x8D3, 0xC74D,
' ',
'a',
'\0'};
447 "\\n\\r\\t\\v\\xD3\\x576\\x8D3\\xC74D a\"",
448 Print(
static_cast<const wchar_t*
>(s)));
450 #endif // native wchar_t
455 TEST(PrintCharPointerTest, SignedChar) {
456 signed char* p =
reinterpret_cast<signed char*
>(0x1234);
463 TEST(PrintCharPointerTest, ConstSignedChar) {
464 signed char* p =
reinterpret_cast<signed char*
>(0x1234);
471 TEST(PrintCharPointerTest, UnsignedChar) {
472 unsigned char* p =
reinterpret_cast<unsigned char*
>(0x1234);
479 TEST(PrintCharPointerTest, ConstUnsignedChar) {
480 const unsigned char* p =
reinterpret_cast<const unsigned char*
>(0x1234);
490 bool* p =
reinterpret_cast<bool*
>(0xABCD);
497 TEST(PrintPointerToBuiltInTypeTest, Void) {
498 void* p =
reinterpret_cast<void*
>(0xABCD);
505 TEST(PrintPointerToBuiltInTypeTest, ConstVoid) {
506 const void* p =
reinterpret_cast<const void*
>(0xABCD);
513 TEST(PrintPointerToPointerTest, IntPointerPointer) {
514 int** p =
reinterpret_cast<int**
>(0xABCD);
524 TEST(PrintPointerTest, NonMemberFunctionPointer) {
539 template <
typename StringType>
544 const bool is_wide_string =
sizeof(
prefix[0]) > 1;
545 const char*
const begin_string_quote = is_wide_string ?
"L\"" :
"\"";
547 << begin_string_quote <<
prefix <<
"\" is not a prefix of "
548 << begin_string_quote <<
str <<
"\"\n";
565 TEST(PrintPointerTest, MemberVariablePointer) {
570 Print(
sizeof(p)) +
"-byte object "));
577 TEST(PrintPointerTest, MemberFunctionPointer) {
583 int (
Foo::*p)(char) = NULL;
585 Print(
sizeof(p)) +
"-byte object "));
592 template <
typename T,
size_t N>
598 TEST(PrintArrayTest, OneDimensionalArray) {
599 int a[5] = { 1, 2, 3, 4, 5 };
604 TEST(PrintArrayTest, TwoDimensionalArray) {
609 EXPECT_EQ(
"{ { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 0 } }",
PrintArrayHelper(
a));
613 TEST(PrintArrayTest, ConstArray) {
614 const bool a[1] = {
false };
619 TEST(PrintArrayTest, CharArrayWithNoTerminatingNul) {
621 char a[] = {
'H',
'\0',
'i' };
626 TEST(PrintArrayTest, ConstCharArrayWithTerminatingNul) {
627 const char a[] =
"\0Hi";
632 TEST(PrintArrayTest, WCharArrayWithNoTerminatingNul) {
634 const wchar_t a[] = {
L'H',
L'\0',
L'i' };
639 TEST(PrintArrayTest, WConstCharArrayWithTerminatingNul) {
640 const wchar_t a[] =
L"\0Hi";
645 TEST(PrintArrayTest, ObjectArray) {
651 TEST(PrintArrayTest, BigArray) {
652 int a[100] = { 1, 2, 3 };
653 EXPECT_EQ(
"{ 1, 2, 3, 0, 0, 0, 0, 0, ..., 0, 0, 0, 0, 0, 0, 0, 0 }",
660 TEST(PrintStringTest, StringInStdNamespace) {
661 const char s[] =
"'\"?\\\a\b\f\n\0\r\t\v\x7F\xFF a";
663 EXPECT_EQ(
"\"'\\\"?\\\\\\a\\b\\f\\n\\0\\r\\t\\v\\x7F\\xFF a\\0\"",
667 TEST(PrintStringTest, StringAmbiguousHex) {
682 #if GTEST_HAS_STD_WSTRING
684 TEST(PrintWideStringTest, StringInStdNamespace) {
685 const wchar_t s[] =
L"'\"?\\\a\b\f\n\0\r\t\v\xD3\x576\x8D3\xC74D a";
687 EXPECT_EQ(
"L\"'\\\"?\\\\\\a\\b\\f\\n\\0\\r\\t\\v"
688 "\\xD3\\x576\\x8D3\\xC74D a\\0\"",
692 TEST(PrintWideStringTest, StringAmbiguousHex) {
701 #endif // GTEST_HAS_STD_WSTRING
711 template <
typename Char,
typename CharTraits>
713 std::basic_ostream<Char, CharTraits>& os,
715 return os <<
"AllowsGenericStreaming";
718 TEST(PrintTypeWithGenericStreamingTest, NonTemplateType) {
725 template <
typename T>
728 template <
typename Char,
typename CharTraits,
typename T>
730 std::basic_ostream<Char, CharTraits>& os,
732 return os <<
"AllowsGenericStreamingTemplate";
735 TEST(PrintTypeWithGenericStreamingTest, TemplateType) {
743 template <
typename T>
746 operator bool()
const {
return false; }
749 template <
typename Char,
typename CharTraits,
typename T>
751 std::basic_ostream<Char, CharTraits>& os,
753 return os <<
"AllowsGenericStreamingAndImplicitConversionTemplate";
756 TEST(PrintTypeWithGenericStreamingTest, TypeImplicitlyConvertible) {
758 EXPECT_EQ(
"AllowsGenericStreamingAndImplicitConversionTemplate",
Print(
a));
765 TEST(PrintStringViewTest, SimpleStringView) {
770 TEST(PrintStringViewTest, UnprintableCharacters) {
771 const char str[] =
"NUL (\0) and \r\t";
776 #endif // GTEST_HAS_ABSL
780 TEST(PrintStlContainerTest, EmptyDeque) {
785 TEST(PrintStlContainerTest, NonEmptyDeque) {
786 deque<int> non_empty;
787 non_empty.push_back(1);
788 non_empty.push_back(3);
793 TEST(PrintStlContainerTest, OneElementHashMap) {
794 ::std::unordered_map<int, char> map1;
799 TEST(PrintStlContainerTest, HashMultiMap) {
800 ::std::unordered_multimap<int, bool> map1;
801 map1.insert(make_pair(5,
true));
802 map1.insert(make_pair(5,
false));
807 result ==
"{ (5, false), (5, true) }")
808 <<
" where Print(map1) returns \"" <<
result <<
"\".";
813 TEST(PrintStlContainerTest, HashSet) {
814 ::std::unordered_set<int> set1;
819 TEST(PrintStlContainerTest, HashMultiSet) {
821 int a[kSize] = { 1, 1, 2, 5, 1 };
822 ::std::unordered_multiset<int> set1(
a,
a + kSize);
826 const std::string expected_pattern =
"{ d, d, d, d, d }";
831 std::vector<int> numbers;
832 for (
size_t i = 0;
i !=
result.length();
i++) {
833 if (expected_pattern[
i] ==
'd') {
835 numbers.push_back(
result[
i] -
'0');
843 std::sort(numbers.begin(), numbers.end());
844 std::sort(
a,
a + kSize);
849 TEST(PrintStlContainerTest, List) {
851 const list<std::string> strings(
a,
a + 2);
863 TEST(PrintStlContainerTest, MultiMap) {
864 multimap<bool, int> map1;
871 map1.insert(pair<const bool, int>(
true, 0));
872 map1.insert(pair<const bool, int>(
true, 1));
873 map1.insert(pair<const bool, int>(
false, 2));
877 TEST(PrintStlContainerTest, Set) {
878 const unsigned int a[] = { 3, 0, 5 };
879 set<unsigned int> set1(
a,
a + 3);
883 TEST(PrintStlContainerTest, MultiSet) {
884 const int a[] = { 1, 1, 2, 5, 1 };
885 multiset<int> set1(
a,
a + 5);
890 TEST(PrintStlContainerTest, SinglyLinkedList) {
891 int a[] = { 9, 2, 8 };
892 const std::forward_list<int> ints(
a,
a + 3);
897 pair<const bool, int> p(
true, 5);
908 TEST(PrintStlContainerTest, LongSequence) {
909 const int a[100] = { 1, 2, 3 };
910 const vector<int>
v(
a,
a + 100);
911 EXPECT_EQ(
"{ 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "
912 "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... }",
Print(
v));
915 TEST(PrintStlContainerTest, NestedContainer) {
916 const int a1[] = { 1, 2 };
917 const int a2[] = { 3, 4, 5 };
918 const list<int> l1(
a1,
a1 + 2);
919 const list<int> l2(
a2,
a2 + 3);
921 vector<list<int> >
v;
927 TEST(PrintStlContainerTest, OneDimensionalNativeArray) {
928 const int a[3] = { 1, 2, 3 };
929 NativeArray<int>
b(
a, 3, RelationToSourceReference());
933 TEST(PrintStlContainerTest, TwoDimensionalNativeArray) {
934 const int a[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
935 NativeArray<int[3]>
b(
a, 2, RelationToSourceReference());
964 TEST(PrintStdTupleTest, VariousSizes) {
968 ::std::tuple<int>
t1(5);
971 ::std::tuple<char, bool> t2(
'a',
true);
974 ::std::tuple<bool, int, int> t3(
false, 2, 3);
977 ::std::tuple<bool, int, int, int> t4(
false, 2, 3, 4);
980 const char*
const str =
"8";
984 t10(
false,
'a',
static_cast<short>(3), 4, 5, 1.5
F, -2.5,
str,
987 " pointing to \"8\", NULL, \"10\")",
992 TEST(PrintStdTupleTest, NestedTuple) {
993 ::std::tuple< ::std::tuple<int, bool>,
char>
nested(
1002 TEST(PrintReferenceWrapper, Printable) {
1008 TEST(PrintReferenceWrapper, Unprintable) {
1012 " 16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
1016 " 16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
1017 Print(std::cref(up)));
1023 TEST(PrintUnprintableTypeTest, InGlobalNamespace) {
1029 TEST(PrintUnprintableTypeTest, InUserNamespace) {
1030 EXPECT_EQ(
"16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
1041 TEST(PrintUnpritableTypeTest, BigObject) {
1042 EXPECT_EQ(
"257-byte object <00-00 00-00 00-00 00-00 00-00 00-00 "
1043 "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
1044 "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
1045 "00-00 00-00 00-00 00-00 00-00 00-00 ... 00-00 00-00 00-00 "
1046 "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
1047 "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
1048 "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00>",
1055 TEST(PrintStreamableTypeTest, InGlobalNamespace) {
1062 TEST(PrintStreamableTypeTest, TemplateTypeInUserNamespace) {
1069 TEST(PrintStreamableTypeTest, PathLikeInUserNamespace) {
1072 const ::foo::PathLike cx;
1077 TEST(PrintPrintableTypeTest, InUserNamespace) {
1084 TEST(PrintPrintableTypeTest, PointerInUserNamespace) {
1090 TEST(PrintPrintableTypeTest, TemplateInUserNamespace) {
1091 EXPECT_EQ(
"PrintableViaPrintToTemplate: 5",
1097 TEST(PrintReferenceTest, PrintsAddressAndValue) {
1108 const ::foo::UnprintableInFoo
x;
1110 "<EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
1116 TEST(PrintReferenceTest, HandlesFunctionPointer) {
1126 EXPECT_EQ(
"@" + fp_pointer_string +
" " + fp_string,
1132 TEST(PrintReferenceTest, HandlesMemberFunctionPointer) {
1136 "@" +
PrintPointer(
reinterpret_cast<const void*
>(&p)) +
" " +
1137 Print(
sizeof(p)) +
"-byte object "));
1142 "@" +
PrintPointer(
reinterpret_cast<const void*
>(&p2)) +
" " +
1143 Print(
sizeof(p2)) +
"-byte object "));
1148 TEST(PrintReferenceTest, HandlesMemberVariablePointer) {
1160 TEST(FormatForComparisonFailureMessageTest, WorksForScalar) {
1166 TEST(FormatForComparisonFailureMessageTest, WorksForNonCharPointer) {
1173 TEST(FormatForComparisonFailureMessageTest, FormatsNonCharArrayAsPointer) {
1176 int n[] = { 1, 2, 3 };
1186 TEST(FormatForComparisonFailureMessageTest, WorksForCharPointerVsPointer) {
1193 const char* s =
"hello";
1204 TEST(FormatForComparisonFailureMessageTest, WorksForWCharPointerVsPointer) {
1211 const wchar_t* s =
L"hello";
1225 TEST(FormatForComparisonFailureMessageTest, WorksForCharPointerVsStdString) {
1226 const char* s =
"hello \"world";
1231 char str[] =
"hi\1";
1237 #if GTEST_HAS_STD_WSTRING
1239 TEST(FormatForComparisonFailureMessageTest, WorksForWCharPointerVsStdWString) {
1240 const wchar_t* s =
L"hi \"world";
1245 wchar_t str[] =
L"hi\1";
1257 TEST(FormatForComparisonFailureMessageTest, WorksForCharArrayVsPointer) {
1258 char str[] =
"hi \"world\"";
1265 TEST(FormatForComparisonFailureMessageTest, WorksForCharArrayVsCharArray) {
1266 const char str[] =
"hi \"world\"";
1272 TEST(FormatForComparisonFailureMessageTest, WorksForWCharArrayVsPointer) {
1273 wchar_t str[] =
L"hi \"world\"";
1274 wchar_t* p =
nullptr;
1280 TEST(FormatForComparisonFailureMessageTest, WorksForWCharArrayVsWCharArray) {
1281 const wchar_t str[] =
L"hi \"world\"";
1290 TEST(FormatForComparisonFailureMessageTest, WorksForCharArrayVsStdString) {
1291 const char str[] =
"hi \"world\"";
1296 #if GTEST_HAS_STD_WSTRING
1298 TEST(FormatForComparisonFailureMessageTest, WorksForWCharArrayVsStdWString) {
1299 const wchar_t str[] =
L"hi \"w\0rld\"";
1310 #define EXPECT_PRINT_TO_STRING_(value, expected_string) \
1311 EXPECT_TRUE(PrintToString(value) == (expected_string)) \
1312 << " where " #value " prints as " << (PrintToString(value))
1314 TEST(PrintToStringTest, WorksForScalar) {
1318 TEST(PrintToStringTest, WorksForPointerToConstChar) {
1319 const char* p =
"hello";
1323 TEST(PrintToStringTest, WorksForPointerToNonConstChar) {
1329 TEST(PrintToStringTest, EscapesForPointerToConstChar) {
1330 const char* p =
"hello\n";
1334 TEST(PrintToStringTest, EscapesForPointerToNonConstChar) {
1335 char s[] =
"hello\1";
1340 TEST(PrintToStringTest, WorksForArray) {
1341 int n[3] = { 1, 2, 3 };
1345 TEST(PrintToStringTest, WorksForCharArray) {
1350 TEST(PrintToStringTest, WorksForCharArrayWithEmbeddedNul) {
1351 const char str_with_nul[] =
"hello\0 world";
1354 char mutable_str_with_nul[] =
"hello\0 world";
1358 TEST(PrintToStringTest, ContainsNonLatin) {
1362 "\"\\xEC\\x98\\xA4\\xEC\\xA0\\x84 4:30\"\n"
1363 " As Text: \"ì˜¤ì „ 4:30\"");
1366 "\"From \\xC3\\xA4 \\xE2\\x80\\x94 \\xE1\\xBA\\x91\""
1367 "\n As Text: \"From ä — ẑ\"");
1370 TEST(IsValidUTF8Test, IllFormedUTF8) {
1375 static const char *
const kTestdata[][2] = {
1377 {
"\xC3\x74",
"\"\\xC3t\""},
1379 {
"\xC3\x84\xA4",
"\"\\xC3\\x84\\xA4\""},
1381 {
"abc\xC3",
"\"abc\\xC3\""},
1383 {
"x\xE2\x70\x94",
"\"x\\xE2p\\x94\""},
1385 {
"\xE2\x80",
"\"\\xE2\\x80\""},
1387 {
"\xE2\x80\xC3\x84",
"\"\\xE2\\x80\\xC3\\x84\""},
1389 {
"\xE2\x80\x7A",
"\"\\xE2\\x80z\""},
1391 {
"\xE2\xE2\x80\x94",
"\"\\xE2\\xE2\\x80\\x94\""},
1393 {
"\xF0\xE2\x80\x94",
"\"\\xF0\\xE2\\x80\\x94\""},
1395 {
"\xF0\xE2\x80",
"\"\\xF0\\xE2\\x80\""},
1397 {
"abc\xE2\x80\x94\xC3\x74xyc",
"\"abc\\xE2\\x80\\x94\\xC3txyc\""},
1398 {
"abc\xC3\x84\xE2\x80\xC3\x84xyz",
1399 "\"abc\\xC3\\x84\\xE2\\x80\\xC3\\x84xyz\""},
1402 {
"\xC0\x80",
"\"\\xC0\\x80\""},
1403 {
"\xC1\x81",
"\"\\xC1\\x81\""},
1405 {
"\xE0\x80\x80",
"\"\\xE0\\x80\\x80\""},
1406 {
"\xf0\x80\x80\x80",
"\"\\xF0\\x80\\x80\\x80\""},
1409 {
"\xED\x9F\xBF",
"\"\\xED\\x9F\\xBF\"\n As Text: \"퟿\""},
1411 {
"\xED\xA0\x80",
"\"\\xED\\xA0\\x80\""},
1413 {
"\xED\xAD\xBF",
"\"\\xED\\xAD\\xBF\""},
1415 {
"\xED\xAE\x80",
"\"\\xED\\xAE\\x80\""},
1417 {
"\xED\xAF\xBF",
"\"\\xED\\xAF\\xBF\""},
1419 {
"\xED\xB3\xBF",
"\"\\xED\\xB3\\xBF\""},
1422 {
"\xEE\x80\x80",
"\"\\xEE\\x80\\x80\"\n As Text: \"\""}
1425 for (
int i = 0;
i <
int(
sizeof(kTestdata)/
sizeof(kTestdata[0])); ++
i) {
1430 #undef EXPECT_PRINT_TO_STRING_
1432 TEST(UniversalTersePrintTest, WorksForNonReference) {
1433 ::std::stringstream ss;
1438 TEST(UniversalTersePrintTest, WorksForReference) {
1440 ::std::stringstream ss;
1445 TEST(UniversalTersePrintTest, WorksForCString) {
1446 const char* s1 =
"abc";
1447 ::std::stringstream ss1;
1451 char* s2 =
const_cast<char*
>(s1);
1452 ::std::stringstream ss2;
1456 const char* s3 =
nullptr;
1457 ::std::stringstream ss3;
1462 TEST(UniversalPrintTest, WorksForNonReference) {
1463 ::std::stringstream ss;
1468 TEST(UniversalPrintTest, WorksForReference) {
1470 ::std::stringstream ss;
1475 TEST(UniversalPrintTest, WorksForCString) {
1476 const char* s1 =
"abc";
1477 ::std::stringstream ss1;
1481 char* s2 =
const_cast<char*
>(s1);
1482 ::std::stringstream ss2;
1486 const char* s3 =
nullptr;
1487 ::std::stringstream ss3;
1492 TEST(UniversalPrintTest, WorksForCharArray) {
1493 const char str[] =
"\"Line\0 1\"\nLine 2";
1494 ::std::stringstream ss1;
1496 EXPECT_EQ(
"\"\\\"Line\\0 1\\\"\\nLine 2\"", ss1.str());
1498 const char mutable_str[] =
"\"Line\0 1\"\nLine 2";
1499 ::std::stringstream ss2;
1501 EXPECT_EQ(
"\"\\\"Line\\0 1\\\"\\nLine 2\"", ss2.str());
1504 TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsEmptyTuple) {
1509 TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsOneTuple) {
1516 TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsTwoTuple) {
1524 TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsTersely) {
1527 ::std::tuple<const int&, const char*>(
n,
"a"));
1535 TEST(PrintOptionalTest, Basic) {
1544 struct NonPrintable {
1548 TEST(PrintOneofTest, Basic) {
1551 EXPECT_EQ(
"('StreamableInGlobal' with value StreamableInGlobal)",
1554 "('testing::gtest_printers_test::NonPrintable' with value 1-byte object "
1558 #endif // GTEST_HAS_ABSL
1590 bool operator==(
const char* s)
const noexcept {
1606 const char*
s =
"alex\0davidjohn\0";
1607 string_ptr
ptr(s, 5);