diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 315ce0a5..dec13736 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -163,6 +163,9 @@ struct IsStdSpan> { // the presence of const_iterator to avoid treating iterators as containers // because of iterator::iterator. Which means std::span satisfies the *intended* // condition of IsContainerTest. +#ifndef GTEST_MAX_NUM_ELEMENTS_TO_PRINT +#define GTEST_MAX_NUM_ELEMENTS_TO_PRINT 32 +#endif struct ContainerPrinter { template ::value) || IsStdSpan::value>::type> static void PrintValue(const T& container, std::ostream* os) { - const size_t kMaxCount = 32; // The maximum number of elements to print. + const size_t kMaxCount = + static_cast(GTEST_MAX_NUM_ELEMENTS_TO_PRINT); *os << '{'; size_t count = 0; for (auto&& elem : container) {