| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -59,7 +59,7 @@ | |||
| 59 | 59 | #ifdef GTEST_HAS_ABSL | |
| 60 | 60 | #include <type_traits> | |
| 61 | 61 | ||
| 62 | - #include "absl/strings/internal/has_absl_stringify.h" | ||
| 62 | + #include "absl/strings/has_absl_stringify.h" | ||
| 63 | 63 | #include "absl/strings/str_cat.h" | |
| 64 | 64 | #endif // GTEST_HAS_ABSL | |
| 65 | 65 | ||
@@ -121,14 +121,14 @@ class GTEST_API_ Message { | |||
| 121 | 121 | // Streams a non-pointer value to this object. If building a version of | |
| 122 | 122 | // GoogleTest with ABSL, this overload is only enabled if the value does not | |
| 123 | 123 | // have an AbslStringify definition. | |
| 124 | - template <typename T | ||
| 124 | + template < | ||
| 125 | + typename T | ||
| 125 | 126 | #ifdef GTEST_HAS_ABSL | |
| 126 | - , | ||
| 127 | - typename std::enable_if< | ||
| 128 | - !absl::strings_internal::HasAbslStringify<T>::value, // NOLINT | ||
| 129 | - int>::type = 0 | ||
| 127 | + , | ||
| 128 | + typename std::enable_if<!absl::HasAbslStringify<T>::value, // NOLINT | ||
| 129 | + int>::type = 0 | ||
| 130 | 130 | #endif // GTEST_HAS_ABSL | |
| 131 | - > | ||
| 131 | + > | ||
| 132 | 132 | inline Message& operator<<(const T& val) { | |
| 133 | 133 | // Some libraries overload << for STL containers. These | |
| 134 | 134 | // overloads are defined in the global namespace instead of ::std. | |
@@ -153,9 +153,8 @@ class GTEST_API_ Message { | |||
| 153 | 153 | // Streams a non-pointer value with an AbslStringify definition to this | |
| 154 | 154 | // object. | |
| 155 | 155 | template <typename T, | |
| 156 | - typename std::enable_if< | ||
| 157 | - absl::strings_internal::HasAbslStringify<T>::value, // NOLINT | ||
| 158 | - int>::type = 0> | ||
| 156 | + typename std::enable_if<absl::HasAbslStringify<T>::value, // NOLINT | ||
| 157 | + int>::type = 0> | ||
| 159 | 158 | inline Message& operator<<(const T& val) { | |
| 160 | 159 | // ::operator<< is needed here for a similar reason as with the non-Abseil | |
| 161 | 160 | // version above | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,7 +116,7 @@ | |||
| 116 | 116 | #include <vector> | |
| 117 | 117 | ||
| 118 | 118 | #ifdef GTEST_HAS_ABSL | |
| 119 | - #include "absl/strings/internal/has_absl_stringify.h" | ||
| 119 | + #include "absl/strings/has_absl_stringify.h" | ||
| 120 | 120 | #include "absl/strings/str_cat.h" | |
| 121 | 121 | #endif // GTEST_HAS_ABSL | |
| 122 | 122 | #include "gtest/internal/gtest-internal.h" | |
@@ -292,10 +292,9 @@ struct ConvertibleToStringViewPrinter { | |||
| 292 | 292 | ||
| 293 | 293 | #ifdef GTEST_HAS_ABSL | |
| 294 | 294 | struct ConvertibleToAbslStringifyPrinter { | |
| 295 | - template < | ||
| 296 | - typename T, | ||
| 297 | - typename = typename std::enable_if< | ||
| 298 | - absl::strings_internal::HasAbslStringify<T>::value>::type> // NOLINT | ||
| 295 | + template <typename T, | ||
| 296 | + typename = typename std::enable_if< | ||
| 297 | + absl::HasAbslStringify<T>::value>::type> // NOLINT | ||
| 299 | 298 | static void PrintValue(const T& value, ::std::ostream* os) { | |
| 300 | 299 | *os << absl::StrCat(value); | |
| 301 | 300 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -281,6 +281,22 @@ | |||
| 281 | 281 | #error C++ versions less than C++14 are not supported. | |
| 282 | 282 | #endif | |
| 283 | 283 | ||
| 284 | + // MSVC >= 19.11 (VS 2017 Update 3) supports __has_include. | ||
| 285 | + #ifdef __has_include | ||
| 286 | + #define GTEST_INTERNAL_HAS_INCLUDE __has_include | ||
| 287 | + #else | ||
| 288 | + #define GTEST_INTERNAL_HAS_INCLUDE(...) 0 | ||
| 289 | + #endif | ||
| 290 | + | ||
| 291 | + // Detect C++ feature test macros as gracefully as possible. | ||
| 292 | + // MSVC >= 19.15, Clang >= 3.4.1, and GCC >= 4.1.2 support feature test macros. | ||
| 293 | + #if GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L && \ | ||
| 294 | + (!defined(__has_include) || GTEST_INTERNAL_HAS_INCLUDE(<version>)) | ||
| 295 | + #include <version> // C++20 and later | ||
| 296 | + #elif (!defined(__has_include) || GTEST_INTERNAL_HAS_INCLUDE(<ciso646>)) | ||
| 297 | + #include <ciso646> // Pre-C++20 | ||
| 298 | + #endif | ||
| 299 | + | ||
| 284 | 300 | #include <ctype.h> // for isspace, etc | |
| 285 | 301 | #include <stddef.h> // for ptrdiff_t | |
| 286 | 302 | #include <stdio.h> | |
@@ -829,9 +845,9 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; | |||
| 829 | 845 | #ifndef GTEST_API_ | |
| 830 | 846 | ||
| 831 | 847 | #ifdef _MSC_VER | |
| 832 | - #if GTEST_LINKED_AS_SHARED_LIBRARY | ||
| 848 | + #if defined(GTEST_LINKED_AS_SHARED_LIBRARY) && GTEST_LINKED_AS_SHARED_LIBRARY | ||
| 833 | 849 | #define GTEST_API_ __declspec(dllimport) | |
| 834 | - #elif GTEST_CREATE_SHARED_LIBRARY | ||
| 850 | + #elif defined(GTEST_CREATE_SHARED_LIBRARY) && GTEST_CREATE_SHARED_LIBRARY | ||
| 835 | 851 | #define GTEST_API_ __declspec(dllexport) | |
| 836 | 852 | #endif | |
| 837 | 853 | #elif GTEST_HAVE_ATTRIBUTE_(visibility) | |
@@ -2351,9 +2367,9 @@ using Any = ::absl::any; | |||
| 2351 | 2367 | } // namespace internal | |
| 2352 | 2368 | } // namespace testing | |
| 2353 | 2369 | #else | |
| 2354 | - #ifdef __has_include | ||
| 2355 | - #if __has_include(<any>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L && \ | ||
| 2356 | - (!defined(_MSC_VER) || GTEST_HAS_RTTI) | ||
| 2370 | + #if defined(__cpp_lib_any) || (GTEST_INTERNAL_HAS_INCLUDE(<any>) && \ | ||
| 2371 | + GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L && \ | ||
| 2372 | + (!defined(_MSC_VER) || GTEST_HAS_RTTI)) | ||
| 2357 | 2373 | // Otherwise for C++17 and higher use std::any for UniversalPrinter<> | |
| 2358 | 2374 | // specializations. | |
| 2359 | 2375 | #define GTEST_INTERNAL_HAS_ANY 1 | |
@@ -2365,8 +2381,7 @@ using Any = ::std::any; | |||
| 2365 | 2381 | } // namespace testing | |
| 2366 | 2382 | // The case where absl is configured NOT to alias std::any is not | |
| 2367 | 2383 | // supported. | |
| 2368 | - #endif // __has_include(<any>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L | ||
| 2369 | - #endif // __has_include | ||
| 2384 | + #endif // __cpp_lib_any | ||
| 2370 | 2385 | #endif // GTEST_HAS_ABSL | |
| 2371 | 2386 | ||
| 2372 | 2387 | #ifndef GTEST_INTERNAL_HAS_ANY | |
@@ -2386,8 +2401,8 @@ inline ::absl::nullopt_t Nullopt() { return ::absl::nullopt; } | |||
| 2386 | 2401 | } // namespace internal | |
| 2387 | 2402 | } // namespace testing | |
| 2388 | 2403 | #else | |
| 2389 | - #ifdef __has_include | ||
| 2390 | - #if __has_include(<optional>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L | ||
| 2404 | + #if defined(__cpp_lib_optional) || (GTEST_INTERNAL_HAS_INCLUDE(<optional>) && \ | ||
| 2405 | + GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L) | ||
| 2391 | 2406 | // Otherwise for C++17 and higher use std::optional for UniversalPrinter<> | |
| 2392 | 2407 | // specializations. | |
| 2393 | 2408 | #define GTEST_INTERNAL_HAS_OPTIONAL 1 | |
@@ -2401,19 +2416,17 @@ inline ::std::nullopt_t Nullopt() { return ::std::nullopt; } | |||
| 2401 | 2416 | } // namespace testing | |
| 2402 | 2417 | // The case where absl is configured NOT to alias std::optional is not | |
| 2403 | 2418 | // supported. | |
| 2404 | - #endif // __has_include(<optional>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L | ||
| 2405 | - #endif // __has_include | ||
| 2419 | + #endif // __cpp_lib_optional | ||
| 2406 | 2420 | #endif // GTEST_HAS_ABSL | |
| 2407 | 2421 | ||
| 2408 | 2422 | #ifndef GTEST_INTERNAL_HAS_OPTIONAL | |
| 2409 | 2423 | #define GTEST_INTERNAL_HAS_OPTIONAL 0 | |
| 2410 | 2424 | #endif | |
| 2411 | 2425 | ||
| 2412 | - #ifdef __has_include | ||
| 2413 | - #if __has_include(<span>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L | ||
| 2426 | + #if defined(__cpp_lib_span) || (GTEST_INTERNAL_HAS_INCLUDE(<span>) && \ | ||
| 2427 | + GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L) | ||
| 2414 | 2428 | #define GTEST_INTERNAL_HAS_STD_SPAN 1 | |
| 2415 | - #endif // __has_include(<span>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L | ||
| 2416 | - #endif // __has_include | ||
| 2429 | + #endif // __cpp_lib_span | ||
| 2417 | 2430 | ||
| 2418 | 2431 | #ifndef GTEST_INTERNAL_HAS_STD_SPAN | |
| 2419 | 2432 | #define GTEST_INTERNAL_HAS_STD_SPAN 0 | |
@@ -2430,8 +2443,9 @@ using StringView = ::absl::string_view; | |||
| 2430 | 2443 | } // namespace internal | |
| 2431 | 2444 | } // namespace testing | |
| 2432 | 2445 | #else | |
| 2433 | - #ifdef __has_include | ||
| 2434 | - #if __has_include(<string_view>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L | ||
| 2446 | + #if defined(__cpp_lib_string_view) || \ | ||
| 2447 | + (GTEST_INTERNAL_HAS_INCLUDE(<string_view>) && \ | ||
| 2448 | + GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L) | ||
| 2435 | 2449 | // Otherwise for C++17 and higher use std::string_view for Matcher<> | |
| 2436 | 2450 | // specializations. | |
| 2437 | 2451 | #define GTEST_INTERNAL_HAS_STRING_VIEW 1 | |
@@ -2443,9 +2457,7 @@ using StringView = ::std::string_view; | |||
| 2443 | 2457 | } // namespace testing | |
| 2444 | 2458 | // The case where absl is configured NOT to alias std::string_view is not | |
| 2445 | 2459 | // supported. | |
| 2446 | - #endif // __has_include(<string_view>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= | ||
| 2447 | - // 201703L | ||
| 2448 | - #endif // __has_include | ||
| 2460 | + #endif // __cpp_lib_string_view | ||
| 2449 | 2461 | #endif // GTEST_HAS_ABSL | |
| 2450 | 2462 | ||
| 2451 | 2463 | #ifndef GTEST_INTERNAL_HAS_STRING_VIEW | |
@@ -2464,8 +2476,8 @@ using Variant = ::absl::variant<T...>; | |||
| 2464 | 2476 | } // namespace internal | |
| 2465 | 2477 | } // namespace testing | |
| 2466 | 2478 | #else | |
| 2467 | - #ifdef __has_include | ||
| 2468 | - #if __has_include(<variant>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L | ||
| 2479 | + #if defined(__cpp_lib_variant) || (GTEST_INTERNAL_HAS_INCLUDE(<variant>) && \ | ||
| 2480 | + GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L) | ||
| 2469 | 2481 | // Otherwise for C++17 and higher use std::variant for UniversalPrinter<> | |
| 2470 | 2482 | // specializations. | |
| 2471 | 2483 | #define GTEST_INTERNAL_HAS_VARIANT 1 | |
@@ -2477,16 +2489,16 @@ using Variant = ::std::variant<T...>; | |||
| 2477 | 2489 | } // namespace internal | |
| 2478 | 2490 | } // namespace testing | |
| 2479 | 2491 | // The case where absl is configured NOT to alias std::variant is not supported. | |
| 2480 | - #endif // __has_include(<variant>) && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L | ||
| 2481 | - #endif // __has_include | ||
| 2492 | + #endif // __cpp_lib_variant | ||
| 2482 | 2493 | #endif // GTEST_HAS_ABSL | |
| 2483 | 2494 | ||
| 2484 | 2495 | #ifndef GTEST_INTERNAL_HAS_VARIANT | |
| 2485 | 2496 | #define GTEST_INTERNAL_HAS_VARIANT 0 | |
| 2486 | 2497 | #endif | |
| 2487 | 2498 | ||
| 2488 | - #if defined(GTEST_INTERNAL_CPLUSPLUS_LANG) && \ | ||
| 2489 | - GTEST_INTERNAL_CPLUSPLUS_LANG < 201703L | ||
| 2499 | + #if (defined(__cpp_constexpr) && !defined(__cpp_inline_variables)) || \ | ||
| 2500 | + (defined(GTEST_INTERNAL_CPLUSPLUS_LANG) && \ | ||
| 2501 | + GTEST_INTERNAL_CPLUSPLUS_LANG < 201703L) | ||
| 2490 | 2502 | #define GTEST_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL 1 | |
| 2491 | 2503 | #endif | |
| 2492 | 2504 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -336,7 +336,7 @@ bool FilePath::CreateDirectoriesRecursively() const { | |||
| 336 | 336 | return false; | |
| 337 | 337 | } | |
| 338 | 338 | ||
| 339 | - if (pathname_.length() == 0 || this->DirectoryExists()) { | ||
| 339 | + if (pathname_.empty() || this->DirectoryExists()) { | ||
| 340 | 340 | return true; | |
| 341 | 341 | } | |
| 342 | 342 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5400,7 +5400,7 @@ void UnitTest::RecordProperty(const std::string& key, | |||
| 5400 | 5400 | int UnitTest::Run() { | |
| 5401 | 5401 | #ifdef GTEST_HAS_DEATH_TEST | |
| 5402 | 5402 | const bool in_death_test_child_process = | |
| 5403 | - GTEST_FLAG_GET(internal_run_death_test).length() > 0; | ||
| 5403 | + !GTEST_FLAG_GET(internal_run_death_test).empty(); | ||
| 5404 | 5404 | ||
| 5405 | 5405 | // Google Test implements this protocol for catching that a test | |
| 5406 | 5406 | // program exits before returning control to Google Test: | |
| 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 d1467f5][] | ||
| 18 | + * [googletest e47544a][] | ||
| 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 d1467f5 | ||
| 190 | + ### googletest e47544a | ||
| 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 d1467f5]: #googletest-d1467f5 | ||
| 322 | + [googletest e47544a]: #googletest-e47544a | ||
| 323 | 323 | [histogram]: #histogram | |
| 324 | 324 | [icu-small]: #icu-small | |
| 325 | 325 | [llhttp]: #llhttp | |
| Back | FazBrowse Home | New Git URL |
0 commit comments