Skip to content

Commit 318e075

Browse files
nodejs-github-botRafaelGSS
authored andcommitted
deps: update googletest to cc36671
PR-URL: #48789 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 07d0fd6 commit 318e075

File tree

8 files changed

+55
-64
lines changed

8 files changed

+55
-64
lines changed

deps/googletest/include/gtest/gtest-printers.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ struct FindFirstPrinter<
298298
// - Print containers (they have begin/end/etc).
299299
// - Print function pointers.
300300
// - Print object pointers.
301-
// - Use the stream operator, if available.
302301
// - Print protocol buffers.
302+
// - Use the stream operator, if available.
303303
// - Print types convertible to BiggestInt.
304304
// - Print types convertible to StringView, if available.
305305
// - Fallback to printing the raw bytes of the object.
@@ -475,7 +475,7 @@ GTEST_API_ void PrintTo(char32_t c, ::std::ostream* os);
475475
inline void PrintTo(char16_t c, ::std::ostream* os) {
476476
PrintTo(ImplicitCast_<char32_t>(c), os);
477477
}
478-
#ifdef __cpp_char8_t
478+
#ifdef __cpp_lib_char8_t
479479
inline void PrintTo(char8_t c, ::std::ostream* os) {
480480
PrintTo(ImplicitCast_<char32_t>(c), os);
481481
}
@@ -531,7 +531,7 @@ int AppropriateResolution(FloatType val) {
531531
} else if (val >= 0.0001) {
532532
mulfor6 = 1e9;
533533
}
534-
if (static_cast<float>(static_cast<int32_t>(val * mulfor6 + 0.5)) /
534+
if (static_cast<FloatType>(static_cast<int32_t>(val * mulfor6 + 0.5)) /
535535
mulfor6 ==
536536
val)
537537
return 6;
@@ -546,7 +546,7 @@ int AppropriateResolution(FloatType val) {
546546
} else if (val >= 1e6) { // 1,000,000 to 9,999,999
547547
divfor6 = 10;
548548
}
549-
if (static_cast<float>(static_cast<int32_t>(val / divfor6 + 0.5)) *
549+
if (static_cast<FloatType>(static_cast<int32_t>(val / divfor6 + 0.5)) *
550550
divfor6 ==
551551
val)
552552
return 6;
@@ -588,7 +588,7 @@ inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
588588
inline void PrintTo(unsigned char* s, ::std::ostream* os) {
589589
PrintTo(ImplicitCast_<const void*>(s), os);
590590
}
591-
#ifdef __cpp_char8_t
591+
#ifdef __cpp_lib_char8_t
592592
// Overloads for u8 strings.
593593
GTEST_API_ void PrintTo(const char8_t* s, ::std::ostream* os);
594594
inline void PrintTo(char8_t* s, ::std::ostream* os) {
@@ -908,7 +908,7 @@ void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
908908
GTEST_API_ void UniversalPrintArray(const char* begin, size_t len,
909909
::std::ostream* os);
910910

911-
#ifdef __cpp_char8_t
911+
#ifdef __cpp_lib_char8_t
912912
// This overload prints a (const) char8_t array compactly.
913913
GTEST_API_ void UniversalPrintArray(const char8_t* begin, size_t len,
914914
::std::ostream* os);

deps/googletest/include/gtest/internal/gtest-port-arch.h

+2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@
113113
#define GTEST_OS_XTENSA 1
114114
#elif defined(__hexagon__)
115115
#define GTEST_OS_QURT 1
116+
#elif defined(CPU_QN9090) || defined(CPU_QN9090HN)
117+
#define GTEST_OS_NXP_QN9090 1
116118
#endif // __CYGWIN__
117119

118120
#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_

deps/googletest/include/gtest/internal/gtest-port.h

+7-4
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
505505
#if (!(defined(GTEST_OS_LINUX_ANDROID) || defined(GTEST_OS_CYGWIN) || \
506506
defined(GTEST_OS_SOLARIS) || defined(GTEST_OS_HAIKU) || \
507507
defined(GTEST_OS_ESP32) || defined(GTEST_OS_ESP8266) || \
508-
defined(GTEST_OS_XTENSA) || defined(GTEST_OS_QURT)))
508+
defined(GTEST_OS_XTENSA) || defined(GTEST_OS_QURT) || \
509+
defined(GTEST_OS_NXP_QN9090)))
509510
#define GTEST_HAS_STD_WSTRING 1
510511
#else
511512
#define GTEST_HAS_STD_WSTRING 0
@@ -924,9 +925,11 @@ using std::tuple_size;
924925
namespace internal {
925926

926927
// A secret type that Google Test users don't know about. It has no
927-
// definition on purpose. Therefore it's impossible to create a
928+
// accessible constructors on purpose. Therefore it's impossible to create a
928929
// Secret object, which is what we want.
929-
class Secret;
930+
class Secret {
931+
Secret(const Secret&) = delete;
932+
};
930933

931934
// A helper for suppressing warnings on constant condition. It just
932935
// returns 'condition'.
@@ -1995,7 +1998,7 @@ inline bool IsUpper(char ch) {
19951998
inline bool IsXDigit(char ch) {
19961999
return isxdigit(static_cast<unsigned char>(ch)) != 0;
19972000
}
1998-
#ifdef __cpp_char8_t
2001+
#ifdef __cpp_lib_char8_t
19992002
inline bool IsXDigit(char8_t ch) {
20002003
return isxdigit(static_cast<unsigned char>(ch)) != 0;
20012004
}

deps/googletest/src/gtest-filepath.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ FilePath FilePath::GetCurrentDir() {
102102
#if defined(GTEST_OS_WINDOWS_MOBILE) || defined(GTEST_OS_WINDOWS_PHONE) || \
103103
defined(GTEST_OS_WINDOWS_RT) || defined(GTEST_OS_ESP8266) || \
104104
defined(GTEST_OS_ESP32) || defined(GTEST_OS_XTENSA) || \
105-
defined(GTEST_OS_QURT)
105+
defined(GTEST_OS_QURT) || defined(GTEST_OS_NXP_QN9090)
106106
// These platforms do not have a current directory, so we just return
107107
// something reasonable.
108108
return FilePath(kCurrentDirectoryString);
@@ -356,7 +356,7 @@ bool FilePath::CreateFolder() const {
356356
#elif defined(GTEST_OS_WINDOWS)
357357
int result = _mkdir(pathname_.c_str());
358358
#elif defined(GTEST_OS_ESP8266) || defined(GTEST_OS_XTENSA) || \
359-
defined(GTEST_OS_QURT)
359+
defined(GTEST_OS_QURT) || defined(GTEST_OS_NXP_QN9090)
360360
// do nothing
361361
int result = 0;
362362
#else

deps/googletest/src/gtest-internal-inl.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,10 @@ class GTEST_API_ UnitTestOptions {
387387
#ifdef GTEST_OS_WINDOWS
388388
// Function for supporting the gtest_catch_exception flag.
389389

390-
// Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
391-
// given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
390+
// Returns EXCEPTION_EXECUTE_HANDLER if given SEH exception was handled, or
391+
// EXCEPTION_CONTINUE_SEARCH otherwise.
392392
// This function is useful as an __except condition.
393-
static int GTestShouldProcessSEH(DWORD exception_code);
393+
static int GTestProcessSEH(DWORD seh_code, const char* location);
394394
#endif // GTEST_OS_WINDOWS
395395

396396
// Returns true if "name" matches the ':' separated list of glob-style

deps/googletest/src/gtest-printers.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static const char* GetCharWidthPrefix(signed char) { return ""; }
216216

217217
static const char* GetCharWidthPrefix(unsigned char) { return ""; }
218218

219-
#ifdef __cpp_char8_t
219+
#ifdef __cpp_lib_char8_t
220220
static const char* GetCharWidthPrefix(char8_t) { return "u8"; }
221221
#endif
222222

@@ -232,7 +232,7 @@ static CharFormat PrintAsStringLiteralTo(char c, ostream* os) {
232232
return PrintAsStringLiteralTo(ToChar32(c), os);
233233
}
234234

235-
#ifdef __cpp_char8_t
235+
#ifdef __cpp_lib_char8_t
236236
static CharFormat PrintAsStringLiteralTo(char8_t c, ostream* os) {
237237
return PrintAsStringLiteralTo(ToChar32(c), os);
238238
}
@@ -395,7 +395,7 @@ void UniversalPrintArray(const char* begin, size_t len, ostream* os) {
395395
UniversalPrintCharArray(begin, len, os);
396396
}
397397

398-
#ifdef __cpp_char8_t
398+
#ifdef __cpp_lib_char8_t
399399
// Prints a (const) char8_t array of 'len' elements, starting at address
400400
// 'begin'.
401401
void UniversalPrintArray(const char8_t* begin, size_t len, ostream* os) {
@@ -438,7 +438,7 @@ void PrintCStringTo(const Char* s, ostream* os) {
438438

439439
void PrintTo(const char* s, ostream* os) { PrintCStringTo(s, os); }
440440

441-
#ifdef __cpp_char8_t
441+
#ifdef __cpp_lib_char8_t
442442
void PrintTo(const char8_t* s, ostream* os) { PrintCStringTo(s, os); }
443443
#endif
444444

deps/googletest/src/gtest.cc

+28-42
Original file line numberDiff line numberDiff line change
@@ -863,30 +863,39 @@ bool UnitTestOptions::FilterMatchesTest(const std::string& test_suite_name,
863863
}
864864

865865
#if GTEST_HAS_SEH
866-
// Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
867-
// given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
868-
// This function is useful as an __except condition.
869-
int UnitTestOptions::GTestShouldProcessSEH(DWORD exception_code) {
866+
static std::string FormatSehExceptionMessage(DWORD exception_code,
867+
const char* location) {
868+
Message message;
869+
message << "SEH exception with code 0x" << std::setbase(16) << exception_code
870+
<< std::setbase(10) << " thrown in " << location << ".";
871+
return message.GetString();
872+
}
873+
874+
int UnitTestOptions::GTestProcessSEH(DWORD seh_code, const char* location) {
870875
// Google Test should handle a SEH exception if:
871876
// 1. the user wants it to, AND
872-
// 2. this is not a breakpoint exception, AND
877+
// 2. this is not a breakpoint exception or stack overflow, AND
873878
// 3. this is not a C++ exception (VC++ implements them via SEH,
874879
// apparently).
875880
//
876881
// SEH exception code for C++ exceptions.
877882
// (see http://support.microsoft.com/kb/185294 for more information).
878883
const DWORD kCxxExceptionCode = 0xe06d7363;
879884

880-
bool should_handle = true;
885+
if (!GTEST_FLAG_GET(catch_exceptions) || seh_code == kCxxExceptionCode ||
886+
seh_code == EXCEPTION_BREAKPOINT ||
887+
seh_code == EXCEPTION_STACK_OVERFLOW) {
888+
return EXCEPTION_CONTINUE_SEARCH; // Don't handle these exceptions
889+
}
881890

882-
if (!GTEST_FLAG_GET(catch_exceptions))
883-
should_handle = false;
884-
else if (exception_code == EXCEPTION_BREAKPOINT)
885-
should_handle = false;
886-
else if (exception_code == kCxxExceptionCode)
887-
should_handle = false;
891+
internal::ReportFailureInUnknownLocation(
892+
TestPartResult::kFatalFailure,
893+
FormatSehExceptionMessage(seh_code, location) +
894+
"\n"
895+
"Stack trace:\n" +
896+
::testing::internal::GetCurrentOsStackTraceExceptTop(1));
888897

889-
return should_handle ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;
898+
return EXCEPTION_EXECUTE_HANDLER;
890899
}
891900
#endif // GTEST_HAS_SEH
892901

@@ -2553,23 +2562,6 @@ bool Test::HasSameFixtureClass() {
25532562
return true;
25542563
}
25552564

2556-
#if GTEST_HAS_SEH
2557-
2558-
// Adds an "exception thrown" fatal failure to the current test. This
2559-
// function returns its result via an output parameter pointer because VC++
2560-
// prohibits creation of objects with destructors on stack in functions
2561-
// using __try (see error C2712).
2562-
static std::string* FormatSehExceptionMessage(DWORD exception_code,
2563-
const char* location) {
2564-
Message message;
2565-
message << "SEH exception with code 0x" << std::setbase(16) << exception_code
2566-
<< std::setbase(10) << " thrown in " << location << ".";
2567-
2568-
return new std::string(message.GetString());
2569-
}
2570-
2571-
#endif // GTEST_HAS_SEH
2572-
25732565
namespace internal {
25742566

25752567
#if GTEST_HAS_EXCEPTIONS
@@ -2611,16 +2603,8 @@ Result HandleSehExceptionsInMethodIfSupported(T* object, Result (T::*method)(),
26112603
#if GTEST_HAS_SEH
26122604
__try {
26132605
return (object->*method)();
2614-
} __except (internal::UnitTestOptions::GTestShouldProcessSEH( // NOLINT
2615-
GetExceptionCode())) {
2616-
// We create the exception message on the heap because VC++ prohibits
2617-
// creation of objects with destructors on stack in functions using __try
2618-
// (see error C2712).
2619-
std::string* exception_message =
2620-
FormatSehExceptionMessage(GetExceptionCode(), location);
2621-
internal::ReportFailureInUnknownLocation(TestPartResult::kFatalFailure,
2622-
*exception_message);
2623-
delete exception_message;
2606+
} __except (internal::UnitTestOptions::GTestProcessSEH( // NOLINT
2607+
GetExceptionCode(), location)) {
26242608
return static_cast<Result>(0);
26252609
}
26262610
#else
@@ -5655,8 +5639,10 @@ void UnitTestImpl::ConfigureXmlOutput() {
56555639
<< output_format << "\" ignored.";
56565640
}
56575641
#else
5658-
GTEST_LOG_(ERROR) << "ERROR: alternative output formats require "
5659-
<< "GTEST_HAS_FILE_SYSTEM to be enabled";
5642+
if (!output_format.empty()) {
5643+
GTEST_LOG_(ERROR) << "ERROR: alternative output formats require "
5644+
<< "GTEST_HAS_FILE_SYSTEM to be enabled";
5645+
}
56605646
#endif // GTEST_HAS_FILE_SYSTEM
56615647
}
56625648

doc/contributing/maintaining/maintaining-dependencies.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This a list of all the dependencies:
1515
* [c-ares 1.19.0][]
1616
* [cjs-module-lexer 1.2.2][]
1717
* [corepack][]
18-
* [googletest ec4fed9][]
18+
* [googletest cc36671][]
1919
* [histogram 0.11.8][]
2020
* [icu-small 73.2][]
2121
* [libuv 1.46.0][]
@@ -189,7 +189,7 @@ In practical terms, Corepack will let you use Yarn and pnpm without having to
189189
install them - just like what currently happens with npm, which is shipped
190190
by Node.js by default.
191191

192-
### googletest ec4fed9
192+
### googletest cc36671
193193

194194
The [googletest](https://github.com/google/googletest) dependency is Google’s
195195
C++ testing and mocking framework.
@@ -326,7 +326,7 @@ performance improvements not currently available in standard zlib.
326326
[cjs-module-lexer 1.2.2]: #cjs-module-lexer-122
327327
[corepack]: #corepack
328328
[dependency-update-action]: ../../../.github/workflows/tools.yml
329-
[googletest ec4fed9]: #googletest-ec4fed9
329+
[googletest cc36671]: #googletest-cc36671
330330
[histogram 0.11.8]: #histogram-0118
331331
[icu-small 73.2]: #icu-small-732
332332
[libuv 1.46.0]: #libuv-1460

0 commit comments

Comments
 (0)