| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -158,13 +158,13 @@ size_t GetThreadCount() { | |||
| 158 | 158 | // we cannot detect it. | |
| 159 | 159 | size_t GetThreadCount() { | |
| 160 | 160 | int mib[] = { | |
| 161 | - CTL_KERN, | ||
| 162 | - KERN_PROC, | ||
| 163 | - KERN_PROC_PID, | ||
| 164 | - getpid(), | ||
| 161 | + CTL_KERN, | ||
| 162 | + KERN_PROC, | ||
| 163 | + KERN_PROC_PID, | ||
| 164 | + getpid(), | ||
| 165 | 165 | #ifdef GTEST_OS_NETBSD | |
| 166 | - sizeof(struct kinfo_proc), | ||
| 167 | - 1, | ||
| 166 | + sizeof(struct kinfo_proc), | ||
| 167 | + 1, | ||
| 168 | 168 | #endif | |
| 169 | 169 | }; | |
| 170 | 170 | u_int miblen = sizeof(mib) / sizeof(mib[0]); | |
@@ -1028,6 +1028,16 @@ GTEST_DISABLE_MSC_DEPRECATED_PUSH_() | |||
| 1028 | 1028 | ||
| 1029 | 1029 | #if GTEST_HAS_STREAM_REDIRECTION | |
| 1030 | 1030 | ||
| 1031 | + namespace { | ||
| 1032 | + | ||
| 1033 | + #if defined(GTEST_OS_LINUX_ANDROID) || defined(GTEST_OS_IOS) | ||
| 1034 | + bool EndsWithPathSeparator(const std::string& path) { | ||
| 1035 | + return !path.empty() && path.back() == GTEST_PATH_SEP_[0]; | ||
| 1036 | + } | ||
| 1037 | + #endif | ||
| 1038 | + | ||
| 1039 | + } // namespace | ||
| 1040 | + | ||
| 1031 | 1041 | // Object that captures an output stream (stdout/stderr). | |
| 1032 | 1042 | class CapturedStream { | |
| 1033 | 1043 | public: | |
@@ -1064,7 +1074,13 @@ class CapturedStream { | |||
| 1064 | 1074 | // The location /data/local/tmp is directly accessible from native code. | |
| 1065 | 1075 | // '/sdcard' and other variants cannot be relied on, as they are not | |
| 1066 | 1076 | // guaranteed to be mounted, or may have a delay in mounting. | |
| 1067 | - name_template = "/data/local/tmp/"; | ||
| 1077 | + // | ||
| 1078 | + // However, prefer using the TMPDIR environment variable if set, as newer | ||
| 1079 | + // devices may have /data/local/tmp read-only. | ||
| 1080 | + name_template = TempDir(); | ||
| 1081 | + if (!EndsWithPathSeparator(name_template)) | ||
| 1082 | + name_template.push_back(GTEST_PATH_SEP_[0]); | ||
| 1083 | + | ||
| 1068 | 1084 | #elif defined(GTEST_OS_IOS) | |
| 1069 | 1085 | char user_temp_dir[PATH_MAX + 1]; | |
| 1070 | 1086 | ||
@@ -1084,7 +1100,7 @@ class CapturedStream { | |||
| 1084 | 1100 | ::confstr(_CS_DARWIN_USER_TEMP_DIR, user_temp_dir, sizeof(user_temp_dir)); | |
| 1085 | 1101 | ||
| 1086 | 1102 | name_template = user_temp_dir; | |
| 1087 | - if (name_template.back() != GTEST_PATH_SEP_[0]) | ||
| 1103 | + if (!EndsWithPathSeparator(name_template)) | ||
| 1088 | 1104 | name_template.push_back(GTEST_PATH_SEP_[0]); | |
| 1089 | 1105 | #else | |
| 1090 | 1106 | name_template = "/tmp/"; | |
| 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 8a6feab][] | ||
| 18 | + * [googletest d1467f5][] | ||
| 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 8a6feab | ||
| 190 | + ### googletest d1467f5 | ||
| 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 8a6feab]: #googletest-8a6feab | ||
| 322 | + [googletest d1467f5]: #googletest-d1467f5 | ||
| 323 | 323 | [histogram]: #histogram | |
| 324 | 324 | [icu-small]: #icu-small | |
| 325 | 325 | [llhttp]: #llhttp | |
| Back | FazBrowse Home | New Git URL |
0 commit comments