| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -298,8 +298,8 @@ struct FindFirstPrinter< | |||
| 298 | 298 | // - Print containers (they have begin/end/etc). | |
| 299 | 299 | // - Print function pointers. | |
| 300 | 300 | // - Print object pointers. | |
| 301 | - // - Use the stream operator, if available. | ||
| 302 | 301 | // - Print protocol buffers. | |
| 302 | + // - Use the stream operator, if available. | ||
| 303 | 303 | // - Print types convertible to BiggestInt. | |
| 304 | 304 | // - Print types convertible to StringView, if available. | |
| 305 | 305 | // - Fallback to printing the raw bytes of the object. | |
@@ -475,7 +475,7 @@ GTEST_API_ void PrintTo(char32_t c, ::std::ostream* os); | |||
| 475 | 475 | inline void PrintTo(char16_t c, ::std::ostream* os) { | |
| 476 | 476 | PrintTo(ImplicitCast_<char32_t>(c), os); | |
| 477 | 477 | } | |
| 478 | - #ifdef __cpp_char8_t | ||
| 478 | + #ifdef __cpp_lib_char8_t | ||
| 479 | 479 | inline void PrintTo(char8_t c, ::std::ostream* os) { | |
| 480 | 480 | PrintTo(ImplicitCast_<char32_t>(c), os); | |
| 481 | 481 | } | |
@@ -531,7 +531,7 @@ int AppropriateResolution(FloatType val) { | |||
| 531 | 531 | } else if (val >= 0.0001) { | |
| 532 | 532 | mulfor6 = 1e9; | |
| 533 | 533 | } | |
| 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)) / | ||
| 535 | 535 | mulfor6 == | |
| 536 | 536 | val) | |
| 537 | 537 | return 6; | |
@@ -546,7 +546,7 @@ int AppropriateResolution(FloatType val) { | |||
| 546 | 546 | } else if (val >= 1e6) { // 1,000,000 to 9,999,999 | |
| 547 | 547 | divfor6 = 10; | |
| 548 | 548 | } | |
| 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)) * | ||
| 550 | 550 | divfor6 == | |
| 551 | 551 | val) | |
| 552 | 552 | return 6; | |
@@ -588,7 +588,7 @@ inline void PrintTo(const unsigned char* s, ::std::ostream* os) { | |||
| 588 | 588 | inline void PrintTo(unsigned char* s, ::std::ostream* os) { | |
| 589 | 589 | PrintTo(ImplicitCast_<const void*>(s), os); | |
| 590 | 590 | } | |
| 591 | - #ifdef __cpp_char8_t | ||
| 591 | + #ifdef __cpp_lib_char8_t | ||
| 592 | 592 | // Overloads for u8 strings. | |
| 593 | 593 | GTEST_API_ void PrintTo(const char8_t* s, ::std::ostream* os); | |
| 594 | 594 | inline void PrintTo(char8_t* s, ::std::ostream* os) { | |
@@ -908,7 +908,7 @@ void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) { | |||
| 908 | 908 | GTEST_API_ void UniversalPrintArray(const char* begin, size_t len, | |
| 909 | 909 | ::std::ostream* os); | |
| 910 | 910 | ||
| 911 | - #ifdef __cpp_char8_t | ||
| 911 | + #ifdef __cpp_lib_char8_t | ||
| 912 | 912 | // This overload prints a (const) char8_t array compactly. | |
| 913 | 913 | GTEST_API_ void UniversalPrintArray(const char8_t* begin, size_t len, | |
| 914 | 914 | ::std::ostream* os); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -113,6 +113,8 @@ | |||
| 113 | 113 | #define GTEST_OS_XTENSA 1 | |
| 114 | 114 | #elif defined(__hexagon__) | |
| 115 | 115 | #define GTEST_OS_QURT 1 | |
| 116 | + #elif defined(CPU_QN9090) || defined(CPU_QN9090HN) | ||
| 117 | + #define GTEST_OS_NXP_QN9090 1 | ||
| 116 | 118 | #endif // __CYGWIN__ | |
| 117 | 119 | ||
| 118 | 120 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -505,7 +505,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; | |||
| 505 | 505 | #if (!(defined(GTEST_OS_LINUX_ANDROID) || defined(GTEST_OS_CYGWIN) || \ | |
| 506 | 506 | defined(GTEST_OS_SOLARIS) || defined(GTEST_OS_HAIKU) || \ | |
| 507 | 507 | 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))) | ||
| 509 | 510 | #define GTEST_HAS_STD_WSTRING 1 | |
| 510 | 511 | #else | |
| 511 | 512 | #define GTEST_HAS_STD_WSTRING 0 | |
@@ -924,9 +925,11 @@ using std::tuple_size; | |||
| 924 | 925 | namespace internal { | |
| 925 | 926 | ||
| 926 | 927 | // 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 | ||
| 928 | 929 | // Secret object, which is what we want. | |
| 929 | - class Secret; | ||
| 930 | + class Secret { | ||
| 931 | + Secret(const Secret&) = delete; | ||
| 932 | + }; | ||
| 930 | 933 | ||
| 931 | 934 | // A helper for suppressing warnings on constant condition. It just | |
| 932 | 935 | // returns 'condition'. | |
@@ -1995,7 +1998,7 @@ inline bool IsUpper(char ch) { | |||
| 1995 | 1998 | inline bool IsXDigit(char ch) { | |
| 1996 | 1999 | return isxdigit(static_cast<unsigned char>(ch)) != 0; | |
| 1997 | 2000 | } | |
| 1998 | - #ifdef __cpp_char8_t | ||
| 2001 | + #ifdef __cpp_lib_char8_t | ||
| 1999 | 2002 | inline bool IsXDigit(char8_t ch) { | |
| 2000 | 2003 | return isxdigit(static_cast<unsigned char>(ch)) != 0; | |
| 2001 | 2004 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -102,7 +102,7 @@ FilePath FilePath::GetCurrentDir() { | |||
| 102 | 102 | #if defined(GTEST_OS_WINDOWS_MOBILE) || defined(GTEST_OS_WINDOWS_PHONE) || \ | |
| 103 | 103 | defined(GTEST_OS_WINDOWS_RT) || defined(GTEST_OS_ESP8266) || \ | |
| 104 | 104 | defined(GTEST_OS_ESP32) || defined(GTEST_OS_XTENSA) || \ | |
| 105 | - defined(GTEST_OS_QURT) | ||
| 105 | + defined(GTEST_OS_QURT) || defined(GTEST_OS_NXP_QN9090) | ||
| 106 | 106 | // These platforms do not have a current directory, so we just return | |
| 107 | 107 | // something reasonable. | |
| 108 | 108 | return FilePath(kCurrentDirectoryString); | |
@@ -356,7 +356,7 @@ bool FilePath::CreateFolder() const { | |||
| 356 | 356 | #elif defined(GTEST_OS_WINDOWS) | |
| 357 | 357 | int result = _mkdir(pathname_.c_str()); | |
| 358 | 358 | #elif defined(GTEST_OS_ESP8266) || defined(GTEST_OS_XTENSA) || \ | |
| 359 | - defined(GTEST_OS_QURT) | ||
| 359 | + defined(GTEST_OS_QURT) || defined(GTEST_OS_NXP_QN9090) | ||
| 360 | 360 | // do nothing | |
| 361 | 361 | int result = 0; | |
| 362 | 362 | #else | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -387,10 +387,10 @@ class GTEST_API_ UnitTestOptions { | |||
| 387 | 387 | #ifdef GTEST_OS_WINDOWS | |
| 388 | 388 | // Function for supporting the gtest_catch_exception flag. | |
| 389 | 389 | ||
| 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. | ||
| 392 | 392 | // 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); | ||
| 394 | 394 | #endif // GTEST_OS_WINDOWS | |
| 395 | 395 | ||
| 396 | 396 | // Returns true if "name" matches the ':' separated list of glob-style | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -216,7 +216,7 @@ static const char* GetCharWidthPrefix(signed char) { return ""; } | |||
| 216 | 216 | ||
| 217 | 217 | static const char* GetCharWidthPrefix(unsigned char) { return ""; } | |
| 218 | 218 | ||
| 219 | - #ifdef __cpp_char8_t | ||
| 219 | + #ifdef __cpp_lib_char8_t | ||
| 220 | 220 | static const char* GetCharWidthPrefix(char8_t) { return "u8"; } | |
| 221 | 221 | #endif | |
| 222 | 222 | ||
@@ -232,7 +232,7 @@ static CharFormat PrintAsStringLiteralTo(char c, ostream* os) { | |||
| 232 | 232 | return PrintAsStringLiteralTo(ToChar32(c), os); | |
| 233 | 233 | } | |
| 234 | 234 | ||
| 235 | - #ifdef __cpp_char8_t | ||
| 235 | + #ifdef __cpp_lib_char8_t | ||
| 236 | 236 | static CharFormat PrintAsStringLiteralTo(char8_t c, ostream* os) { | |
| 237 | 237 | return PrintAsStringLiteralTo(ToChar32(c), os); | |
| 238 | 238 | } | |
@@ -395,7 +395,7 @@ void UniversalPrintArray(const char* begin, size_t len, ostream* os) { | |||
| 395 | 395 | UniversalPrintCharArray(begin, len, os); | |
| 396 | 396 | } | |
| 397 | 397 | ||
| 398 | - #ifdef __cpp_char8_t | ||
| 398 | + #ifdef __cpp_lib_char8_t | ||
| 399 | 399 | // Prints a (const) char8_t array of 'len' elements, starting at address | |
| 400 | 400 | // 'begin'. | |
| 401 | 401 | void UniversalPrintArray(const char8_t* begin, size_t len, ostream* os) { | |
@@ -438,7 +438,7 @@ void PrintCStringTo(const Char* s, ostream* os) { | |||
| 438 | 438 | ||
| 439 | 439 | void PrintTo(const char* s, ostream* os) { PrintCStringTo(s, os); } | |
| 440 | 440 | ||
| 441 | - #ifdef __cpp_char8_t | ||
| 441 | + #ifdef __cpp_lib_char8_t | ||
| 442 | 442 | void PrintTo(const char8_t* s, ostream* os) { PrintCStringTo(s, os); } | |
| 443 | 443 | #endif | |
| 444 | 444 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -863,30 +863,39 @@ bool UnitTestOptions::FilterMatchesTest(const std::string& test_suite_name, | |||
| 863 | 863 | } | |
| 864 | 864 | ||
| 865 | 865 | #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) { | ||
| 870 | 875 | // Google Test should handle a SEH exception if: | |
| 871 | 876 | // 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 | ||
| 873 | 878 | // 3. this is not a C++ exception (VC++ implements them via SEH, | |
| 874 | 879 | // apparently). | |
| 875 | 880 | // | |
| 876 | 881 | // SEH exception code for C++ exceptions. | |
| 877 | 882 | // (see http://support.microsoft.com/kb/185294 for more information). | |
| 878 | 883 | const DWORD kCxxExceptionCode = 0xe06d7363; | |
| 879 | 884 | ||
| 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 | + } | ||
| 881 | 890 | ||
| 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)); | ||
| 888 | 897 | ||
| 889 | - return should_handle ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH; | ||
| 898 | + return EXCEPTION_EXECUTE_HANDLER; | ||
| 890 | 899 | } | |
| 891 | 900 | #endif // GTEST_HAS_SEH | |
| 892 | 901 | ||
@@ -2553,23 +2562,6 @@ bool Test::HasSameFixtureClass() { | |||
| 2553 | 2562 | return true; | |
| 2554 | 2563 | } | |
| 2555 | 2564 | ||
| 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 | - | ||
| 2573 | 2565 | namespace internal { | |
| 2574 | 2566 | ||
| 2575 | 2567 | #if GTEST_HAS_EXCEPTIONS | |
@@ -2611,16 +2603,8 @@ Result HandleSehExceptionsInMethodIfSupported(T* object, Result (T::*method)(), | |||
| 2611 | 2603 | #if GTEST_HAS_SEH | |
| 2612 | 2604 | __try { | |
| 2613 | 2605 | 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)) { | ||
| 2624 | 2608 | return static_cast<Result>(0); | |
| 2625 | 2609 | } | |
| 2626 | 2610 | #else | |
@@ -5655,8 +5639,10 @@ void UnitTestImpl::ConfigureXmlOutput() { | |||
| 5655 | 5639 | << output_format << "\" ignored."; | |
| 5656 | 5640 | } | |
| 5657 | 5641 | #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 | + } | ||
| 5660 | 5646 | #endif // GTEST_HAS_FILE_SYSTEM | |
| 5661 | 5647 | } | |
| 5662 | 5648 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ This a list of all the dependencies: | |||
| 15 | 15 | * [c-ares 1.20.1][] | |
| 16 | 16 | * [cjs-module-lexer][] | |
| 17 | 17 | * [corepack][] | |
| 18 | - * [googletest][] | ||
| 18 | + * [googletest cc36671][] | ||
| 19 | 19 | * [histogram][] | |
| 20 | 20 | * [icu-small][] | |
| 21 | 21 | * [llhttp][] | |
@@ -187,7 +187,7 @@ In practical terms, Corepack will let you use Yarn and pnpm without having to | |||
| 187 | 187 | install them - just like what currently happens with npm, which is shipped | |
| 188 | 188 | by Node.js by default. | |
| 189 | 189 | ||
| 190 | - ### googletest | ||
| 190 | + ### googletest cc36671 | ||
| 191 | 191 | ||
| 192 | 192 | The [googletest](https://github.com/google/googletest) dependency is Google’s | |
| 193 | 193 | C++ testing and mocking framework. | |
@@ -319,7 +319,7 @@ performance improvements not currently available in standard zlib. | |||
| 319 | 319 | [cjs-module-lexer]: #cjs-module-lexer | |
| 320 | 320 | [corepack]: #corepack | |
| 321 | 321 | [dependency-update-action]: ../../../.github/workflows/tools.yml | |
| 322 | - [googletest]: #googletest | ||
| 322 | + [googletest cc36671]: #googletest-cc36671 | ||
| 323 | 323 | [histogram]: #histogram | |
| 324 | 324 | [icu-small]: #icu-small | |
| 325 | 325 | [llhttp]: #llhttp | |
| Back | FazBrowse Home | New Git URL |
0 commit comments