aboutsummaryrefslogtreecommitdiff
path: root/third_party/googletest
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/googletest')
-rw-r--r--third_party/googletest/BUILD.gn2
-rw-r--r--third_party/googletest/README.pdfium2
-rw-r--r--third_party/googletest/custom/gtest/internal/custom/gtest-printers.h35
3 files changed, 37 insertions, 2 deletions
diff --git a/third_party/googletest/BUILD.gn b/third_party/googletest/BUILD.gn
index 02f0ff842..fb7b18202 100644
--- a/third_party/googletest/BUILD.gn
+++ b/third_party/googletest/BUILD.gn
@@ -61,6 +61,7 @@ config("gmock_config") {
source_set("gtest") {
testonly = true
sources = [
+ "custom/gtest/internal/custom/gtest-printers.h",
"custom/gtest/internal/custom/gtest.h",
"custom/gtest/internal/custom/stack_trace_getter.cc",
"custom/gtest/internal/custom/stack_trace_getter.h",
@@ -127,7 +128,6 @@ source_set("gtest") {
]
deps = []
- public_deps = []
if (is_fuchsia) {
deps += [
diff --git a/third_party/googletest/README.pdfium b/third_party/googletest/README.pdfium
index bd2d36a68..f3ea2de4a 100644
--- a/third_party/googletest/README.pdfium
+++ b/third_party/googletest/README.pdfium
@@ -3,7 +3,7 @@ Short Name: googletest
URL: https://github.com/google/googletest.git
Version: 1.8.0.git-a45c24ac1878932e0dc5fbc0d78a699befd386d3
License: BSD
-License File: NOT_SHIPPED
+Shipped: no
Security critical: no
Google Test is imported as-is, to facilitate version bumping. However, the
diff --git a/third_party/googletest/custom/gtest/internal/custom/gtest-printers.h b/third_party/googletest/custom/gtest/internal/custom/gtest-printers.h
new file mode 100644
index 000000000..523dc1477
--- /dev/null
+++ b/third_party/googletest/custom/gtest/internal/custom/gtest-printers.h
@@ -0,0 +1,35 @@
+// Copyright 2023 The PDFium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
+#define THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
+
+#include <string>
+
+namespace fxcrt {
+class ByteString;
+}
+
+namespace testing {
+
+// If a C string is compared with a PDFium string object, then it is meant to
+// point to a NUL-terminated string, and thus print it as a string.
+
+#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
+ template <> \
+ class internal::FormatForComparison<CharType*, OtherStringType> { \
+ public: \
+ static std::string Format(CharType* value) { \
+ return ::testing::PrintToString(value); \
+ } \
+ }
+
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, fxcrt::ByteString);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, fxcrt::ByteString);
+
+#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
+
+} // namespace testing
+
+#endif // THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_