| 1 | // Copyright 2005, Google Inc.cxx . . $ `<file>/vendor/googletest/src/gtest-internal-inl.h`/ |
| 2 | // All rights reserved. |
| 3 | // |
| 4 | // Redistribution and use in source and binary forms, with or without |
| 5 | // modification, are permitted provided that the following conditions are |
| 6 | // met: |
| 7 | // |
| 8 | // * Redistributions of source code must retain the above copyright |
| 9 | // notice, this list of conditions and the following disclaimer. |
| 10 | // * Redistributions in binary form must reproduce the above |
| 11 | // copyright notice, this list of conditions and the following disclaimer |
| 12 | // in the documentation and/or other materials provided with the |
| 13 | // distribution. |
| 14 | // * Neither the name of Google Inc. nor the names of its |
| 15 | // contributors may be used to endorse or promote products derived from |
| 16 | // this software without specific prior written permission. |
| 17 | // |
| 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | |
| 30 | // Utility functions and classes used by the Google C++ testing framework.// |
| 31 | // This file contains purely Google Test's internal implementation. Please |
| 32 | // DO NOT #INCLUDE IT IN A USER PROGRAM. |
| 33 | |
| 34 | #ifndef GOOGLETEST_SRC_GTEST_INTERNAL_INL_H_ |
| 35 | #define GOOGLETEST_SRC_GTEST_INTERNAL_INL_H_cxx . . $ `vendor/googletest/src/gtest-internal-inl.h:35:9`! |
| 36 | |
| 37 | #ifndef _WIN32_WCE |
| 38 | #include <errno.h> |
| 39 | #endif // !_WIN32_WCE |
| 40 | #include <stddef.h> |
| 41 | #include <stdlib.h> // For strtoll/_strtoul64/malloc/free. |
| 42 | #include <string.h> // For memmove. |
| 43 | |
| 44 | #include <algorithm> |
| 45 | #include <cstdint> |
| 46 | #include <memory> |
| 47 | #include <set> |
| 48 | #include <string> |
| 49 | #include <unordered_map> |
| 50 | #include <vector> |
| 51 | |
| 52 | #include "gtest/internal/gtest-port.h"cxx . . $ `<file>/vendor/googletest/include/gtest/internal/gtest-port.h`/ |
| 53 | |
| 54 | #if GTEST_CAN_STREAM_RESULTS_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:709:9`! |
| 55 | #include <arpa/inet.h> // NOLINT |
| 56 | #include <netdb.h> // NOLINT |
| 57 | #endif |
| 58 | |
| 59 | #ifdef GTEST_OS_WINDOWS |
| 60 | #include <windows.h> // NOLINT |
| 61 | #endif // GTEST_OS_WINDOWS |
| 62 | |
| 63 | #include "gtest/gtest-spi.h"cxx . . $ `<file>/vendor/googletest/include/gtest/gtest-spi.h`/ |
| 64 | #include "gtest/gtest.h"cxx . . $ `<file>/vendor/googletest/include/gtest/gtest.h`/ |
| 65 | |
| 66 | GTEST_DISABLE_MSC_WARNINGS_PUSH_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:375:9`!(4251 \ |
| 67 | /* class A needs to have dll-interface to be used by clients of class B */) |
| 68 | |
| 69 | // Declares the flags. |
| 70 | // |
| 71 | // We don't want the users to modify this flag in the code, but want |
| 72 | // Google Test's own unit tests to be able to access it. Therefore we |
| 73 | // declare it here as opposed to in gtest.h. |
| 74 | GTEST_DECLARE_bool_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2292:9`!(death_test_use_fork); |
| 75 | |
| 76 | namespace testingcxx . . $ testing/ { |
| 77 | namespace internalcxx . . $ testing/internal/ { |
| 78 | |
| 79 | // The value of GetTestTypeId() as seen from within the Google Test |
| 80 | // library. This is solely for testing GetTestTypeId(). |
| 81 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! extern const TypeIdcxx . . $ testing/internal/TypeId# kTestTypeIdInGoogleTestcxx . . $ testing/internal/kTestTypeIdInGoogleTest.; |
| 82 | |
| 83 | // A valid random seed must be in [1, kMaxRandomSeed]. |
| 84 | const int kMaxRandomSeedcxx . . $ testing/internal/kMaxRandomSeed. = 99999; |
| 85 | |
| 86 | // g_help_flag is true if and only if the --help flag or an equivalent form |
| 87 | // is specified on the command line. |
| 88 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! extern bool g_help_flagcxx . . $ testing/internal/g_help_flag.; |
| 89 | |
| 90 | // Returns the current time in milliseconds. |
| 91 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! TimeInMilliscxx . . $ testing/internal/TimeInMillis# GetTimeInMilliscxx . . $ testing/internal/GetTimeInMillis(da6335ded91d79c2).(); |
| 92 | |
| 93 | // Returns true if and only if Google Test should use colors in the output. |
| 94 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! bool ShouldUseColorcxx . . $ testing/internal/ShouldUseColor(efaadfb7dc14930a).(bool stdout_is_tty); |
| 95 | |
| 96 | // Formats the given time in milliseconds as seconds. If the input is an exact N |
| 97 | // seconds, the output has a trailing decimal point (e.g., "N." instead of "N"). |
| 98 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! stdcxx . . $ std/::stringcxx . . $ std/string# FormatTimeInMillisAsSecondscxx . . $ testing/internal/FormatTimeInMillisAsSeconds(2c88ed78ff9aa4cf).(TimeInMilliscxx . . $ testing/internal/TimeInMillis# ms); |
| 99 | |
| 100 | // Converts the given time in milliseconds to a date string in the ISO 8601 |
| 101 | // format, without the timezone information. N.B.: due to the use the |
| 102 | // non-reentrant localtime() function, this function is not thread safe. Do |
| 103 | // not use it in any code that can be called from multiple threads. |
| 104 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! stdcxx . . $ std/::stringcxx . . $ std/string# FormatEpochTimeInMillisAsIso8601cxx . . $ testing/internal/FormatEpochTimeInMillisAsIso8601(2c88ed78ff9aa4cf).(TimeInMilliscxx . . $ testing/internal/TimeInMillis# ms); |
| 105 | |
| 106 | // Parses a string for an Int32 flag, in the form of "--flag=value". |
| 107 | // |
| 108 | // On success, stores the value of the flag in *value, and returns |
| 109 | // true. On failure, returns false without changing *value. |
| 110 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! bool ParseFlagcxx . . $ testing/internal/ParseFlag(cad719e5415ba6cc).(const char* str, const char* flag, int32_tcxx . . $ int32_t#* value); |
| 111 | |
| 112 | // Returns a random seed in range [1, kMaxRandomSeed] based on the |
| 113 | // given --gtest_random_seed flag value. |
| 114 | inline int GetRandomSeedFromFlagcxx . . $ testing/internal/GetRandomSeedFromFlag(7864480464b09eea).(int32_tcxx . . $ int32_t# random_seed_flag) { |
| 115 | const unsigned int raw_seed = |
| 116 | (random_seed_flag == 0) ? static_cast<unsigned int>(GetTimeInMilliscxx . . $ testing/internal/GetTimeInMillis(da6335ded91d79c2).()) |
| 117 | : static_cast<unsigned int>(random_seed_flag); |
| 118 | |
| 119 | // Normalizes the actual seed to range [1, kMaxRandomSeed] such that |
| 120 | // it's easy to type. |
| 121 | const int normalized_seed = |
| 122 | static_cast<int>((raw_seed - 1U) % |
| 123 | static_cast<unsigned int>(kMaxRandomSeedcxx . . $ testing/internal/kMaxRandomSeed.)) + |
| 124 | 1; |
| 125 | return normalized_seed; |
| 126 | } |
| 127 | |
| 128 | // Returns the first valid random seed after 'seed'. The behavior is |
| 129 | // undefined if 'seed' is invalid. The seed after kMaxRandomSeed is |
| 130 | // considered to be 1. |
| 131 | inline int GetNextRandomSeedcxx . . $ testing/internal/GetNextRandomSeed(7864480464b09eea).(int seed) { |
| 132 | GTEST_CHECK_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:1086:9`!(1 <= seed && seed <= kMaxRandomSeed) |
| 133 | <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Invalid random seed " <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). seed <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " - must be in [1, " |
| 134 | <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). kMaxRandomSeedcxx . . $ testing/internal/kMaxRandomSeed. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "]."; |
| 135 | const int next_seed = seed + 1; |
| 136 | return (next_seed > kMaxRandomSeedcxx . . $ testing/internal/kMaxRandomSeed.) ? 1 : next_seed; |
| 137 | } |
| 138 | |
| 139 | // This class saves the values of all Google Test flags in its c'tor, and |
| 140 | // restores them in its d'tor. |
| 141 | class GTestFlagSavercxx . . $ testing/internal/GTestFlagSaver# { |
| 142 | public: |
| 143 | // The c'tor. |
| 144 | GTestFlagSavercxx . . $ testing/internal/GTestFlagSaver#GTestFlagSaver(49f6e7a06ebc5aa8).() { |
| 145 | also_run_disabled_tests_cxx . . $ testing/internal/GTestFlagSaver#also_run_disabled_tests_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(also_run_disabled_tests); |
| 146 | break_on_failure_cxx . . $ testing/internal/GTestFlagSaver#break_on_failure_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(break_on_failure); |
| 147 | catch_exceptions_cxx . . $ testing/internal/GTestFlagSaver#catch_exceptions_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(catch_exceptions); |
| 148 | color_cxx . . $ testing/internal/GTestFlagSaver#color_. =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(color); |
| 149 | death_test_style_cxx . . $ testing/internal/GTestFlagSaver#death_test_style_. =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(death_test_style); |
| 150 | death_test_use_fork_cxx . . $ testing/internal/GTestFlagSaver#death_test_use_fork_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(death_test_use_fork); |
| 151 | fail_fast_cxx . . $ testing/internal/GTestFlagSaver#fail_fast_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(fail_fast); |
| 152 | filter_cxx . . $ testing/internal/GTestFlagSaver#filter_. =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(filter); |
| 153 | internal_run_death_test_cxx . . $ testing/internal/GTestFlagSaver#internal_run_death_test_. =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(internal_run_death_test); |
| 154 | list_tests_cxx . . $ testing/internal/GTestFlagSaver#list_tests_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(list_tests); |
| 155 | output_cxx . . $ testing/internal/GTestFlagSaver#output_. =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(output); |
| 156 | brief_cxx . . $ testing/internal/GTestFlagSaver#brief_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(brief); |
| 157 | print_time_cxx . . $ testing/internal/GTestFlagSaver#print_time_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(print_time); |
| 158 | print_utf8_cxx . . $ testing/internal/GTestFlagSaver#print_utf8_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(print_utf8); |
| 159 | random_seed_cxx . . $ testing/internal/GTestFlagSaver#random_seed_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(random_seed); |
| 160 | repeat_cxx . . $ testing/internal/GTestFlagSaver#repeat_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(repeat); |
| 161 | recreate_environments_when_repeating_cxx . . $ testing/internal/GTestFlagSaver#recreate_environments_when_repeating_. = |
| 162 | GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(recreate_environments_when_repeating); |
| 163 | shuffle_cxx . . $ testing/internal/GTestFlagSaver#shuffle_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(shuffle); |
| 164 | stack_trace_depth_cxx . . $ testing/internal/GTestFlagSaver#stack_trace_depth_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(stack_trace_depth); |
| 165 | stream_result_to_cxx . . $ testing/internal/GTestFlagSaver#stream_result_to_. =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(stream_result_to); |
| 166 | throw_on_failure_cxx . . $ testing/internal/GTestFlagSaver#throw_on_failure_. = GTEST_FLAG_GETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2310:9`!(throw_on_failure); |
| 167 | } |
| 168 | |
| 169 | // The d'tor is not virtual. DO NOT INHERIT FROM THIS CLASS. |
| 170 | ~cxx . . $ testing/internal/GTestFlagSaver#`~GTestFlagSaver`(ced63f7c635d850d).GTestFlagSavercxx . . $ testing/internal/GTestFlagSaver#() { |
| 171 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(also_run_disabled_tests, also_run_disabled_tests_); |
| 172 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(break_on_failure, break_on_failure_); |
| 173 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(catch_exceptions, catch_exceptions_); |
| 174 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(color, color_); |
| 175 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(death_test_style, death_test_style_); |
| 176 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(death_test_use_fork, death_test_use_fork_); |
| 177 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(filter, filter_); |
| 178 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(fail_fast, fail_fast_); |
| 179 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(internal_run_death_test, internal_run_death_test_); |
| 180 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(list_tests, list_tests_); |
| 181 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(output, output_); |
| 182 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(brief, brief_); |
| 183 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(print_time, print_time_); |
| 184 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(print_utf8, print_utf8_); |
| 185 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(random_seed, random_seed_); |
| 186 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(repeat, repeat_); |
| 187 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(recreate_environments_when_repeating, |
| 188 | recreate_environments_when_repeating_); |
| 189 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(shuffle, shuffle_); |
| 190 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(stack_trace_depth, stack_trace_depth_); |
| 191 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(stream_result_to, stream_result_to_); |
| 192 | GTEST_FLAG_SETcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:2311:9`!(throw_on_failure, throw_on_failure_); |
| 193 | } |
| 194 | |
| 195 | private: |
| 196 | // Fields for saving the original values of flags. |
| 197 | bool also_run_disabled_tests_cxx . . $ testing/internal/GTestFlagSaver#also_run_disabled_tests_.; |
| 198 | bool break_on_failure_cxx . . $ testing/internal/GTestFlagSaver#break_on_failure_.; |
| 199 | bool catch_exceptions_cxx . . $ testing/internal/GTestFlagSaver#catch_exceptions_.; |
| 200 | stdcxx . . $ std/::stringcxx . . $ std/string# color_cxx . . $ testing/internal/GTestFlagSaver#color_.; |
| 201 | stdcxx . . $ std/::stringcxx . . $ std/string# death_test_style_cxx . . $ testing/internal/GTestFlagSaver#death_test_style_.; |
| 202 | bool death_test_use_fork_cxx . . $ testing/internal/GTestFlagSaver#death_test_use_fork_.; |
| 203 | bool fail_fast_cxx . . $ testing/internal/GTestFlagSaver#fail_fast_.; |
| 204 | stdcxx . . $ std/::stringcxx . . $ std/string# filter_cxx . . $ testing/internal/GTestFlagSaver#filter_.; |
| 205 | stdcxx . . $ std/::stringcxx . . $ std/string# internal_run_death_test_cxx . . $ testing/internal/GTestFlagSaver#internal_run_death_test_.; |
| 206 | bool list_tests_cxx . . $ testing/internal/GTestFlagSaver#list_tests_.; |
| 207 | stdcxx . . $ std/::stringcxx . . $ std/string# output_cxx . . $ testing/internal/GTestFlagSaver#output_.; |
| 208 | bool brief_cxx . . $ testing/internal/GTestFlagSaver#brief_.; |
| 209 | bool print_time_cxx . . $ testing/internal/GTestFlagSaver#print_time_.; |
| 210 | bool print_utf8_cxx . . $ testing/internal/GTestFlagSaver#print_utf8_.; |
| 211 | int32_tcxx . . $ int32_t# random_seed_cxx . . $ testing/internal/GTestFlagSaver#random_seed_.; |
| 212 | int32_tcxx . . $ int32_t# repeat_cxx . . $ testing/internal/GTestFlagSaver#repeat_.; |
| 213 | bool recreate_environments_when_repeating_cxx . . $ testing/internal/GTestFlagSaver#recreate_environments_when_repeating_.; |
| 214 | bool shuffle_cxx . . $ testing/internal/GTestFlagSaver#shuffle_.; |
| 215 | int32_tcxx . . $ int32_t# stack_trace_depth_cxx . . $ testing/internal/GTestFlagSaver#stack_trace_depth_.; |
| 216 | stdcxx . . $ std/::stringcxx . . $ std/string# stream_result_to_cxx . . $ testing/internal/GTestFlagSaver#stream_result_to_.; |
| 217 | bool throw_on_failure_cxx . . $ testing/internal/GTestFlagSaver#throw_on_failure_.; |
| 218 | }; |
| 219 | |
| 220 | // Converts a Unicode code point to a narrow string in UTF-8 encoding. |
| 221 | // code_point parameter is of type UInt32 because wchar_t may not be |
| 222 | // wide enough to contain a code point. |
| 223 | // If the code_point is not a valid Unicode code point |
| 224 | // (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted |
| 225 | // to "(Invalid Unicode 0xXXXXXXXX)". |
| 226 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! stdcxx . . $ std/::stringcxx . . $ std/string# CodePointToUtf8cxx . . $ testing/internal/CodePointToUtf8(8297fed3afd4179b).(uint32_tcxx . . $ uint32_t# code_point); |
| 227 | |
| 228 | // Converts a wide string to a narrow string in UTF-8 encoding. |
| 229 | // The wide string is assumed to have the following encoding: |
| 230 | // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin) |
| 231 | // UTF-32 if sizeof(wchar_t) == 4 (on Linux) |
| 232 | // Parameter str points to a null-terminated wide string. |
| 233 | // Parameter num_chars may additionally limit the number |
| 234 | // of wchar_t characters processed. -1 is used when the entire string |
| 235 | // should be processed. |
| 236 | // If the string contains code points that are not valid Unicode code points |
| 237 | // (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output |
| 238 | // as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding |
| 239 | // and contains invalid UTF-16 surrogate pairs, values in those pairs |
| 240 | // will be encoded as individual Unicode characters from Basic Normal Plane. |
| 241 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! stdcxx . . $ std/::stringcxx . . $ std/string# WideStringToUtf8cxx . . $ testing/internal/WideStringToUtf8(bbf0ccd6fb23230b).(const wchar_t* str, int num_chars); |
| 242 | |
| 243 | // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file |
| 244 | // if the variable is present. If a file already exists at this location, this |
| 245 | // function will write over it. If the variable is present, but the file cannot |
| 246 | // be created, prints an error and exits. |
| 247 | void WriteToShardStatusFileIfNeededcxx . . $ testing/internal/WriteToShardStatusFileIfNeeded(49f6e7a06ebc5aa8).(); |
| 248 | |
| 249 | // Checks whether sharding is enabled by examining the relevant |
| 250 | // environment variable values. If the variables are present, |
| 251 | // but inconsistent (e.g., shard_index >= total_shards), prints |
| 252 | // an error and exits. If in_subprocess_for_death_test, sharding is |
| 253 | // disabled because it must only be applied to the original test |
| 254 | // process. Otherwise, we could filter out death tests we intended to execute. |
| 255 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! bool ShouldShardcxx . . $ testing/internal/ShouldShard(567fbfac950d45).(const char* total_shards_str, |
| 256 | const char* shard_index_str, |
| 257 | bool in_subprocess_for_death_test); |
| 258 | |
| 259 | // Parses the environment variable var as a 32-bit integer. If it is unset, |
| 260 | // returns default_val. If it is not a 32-bit integer, prints an error and |
| 261 | // and aborts. |
| 262 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! int32_tcxx . . $ int32_t# Int32FromEnvOrDiecxx . . $ testing/internal/Int32FromEnvOrDie(cb7559238bb26814).(const char* env_var, int32_tcxx . . $ int32_t# default_val); |
| 263 | |
| 264 | // Given the total number of shards, the shard index, and the test id, |
| 265 | // returns true if and only if the test should be run on this shard. The test id |
| 266 | // is some arbitrary but unique non-negative integer assigned to each test |
| 267 | // method. Assumes that 0 <= shard_index < total_shards. |
| 268 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! bool ShouldRunTestOnShardcxx . . $ testing/internal/ShouldRunTestOnShard(1432650661211742).(int total_shards, int shard_index, |
| 269 | int test_id); |
| 270 | |
| 271 | // STL container utilities. |
| 272 | |
| 273 | // Returns the number of elements in the given container that satisfy |
| 274 | // the given predicate. |
| 275 | template <class Container, typename Predicate> |
| 276 | inline int CountIfcxx . . $ testing/internal/CountIf(4fecb8fe25598a3a).(const Container& c, Predicate predicate) { |
| 277 | // Implemented as an explicit loop since std::count_if() in libCstd on |
| 278 | // Solaris has a non-standard signature. |
| 279 | int count = 0; |
| 280 | for (auto it = c.begin(); it !=cxx . . $ testing/internal/`operator!=`(67d151cd10fc7f68). c.end(); ++it) { |
| 281 | if (predicate(*it)) ++count; |
| 282 | } |
| 283 | return count; |
| 284 | } |
| 285 | |
| 286 | // Applies a function/functor to each element in the container. |
| 287 | template <class Container, typename Functor> |
| 288 | void ForEachcxx . . $ testing/internal/ForEach(2b7ade8bab7b7f06).(const Container& c, Functor functor) { |
| 289 | stdcxx . . $ std/::for_eachcxx . . $ std/for_each(88304b602929f6f4).(c.begin(), c.end(), functor); |
| 290 | } |
| 291 | |
| 292 | // Returns the i-th element of the vector, or default_value if i is not |
| 293 | // in range [0, v.size()). |
| 294 | template <typename E> |
| 295 | inline E GetElementOrcxx . . $ testing/internal/GetElementOr(55e2be3fee2fa215).(const stdcxx . . $ std/::vectorcxx . . $ std/vector#<E>& v, int i, E default_value) { |
| 296 | return (i < 0 || i >= static_cast<int>(v.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).())) ? default_value |
| 297 | : v[static_cast<size_t>(i)]; |
| 298 | } |
| 299 | |
| 300 | // Performs an in-place shuffle of a range of the vector's elements. |
| 301 | // 'begin' and 'end' are element indices as an STL-style range; |
| 302 | // i.e. [begin, end) are shuffled, where 'end' == size() means to |
| 303 | // shuffle to the end of the vector. |
| 304 | template <typename E> |
| 305 | void ShuffleRangecxx . . $ testing/internal/ShuffleRange(a28cb367379ee81f).(internalcxx . . $ testing/internal/::Randomcxx . . $ testing/internal/Random#* random, int begin, int end, |
| 306 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<E>* v) { |
| 307 | const int size = static_cast<int>(v->sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()); |
| 308 | GTEST_CHECK_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:1086:9`!(0 <= begin && begin <= size) |
| 309 | <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Invalid shuffle range start " <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). begin <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). ": must be in range [0, " |
| 310 | <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). size <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "]."; |
| 311 | GTEST_CHECK_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:1086:9`!(begin <= end && end <= size) |
| 312 | <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Invalid shuffle range finish " <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). end <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). ": must be in range [" |
| 313 | <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). begin <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). ", " <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). size <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "]."; |
| 314 | |
| 315 | // Fisher-Yates shuffle, from |
| 316 | // https://en.wikipedia.org/wiki/Fisher-Yates_shuffle |
| 317 | for (int range_width = end - begin; range_width >= 2; range_width--) { |
| 318 | const int last_in_range = begin + range_width - 1; |
| 319 | const int selected = |
| 320 | begin + |
| 321 | static_cast<int>(random->Generatecxx . . $ testing/internal/Random#Generate(2141b656ce2cc063).(static_cast<uint32_tcxx . . $ uint32_t#>(range_width))); |
| 322 | stdcxx . . $ std/::swapcxx . . $ std/swap(c75b8fd57d7c2e06).((*v)[static_cast<size_t>(selected)], |
| 323 | (*v)[static_cast<size_t>(last_in_range)]); |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | // Performs an in-place shuffle of the vector's elements. |
| 328 | template <typename E> |
| 329 | inline void Shufflecxx . . $ testing/internal/Shuffle(a2501f894168922).(internalcxx . . $ testing/internal/::Randomcxx . . $ testing/internal/Random#* random, stdcxx . . $ std/::vectorcxx . . $ std/vector#<E>* v) { |
| 330 | ShuffleRangecxx . . $ testing/internal/ShuffleRange(a28cb367379ee81f).(random, 0, static_cast<int>(v->sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()), v); |
| 331 | } |
| 332 | |
| 333 | // A function for deleting an object. Handy for being used as a |
| 334 | // functor. |
| 335 | template <typename T> |
| 336 | static void Deletecxx . . $ testing/internal/Delete(ebd0a1552f8ce24f).(T* x) { |
| 337 | delete x; |
| 338 | } |
| 339 | |
| 340 | // A predicate that checks the key of a TestProperty against a known key. |
| 341 | // |
| 342 | // TestPropertyKeyIs is copyable. |
| 343 | class TestPropertyKeyIscxx . . $ testing/internal/TestPropertyKeyIs# { |
| 344 | public: |
| 345 | // Constructor. |
| 346 | // |
| 347 | // TestPropertyKeyIs has NO default constructor. |
| 348 | explicit TestPropertyKeyIscxx . . $ testing/internal/TestPropertyKeyIs#TestPropertyKeyIs(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string#& key) : key_cxx . . $ testing/internal/TestPropertyKeyIs#key_.(key) {} |
| 349 | |
| 350 | // Returns true if and only if the test name of test property matches on key_. |
| 351 | bool operatorcxx . . $ testing/internal/TestPropertyKeyIs#`operator()`(92ab1f4f521db1f7).()(const TestPropertycxx . . $ testing/TestProperty#& test_property) const { |
| 352 | return test_property.keycxx . . $ testing/TestProperty#key(a9f41ea0e82d88cf).() ==cxx . . $ std/`operator==`(3a786e8ce7e53c2c). key_cxx . . $ testing/internal/TestPropertyKeyIs#key_.; |
| 353 | } |
| 354 | |
| 355 | private: |
| 356 | stdcxx . . $ std/::stringcxx . . $ std/string# key_cxx . . $ testing/internal/TestPropertyKeyIs#key_.; |
| 357 | }; |
| 358 | |
| 359 | // Class UnitTestOptions. |
| 360 | // |
| 361 | // This class contains functions for processing options the user |
| 362 | // specifies when running the tests. It has only static members. |
| 363 | // |
| 364 | // In most cases, the user can specify an option using either an |
| 365 | // environment variable or a command line flag. E.g. you can set the |
| 366 | // test filter using either GTEST_FILTER or --gtest_filter. If both |
| 367 | // the variable and the flag are present, the latter overrides the |
| 368 | // former. |
| 369 | class GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! UnitTestOptionscxx . . $ testing/internal/UnitTestOptions# { |
| 370 | public: |
| 371 | // Functions for processing the gtest_output flag. |
| 372 | |
| 373 | // Returns the output format, or "" for normal printed output. |
| 374 | static stdcxx . . $ std/::stringcxx . . $ std/string# GetOutputFormatcxx . . $ testing/internal/UnitTestOptions#GetOutputFormat(efd28698952f529a).(); |
| 375 | |
| 376 | // Returns the absolute path of the requested output file, or the |
| 377 | // default (test_detail.xml in the original working directory) if |
| 378 | // none was explicitly specified. |
| 379 | static stdcxx . . $ std/::stringcxx . . $ std/string# GetAbsolutePathToOutputFilecxx . . $ testing/internal/UnitTestOptions#GetAbsolutePathToOutputFile(efd28698952f529a).(); |
| 380 | |
| 381 | // Functions for processing the gtest_filter flag. |
| 382 | |
| 383 | // Returns true if and only if the user-specified filter matches the test |
| 384 | // suite name and the test name. |
| 385 | static bool FilterMatchesTestcxx . . $ testing/internal/UnitTestOptions#FilterMatchesTest(1667653f663d0d88).(const stdcxx . . $ std/::stringcxx . . $ std/string#& test_suite_name, |
| 386 | const stdcxx . . $ std/::stringcxx . . $ std/string#& test_name); |
| 387 | |
| 388 | #ifdef GTEST_OS_WINDOWS |
| 389 | // Function for supporting the gtest_catch_exception flag. |
| 390 | |
| 391 | // Returns EXCEPTION_EXECUTE_HANDLER if given SEH exception was handled, or |
| 392 | // EXCEPTION_CONTINUE_SEARCH otherwise. |
| 393 | // This function is useful as an __except condition. |
| 394 | static int GTestProcessSEH(DWORD seh_code, const char* location); |
| 395 | #endif // GTEST_OS_WINDOWS |
| 396 | |
| 397 | // Returns true if "name" matches the ':' separated list of glob-style |
| 398 | // filters in "filter". |
| 399 | static bool MatchesFiltercxx . . $ testing/internal/UnitTestOptions#MatchesFilter(5ac6018ec8a6670e).(const stdcxx . . $ std/::stringcxx . . $ std/string#& name, const char* filter); |
| 400 | }; |
| 401 | |
| 402 | #if GTEST_HAS_FILE_SYSTEMcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:528:9`! |
| 403 | // Returns the current application's name, removing directory path if that |
| 404 | // is present. Used by UnitTestOptions::GetOutputFile. |
| 405 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! FilePathcxx . . $ testing/internal/FilePath# GetCurrentExecutableNamecxx . . $ testing/internal/GetCurrentExecutableName(b433dc4999167564).(); |
| 406 | #endif // GTEST_HAS_FILE_SYSTEM |
| 407 | |
| 408 | // The role interface for getting the OS stack trace as a string. |
| 409 | class OsStackTraceGetterInterfacecxx . . $ testing/internal/OsStackTraceGetterInterface# { |
| 410 | public: |
| 411 | OsStackTraceGetterInterfacecxx . . $ testing/internal/OsStackTraceGetterInterface#OsStackTraceGetterInterface(ced63f7c635d850d).() = default; |
| 412 | virtual ~cxx . . $ testing/internal/OsStackTraceGetterInterface#`~OsStackTraceGetterInterface`(ced63f7c635d850d).OsStackTraceGetterInterfacecxx . . $ testing/internal/OsStackTraceGetterInterface#() = default; |
| 413 | |
| 414 | // Returns the current OS stack trace as an std::string. Parameters: |
| 415 | // |
| 416 | // max_depth - the maximum number of stack frames to be included |
| 417 | // in the trace. |
| 418 | // skip_count - the number of top frames to be skipped; doesn't count |
| 419 | // against max_depth. |
| 420 | virtual stdcxx . . $ std/::stringcxx . . $ std/string# CurrentStackTracecxx . . $ testing/internal/OsStackTraceGetterInterface#CurrentStackTrace(2d2600a4e2e1c515).(int max_depth, int skip_count) = 0; |
| 421 | |
| 422 | // UponLeavingGTest() should be called immediately before Google Test calls |
| 423 | // user code. It saves some information about the current stack that |
| 424 | // CurrentStackTrace() will use to find and hide Google Test stack frames. |
| 425 | virtual void UponLeavingGTestcxx . . $ testing/internal/OsStackTraceGetterInterface#UponLeavingGTest(49f6e7a06ebc5aa8).() = 0; |
| 426 | |
| 427 | // This string is inserted in place of stack frames that are part of |
| 428 | // Google Test's implementation. |
| 429 | static const char* const kElidedFramesMarkercxx . . $ testing/internal/OsStackTraceGetterInterface#kElidedFramesMarker.; |
| 430 | |
| 431 | private: |
| 432 | OsStackTraceGetterInterfacecxx . . $ testing/internal/OsStackTraceGetterInterface#OsStackTraceGetterInterface(463b3b62983da1e0).(const OsStackTraceGetterInterfacecxx . . $ testing/internal/OsStackTraceGetterInterface#&) = delete; |
| 433 | OsStackTraceGetterInterfacecxx . . $ testing/internal/OsStackTraceGetterInterface#& operatorcxx . . $ testing/internal/OsStackTraceGetterInterface#`operator=`(b67863df5e2223f5).=(const OsStackTraceGetterInterfacecxx . . $ testing/internal/OsStackTraceGetterInterface#&) = |
| 434 | delete; |
| 435 | }; |
| 436 | |
| 437 | // A working implementation of the OsStackTraceGetterInterface interface. |
| 438 | class OsStackTraceGettercxx . . $ testing/internal/OsStackTraceGetter# : public OsStackTraceGetterInterfacecxx . . $ testing/internal/OsStackTraceGetterInterface# { |
| 439 | public: |
| 440 | OsStackTraceGettercxx . . $ testing/internal/OsStackTraceGetter#OsStackTraceGetter(ced63f7c635d850d).() = default; |
| 441 | |
| 442 | stdcxx . . $ std/::stringcxx . . $ std/string# CurrentStackTracecxx . . $ testing/internal/OsStackTraceGetter#CurrentStackTrace(2d2600a4e2e1c515).(int max_depth, int skip_count) override; |
| 443 | void UponLeavingGTestcxx . . $ testing/internal/OsStackTraceGetter#UponLeavingGTest(49f6e7a06ebc5aa8).() override; |
| 444 | |
| 445 | private: |
| 446 | #ifdef GTEST_HAS_ABSL |
| 447 | Mutex mutex_; // Protects all internal state. |
| 448 | |
| 449 | // We save the stack frame below the frame that calls user code. |
| 450 | // We do this because the address of the frame immediately below |
| 451 | // the user code changes between the call to UponLeavingGTest() |
| 452 | // and any calls to the stack trace code from within the user code. |
| 453 | void* caller_frame_ = nullptr; |
| 454 | #endif // GTEST_HAS_ABSL |
| 455 | |
| 456 | OsStackTraceGettercxx . . $ testing/internal/OsStackTraceGetter#OsStackTraceGetter(1d27fd8784a22eed).(const OsStackTraceGettercxx . . $ testing/internal/OsStackTraceGetter#&) = delete; |
| 457 | OsStackTraceGettercxx . . $ testing/internal/OsStackTraceGetter#& operatorcxx . . $ testing/internal/OsStackTraceGetter#`operator=`(c2c6f6999fc63d3b).=(const OsStackTraceGettercxx . . $ testing/internal/OsStackTraceGetter#&) = delete; |
| 458 | }; |
| 459 | |
| 460 | // Information about a Google Test trace point. |
| 461 | struct TraceInfocxx . . $ testing/internal/TraceInfo# { |
| 462 | const char* filecxx . . $ testing/internal/TraceInfo#file.; |
| 463 | int linecxx . . $ testing/internal/TraceInfo#line.; |
| 464 | stdcxx . . $ std/::stringcxx . . $ std/string# messagecxx . . $ testing/internal/TraceInfo#message.; |
| 465 | }; |
| 466 | |
| 467 | // This is the default global test part result reporter used in UnitTestImpl. |
| 468 | // This class should only be used by UnitTestImpl. |
| 469 | class DefaultGlobalTestPartResultReportercxx . . $ testing/internal/DefaultGlobalTestPartResultReporter# |
| 470 | : public TestPartResultReporterInterfacecxx . . $ testing/TestPartResultReporterInterface# { |
| 471 | public: |
| 472 | explicit DefaultGlobalTestPartResultReportercxx . . $ testing/internal/DefaultGlobalTestPartResultReporter#DefaultGlobalTestPartResultReporter(f7a6a0a4aa89cea).(UnitTestImplcxx . . $ testing/internal/UnitTestImpl#* unit_test); |
| 473 | // Implements the TestPartResultReporterInterface. Reports the test part |
| 474 | // result in the current test. |
| 475 | void ReportTestPartResultcxx . . $ testing/internal/DefaultGlobalTestPartResultReporter#ReportTestPartResult(1671c14f799d0273).(const TestPartResultcxx . . $ testing/TestPartResult#& result) override; |
| 476 | |
| 477 | private: |
| 478 | UnitTestImplcxx . . $ testing/internal/UnitTestImpl#* const unit_test_cxx . . $ testing/internal/DefaultGlobalTestPartResultReporter#unit_test_.; |
| 479 | |
| 480 | DefaultGlobalTestPartResultReportercxx . . $ testing/internal/DefaultGlobalTestPartResultReporter#DefaultGlobalTestPartResultReporter(146acacad413a825).( |
| 481 | const DefaultGlobalTestPartResultReportercxx . . $ testing/internal/DefaultGlobalTestPartResultReporter#&) = delete; |
| 482 | DefaultGlobalTestPartResultReportercxx . . $ testing/internal/DefaultGlobalTestPartResultReporter#& operatorcxx . . $ testing/internal/DefaultGlobalTestPartResultReporter#`operator=`(d158478d88508c20).=( |
| 483 | const DefaultGlobalTestPartResultReportercxx . . $ testing/internal/DefaultGlobalTestPartResultReporter#&) = delete; |
| 484 | }; |
| 485 | |
| 486 | // This is the default per thread test part result reporter used in |
| 487 | // UnitTestImpl. This class should only be used by UnitTestImpl. |
| 488 | class DefaultPerThreadTestPartResultReportercxx . . $ testing/internal/DefaultPerThreadTestPartResultReporter# |
| 489 | : public TestPartResultReporterInterfacecxx . . $ testing/TestPartResultReporterInterface# { |
| 490 | public: |
| 491 | explicit DefaultPerThreadTestPartResultReportercxx . . $ testing/internal/DefaultPerThreadTestPartResultReporter#DefaultPerThreadTestPartResultReporter(f7a6a0a4aa89cea).(UnitTestImplcxx . . $ testing/internal/UnitTestImpl#* unit_test); |
| 492 | // Implements the TestPartResultReporterInterface. The implementation just |
| 493 | // delegates to the current global test part result reporter of *unit_test_. |
| 494 | void ReportTestPartResultcxx . . $ testing/internal/DefaultPerThreadTestPartResultReporter#ReportTestPartResult(1671c14f799d0273).(const TestPartResultcxx . . $ testing/TestPartResult#& result) override; |
| 495 | |
| 496 | private: |
| 497 | UnitTestImplcxx . . $ testing/internal/UnitTestImpl#* const unit_test_cxx . . $ testing/internal/DefaultPerThreadTestPartResultReporter#unit_test_.; |
| 498 | |
| 499 | DefaultPerThreadTestPartResultReportercxx . . $ testing/internal/DefaultPerThreadTestPartResultReporter#DefaultPerThreadTestPartResultReporter(55c3f02fbb238f10).( |
| 500 | const DefaultPerThreadTestPartResultReportercxx . . $ testing/internal/DefaultPerThreadTestPartResultReporter#&) = delete; |
| 501 | DefaultPerThreadTestPartResultReportercxx . . $ testing/internal/DefaultPerThreadTestPartResultReporter#& operatorcxx . . $ testing/internal/DefaultPerThreadTestPartResultReporter#`operator=`(2e5ac385a2b2a30e).=( |
| 502 | const DefaultPerThreadTestPartResultReportercxx . . $ testing/internal/DefaultPerThreadTestPartResultReporter#&) = delete; |
| 503 | }; |
| 504 | |
| 505 | // The private implementation of the UnitTest class. We don't protect |
| 506 | // the methods under a mutex, as this class is not accessible by a |
| 507 | // user and the UnitTest class that delegates work to this class does |
| 508 | // proper locking. |
| 509 | class GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! UnitTestImplcxx . . $ testing/internal/UnitTestImpl# { |
| 510 | public: |
| 511 | explicit UnitTestImplcxx . . $ testing/internal/UnitTestImpl#UnitTestImpl(8c388105a68473a3).(UnitTestcxx . . $ testing/UnitTest#* parent); |
| 512 | virtual ~cxx . . $ testing/internal/UnitTestImpl#`~UnitTestImpl`(ced63f7c635d850d).UnitTestImplcxx . . $ testing/internal/UnitTestImpl#(); |
| 513 | |
| 514 | // There are two different ways to register your own TestPartResultReporter. |
| 515 | // You can register your own reporter to listen either only for test results |
| 516 | // from the current thread or for results from all threads. |
| 517 | // By default, each per-thread test result reporter just passes a new |
| 518 | // TestPartResult to the global test result reporter, which registers the |
| 519 | // test part result for the currently running test. |
| 520 | |
| 521 | // Returns the global test part result reporter. |
| 522 | TestPartResultReporterInterfacecxx . . $ testing/TestPartResultReporterInterface#* GetGlobalTestPartResultReportercxx . . $ testing/internal/UnitTestImpl#GetGlobalTestPartResultReporter(abe4ee604a4edf49).(); |
| 523 | |
| 524 | // Sets the global test part result reporter. |
| 525 | void SetGlobalTestPartResultReportercxx . . $ testing/internal/UnitTestImpl#SetGlobalTestPartResultReporter(5baf5eb98de72695).( |
| 526 | TestPartResultReporterInterfacecxx . . $ testing/TestPartResultReporterInterface#* reporter); |
| 527 | |
| 528 | // Returns the test part result reporter for the current thread. |
| 529 | TestPartResultReporterInterfacecxx . . $ testing/TestPartResultReporterInterface#* GetTestPartResultReporterForCurrentThreadcxx . . $ testing/internal/UnitTestImpl#GetTestPartResultReporterForCurrentThread(abe4ee604a4edf49).(); |
| 530 | |
| 531 | // Sets the test part result reporter for the current thread. |
| 532 | void SetTestPartResultReporterForCurrentThreadcxx . . $ testing/internal/UnitTestImpl#SetTestPartResultReporterForCurrentThread(5baf5eb98de72695).( |
| 533 | TestPartResultReporterInterfacecxx . . $ testing/TestPartResultReporterInterface#* reporter); |
| 534 | |
| 535 | // Gets the number of successful test suites. |
| 536 | int successful_test_suite_countcxx . . $ testing/internal/UnitTestImpl#successful_test_suite_count(455f465bc33b4cdf).() const; |
| 537 | |
| 538 | // Gets the number of failed test suites. |
| 539 | int failed_test_suite_countcxx . . $ testing/internal/UnitTestImpl#failed_test_suite_count(455f465bc33b4cdf).() const; |
| 540 | |
| 541 | // Gets the number of all test suites. |
| 542 | int total_test_suite_countcxx . . $ testing/internal/UnitTestImpl#total_test_suite_count(455f465bc33b4cdf).() const; |
| 543 | |
| 544 | // Gets the number of all test suites that contain at least one test |
| 545 | // that should run. |
| 546 | int test_suite_to_run_countcxx . . $ testing/internal/UnitTestImpl#test_suite_to_run_count(455f465bc33b4cdf).() const; |
| 547 | |
| 548 | // Gets the number of successful tests. |
| 549 | int successful_test_countcxx . . $ testing/internal/UnitTestImpl#successful_test_count(455f465bc33b4cdf).() const; |
| 550 | |
| 551 | // Gets the number of skipped tests. |
| 552 | int skipped_test_countcxx . . $ testing/internal/UnitTestImpl#skipped_test_count(455f465bc33b4cdf).() const; |
| 553 | |
| 554 | // Gets the number of failed tests. |
| 555 | int failed_test_countcxx . . $ testing/internal/UnitTestImpl#failed_test_count(455f465bc33b4cdf).() const; |
| 556 | |
| 557 | // Gets the number of disabled tests that will be reported in the XML report. |
| 558 | int reportable_disabled_test_countcxx . . $ testing/internal/UnitTestImpl#reportable_disabled_test_count(455f465bc33b4cdf).() const; |
| 559 | |
| 560 | // Gets the number of disabled tests. |
| 561 | int disabled_test_countcxx . . $ testing/internal/UnitTestImpl#disabled_test_count(455f465bc33b4cdf).() const; |
| 562 | |
| 563 | // Gets the number of tests to be printed in the XML report. |
| 564 | int reportable_test_countcxx . . $ testing/internal/UnitTestImpl#reportable_test_count(455f465bc33b4cdf).() const; |
| 565 | |
| 566 | // Gets the number of all tests. |
| 567 | int total_test_countcxx . . $ testing/internal/UnitTestImpl#total_test_count(455f465bc33b4cdf).() const; |
| 568 | |
| 569 | // Gets the number of tests that should run. |
| 570 | int test_to_run_countcxx . . $ testing/internal/UnitTestImpl#test_to_run_count(455f465bc33b4cdf).() const; |
| 571 | |
| 572 | // Gets the time of the test program start, in ms from the start of the |
| 573 | // UNIX epoch. |
| 574 | TimeInMilliscxx . . $ testing/internal/TimeInMillis# start_timestampcxx . . $ testing/internal/UnitTestImpl#start_timestamp(57a65ae535d7db84).() const { return start_timestamp_cxx . . $ testing/internal/UnitTestImpl#start_timestamp_.; } |
| 575 | |
| 576 | // Gets the elapsed time, in milliseconds. |
| 577 | TimeInMilliscxx . . $ testing/internal/TimeInMillis# elapsed_timecxx . . $ testing/internal/UnitTestImpl#elapsed_time(57a65ae535d7db84).() const { return elapsed_time_cxx . . $ testing/internal/UnitTestImpl#elapsed_time_.; } |
| 578 | |
| 579 | // Returns true if and only if the unit test passed (i.e. all test suites |
| 580 | // passed). |
| 581 | bool Passedcxx . . $ testing/internal/UnitTestImpl#Passed(50ce9a9e25b4a850).() const { return !Failedcxx . . $ testing/internal/UnitTestImpl#Failed(50ce9a9e25b4a850).(); } |
| 582 | |
| 583 | // Returns true if and only if the unit test failed (i.e. some test suite |
| 584 | // failed or something outside of all tests failed). |
| 585 | bool Failedcxx . . $ testing/internal/UnitTestImpl#Failed(50ce9a9e25b4a850).() const { |
| 586 | return failed_test_suite_countcxx . . $ testing/internal/UnitTestImpl#failed_test_suite_count(455f465bc33b4cdf).() > 0 || ad_hoc_test_resultcxx . . $ testing/internal/UnitTestImpl#ad_hoc_test_result(f95a393b3e6dac1d).()->Failedcxx . . $ testing/TestResult#Failed(50ce9a9e25b4a850).(); |
| 587 | } |
| 588 | |
| 589 | // Gets the i-th test suite among all the test suites. i can range from 0 to |
| 590 | // total_test_suite_count() - 1. If i is not in that range, returns NULL. |
| 591 | const TestSuitecxx . . $ testing/TestSuite#* GetTestSuitecxx . . $ testing/internal/UnitTestImpl#GetTestSuite(b008cac0bdd0a1fe).(int i) const { |
| 592 | const int index = GetElementOrcxx . . $ testing/internal/GetElementOr(55e2be3fee2fa215).(test_suite_indices_cxx . . $ testing/internal/UnitTestImpl#test_suite_indices_., i, -1); |
| 593 | return index < 0 ? nullptr : test_suites_cxx . . $ testing/internal/UnitTestImpl#test_suites_.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).static_cast<size_t>(i)]; |
| 594 | } |
| 595 | |
| 596 | // Legacy API is deprecated but still available |
| 597 | #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ |
| 598 | const TestCasecxx . . $ testing/TestCase#* GetTestCasecxx . . $ testing/internal/UnitTestImpl#GetTestCase(b008cac0bdd0a1fe).(int i) const { return GetTestSuitecxx . . $ testing/internal/UnitTestImpl#GetTestSuite(b008cac0bdd0a1fe).(i); } |
| 599 | #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ |
| 600 | |
| 601 | // Gets the i-th test suite among all the test suites. i can range from 0 to |
| 602 | // total_test_suite_count() - 1. If i is not in that range, returns NULL. |
| 603 | TestSuitecxx . . $ testing/TestSuite#* GetMutableSuiteCasecxx . . $ testing/internal/UnitTestImpl#GetMutableSuiteCase(bb43ef779be906bb).(int i) { |
| 604 | const int index = GetElementOrcxx . . $ testing/internal/GetElementOr(55e2be3fee2fa215).(test_suite_indices_cxx . . $ testing/internal/UnitTestImpl#test_suite_indices_., i, -1); |
| 605 | return index < 0 ? nullptr : test_suites_cxx . . $ testing/internal/UnitTestImpl#test_suites_.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).static_cast<size_t>(index)]; |
| 606 | } |
| 607 | |
| 608 | // Provides access to the event listener list. |
| 609 | TestEventListenerscxx . . $ testing/TestEventListeners#* listenerscxx . . $ testing/internal/UnitTestImpl#listeners(ebea860c7cb491d0).() { return &listeners_cxx . . $ testing/internal/UnitTestImpl#listeners_.; } |
| 610 | |
| 611 | // Returns the TestResult for the test that's currently running, or |
| 612 | // the TestResult for the ad hoc test if no test is running. |
| 613 | TestResultcxx . . $ testing/TestResult#* current_test_resultcxx . . $ testing/internal/UnitTestImpl#current_test_result(c7f31d92dba977c6).(); |
| 614 | |
| 615 | // Returns the TestResult for the ad hoc test. |
| 616 | const TestResultcxx . . $ testing/TestResult#* ad_hoc_test_resultcxx . . $ testing/internal/UnitTestImpl#ad_hoc_test_result(f95a393b3e6dac1d).() const { return &ad_hoc_test_result_cxx . . $ testing/internal/UnitTestImpl#ad_hoc_test_result_.; } |
| 617 | |
| 618 | // Sets the OS stack trace getter. |
| 619 | // |
| 620 | // Does nothing if the input and the current OS stack trace getter |
| 621 | // are the same; otherwise, deletes the old getter and makes the |
| 622 | // input the current getter. |
| 623 | void set_os_stack_trace_gettercxx . . $ testing/internal/UnitTestImpl#set_os_stack_trace_getter(d526f3f13fde1600).(OsStackTraceGetterInterfacecxx . . $ testing/internal/OsStackTraceGetterInterface#* getter); |
| 624 | |
| 625 | // Returns the current OS stack trace getter if it is not NULL; |
| 626 | // otherwise, creates an OsStackTraceGetter, makes it the current |
| 627 | // getter, and returns it. |
| 628 | OsStackTraceGetterInterfacecxx . . $ testing/internal/OsStackTraceGetterInterface#* os_stack_trace_gettercxx . . $ testing/internal/UnitTestImpl#os_stack_trace_getter(9bf06717da061df).(); |
| 629 | |
| 630 | // Returns the current OS stack trace as an std::string. |
| 631 | // |
| 632 | // The maximum number of stack frames to be included is specified by |
| 633 | // the gtest_stack_trace_depth flag. The skip_count parameter |
| 634 | // specifies the number of top frames to be skipped, which doesn't |
| 635 | // count against the number of frames to be included. |
| 636 | // |
| 637 | // For example, if Foo() calls Bar(), which in turn calls |
| 638 | // CurrentOsStackTraceExceptTop(1), Foo() will be included in the |
| 639 | // trace but Bar() and CurrentOsStackTraceExceptTop() won't. |
| 640 | stdcxx . . $ std/::stringcxx . . $ std/string# CurrentOsStackTraceExceptTopcxx . . $ testing/internal/UnitTestImpl#CurrentOsStackTraceExceptTop(7eb93f795f0defb3).(int skip_count) |
| 641 | GTEST_NO_INLINE_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:859:9`! GTEST_NO_TAIL_CALL_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:867:9`!; |
| 642 | |
| 643 | // Finds and returns a TestSuite with the given name. If one doesn't |
| 644 | // exist, creates one and returns it. |
| 645 | // |
| 646 | // Arguments: |
| 647 | // |
| 648 | // test_suite_name: name of the test suite |
| 649 | // type_param: the name of the test's type parameter, or NULL if |
| 650 | // this is not a typed or a type-parameterized test. |
| 651 | // set_up_tc: pointer to the function that sets up the test suite |
| 652 | // tear_down_tc: pointer to the function that tears down the test suite |
| 653 | TestSuitecxx . . $ testing/TestSuite#* GetTestSuitecxx . . $ testing/internal/UnitTestImpl#GetTestSuite(63b501bdc2a56a59).(const stdcxx . . $ std/::stringcxx . . $ std/string#& test_suite_name, |
| 654 | const char* type_param, |
| 655 | internalcxx . . $ testing/internal/::SetUpTestSuiteFunccxx . . $ testing/internal/SetUpTestSuiteFunc# set_up_tc, |
| 656 | internalcxx . . $ testing/internal/::TearDownTestSuiteFunccxx . . $ testing/internal/TearDownTestSuiteFunc# tear_down_tc); |
| 657 | |
| 658 | // Legacy API is deprecated but still available |
| 659 | #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ |
| 660 | TestCasecxx . . $ testing/TestCase#* GetTestCasecxx . . $ testing/internal/UnitTestImpl#GetTestCase(63b501bdc2a56a59).(const stdcxx . . $ std/::stringcxx . . $ std/string#& test_case_name, |
| 661 | const char* type_param, |
| 662 | internalcxx . . $ testing/internal/::SetUpTestSuiteFunccxx . . $ testing/internal/SetUpTestSuiteFunc# set_up_tc, |
| 663 | internalcxx . . $ testing/internal/::TearDownTestSuiteFunccxx . . $ testing/internal/TearDownTestSuiteFunc# tear_down_tc) { |
| 664 | return GetTestSuitecxx . . $ testing/internal/UnitTestImpl#GetTestSuite(63b501bdc2a56a59).(test_case_name, type_param, set_up_tc, tear_down_tc); |
| 665 | } |
| 666 | #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ |
| 667 | |
| 668 | // Adds a TestInfo to the unit test. |
| 669 | // |
| 670 | // Arguments: |
| 671 | // |
| 672 | // set_up_tc: pointer to the function that sets up the test suite |
| 673 | // tear_down_tc: pointer to the function that tears down the test suite |
| 674 | // test_info: the TestInfo object |
| 675 | void AddTestInfocxx . . $ testing/internal/UnitTestImpl#AddTestInfo(d8bcd1477d8b4d29).(internalcxx . . $ testing/internal/::SetUpTestSuiteFunccxx . . $ testing/internal/SetUpTestSuiteFunc# set_up_tc, |
| 676 | internalcxx . . $ testing/internal/::TearDownTestSuiteFunccxx . . $ testing/internal/TearDownTestSuiteFunc# tear_down_tc, |
| 677 | TestInfocxx . . $ testing/TestInfo#* test_info) { |
| 678 | #if GTEST_HAS_FILE_SYSTEMcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:528:9`! |
| 679 | // In order to support thread-safe death tests, we need to |
| 680 | // remember the original working directory when the test program |
| 681 | // was first invoked. We cannot do this in RUN_ALL_TESTS(), as |
| 682 | // the user may have changed the current directory before calling |
| 683 | // RUN_ALL_TESTS(). Therefore we capture the current directory in |
| 684 | // AddTestInfo(), which is called to register a TEST or TEST_F |
| 685 | // before main() is reached. |
| 686 | if (original_working_dir_cxx . . $ testing/internal/UnitTestImpl#original_working_dir_..IsEmptycxx . . $ testing/internal/FilePath#IsEmpty(50ce9a9e25b4a850).()) { |
| 687 | original_working_dir_cxx . . $ testing/internal/UnitTestImpl#original_working_dir_. =cxx . . $ testing/internal/FilePath#`operator=`(d278edebaae22859). FilePathcxx . . $ testing/internal/FilePath#::GetCurrentDircxx . . $ testing/internal/FilePath#GetCurrentDir(b433dc4999167564).(); |
| 688 | GTEST_CHECK_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:1086:9`!(!original_working_dir_.IsEmpty()) |
| 689 | <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Failed to get the current working directory."; |
| 690 | } |
| 691 | #endif // GTEST_HAS_FILE_SYSTEM |
| 692 | |
| 693 | GetTestSuitecxx . . $ testing/internal/UnitTestImpl#GetTestSuite(63b501bdc2a56a59).(test_info->test_suite_name_cxx . . $ testing/TestInfo#test_suite_name_., test_info->type_paramcxx . . $ testing/TestInfo#type_param(a9f41ea0e82d88cf).(), |
| 694 | set_up_tc, tear_down_tc) |
| 695 | ->AddTestInfocxx . . $ testing/TestSuite#AddTestInfo(5d778fbee045d268).(test_info); |
| 696 | } |
| 697 | |
| 698 | // Returns ParameterizedTestSuiteRegistry object used to keep track of |
| 699 | // value-parameterized tests and instantiate and register them. |
| 700 | internalcxx . . $ testing/internal/::ParameterizedTestSuiteRegistrycxx . . $ testing/internal/ParameterizedTestSuiteRegistry#& parameterized_test_registrycxx . . $ testing/internal/UnitTestImpl#parameterized_test_registry(9085d9910138139a).() { |
| 701 | return parameterized_test_registry_cxx . . $ testing/internal/UnitTestImpl#parameterized_test_registry_.; |
| 702 | } |
| 703 | |
| 704 | stdcxx . . $ std/::setcxx . . $ std/set#<stdcxx . . $ std/::stringcxx . . $ std/string#>* ignored_parameterized_test_suitescxx . . $ testing/internal/UnitTestImpl#ignored_parameterized_test_suites(c8e9e555a80bcd3b).() { |
| 705 | return &ignored_parameterized_test_suites_cxx . . $ testing/internal/UnitTestImpl#ignored_parameterized_test_suites_.; |
| 706 | } |
| 707 | |
| 708 | // Returns TypeParameterizedTestSuiteRegistry object used to keep track of |
| 709 | // type-parameterized tests and instantiations of them. |
| 710 | internalcxx . . $ testing/internal/::TypeParameterizedTestSuiteRegistrycxx . . $ testing/internal/TypeParameterizedTestSuiteRegistry#& |
| 711 | type_parameterized_test_registrycxx . . $ testing/internal/UnitTestImpl#type_parameterized_test_registry(5f1c07dfe5dba0c0).() { |
| 712 | return type_parameterized_test_registry_cxx . . $ testing/internal/UnitTestImpl#type_parameterized_test_registry_.; |
| 713 | } |
| 714 | |
| 715 | // Registers all parameterized tests defined using TEST_P and |
| 716 | // INSTANTIATE_TEST_SUITE_P, creating regular tests for each test/parameter |
| 717 | // combination. This method can be called more then once; it has guards |
| 718 | // protecting from registering the tests more then once. If |
| 719 | // value-parameterized tests are disabled, RegisterParameterizedTests is |
| 720 | // present but does nothing. |
| 721 | void RegisterParameterizedTestscxx . . $ testing/internal/UnitTestImpl#RegisterParameterizedTests(49f6e7a06ebc5aa8).(); |
| 722 | |
| 723 | // Runs all tests in this UnitTest object, prints the result, and |
| 724 | // returns true if all tests are successful. If any exception is |
| 725 | // thrown during a test, this test is considered to be failed, but |
| 726 | // the rest of the tests will still be run. |
| 727 | bool RunAllTestscxx . . $ testing/internal/UnitTestImpl#RunAllTests(c9857a73d68e59ba).(); |
| 728 | |
| 729 | // Clears the results of all tests, except the ad hoc tests. |
| 730 | void ClearNonAdHocTestResultcxx . . $ testing/internal/UnitTestImpl#ClearNonAdHocTestResult(49f6e7a06ebc5aa8).() { |
| 731 | ForEachcxx . . $ testing/internal/ForEach(2b7ade8bab7b7f06).(test_suites_cxx . . $ testing/internal/UnitTestImpl#test_suites_., TestSuitecxx . . $ testing/TestSuite#::ClearTestSuiteResultcxx . . $ testing/TestSuite#ClearTestSuiteResult(3d73e9eae00ef24e).); |
| 732 | } |
| 733 | |
| 734 | // Clears the results of ad-hoc test assertions. |
| 735 | void ClearAdHocTestResultcxx . . $ testing/internal/UnitTestImpl#ClearAdHocTestResult(49f6e7a06ebc5aa8).() { ad_hoc_test_result_cxx . . $ testing/internal/UnitTestImpl#ad_hoc_test_result_..Clearcxx . . $ testing/TestResult#Clear(49f6e7a06ebc5aa8).(); } |
| 736 | |
| 737 | // Adds a TestProperty to the current TestResult object when invoked in a |
| 738 | // context of a test or a test suite, or to the global property set. If the |
| 739 | // result already contains a property with the same key, the value will be |
| 740 | // updated. |
| 741 | void RecordPropertycxx . . $ testing/internal/UnitTestImpl#RecordProperty(6c56725077159deb).(const TestPropertycxx . . $ testing/TestProperty#& test_property); |
| 742 | |
| 743 | enum ReactionToShardingcxx . . $ testing/internal/UnitTestImpl#ReactionToSharding# { HONOR_SHARDING_PROTOCOLcxx . . $ testing/internal/UnitTestImpl#HONOR_SHARDING_PROTOCOL., IGNORE_SHARDING_PROTOCOLcxx . . $ testing/internal/UnitTestImpl#IGNORE_SHARDING_PROTOCOL. }; |
| 744 | |
| 745 | // Matches the full name of each test against the user-specified |
| 746 | // filter to decide whether the test should run, then records the |
| 747 | // result in each TestSuite and TestInfo object. |
| 748 | // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests |
| 749 | // based on sharding variables in the environment. |
| 750 | // Returns the number of tests that should run. |
| 751 | int FilterTestscxx . . $ testing/internal/UnitTestImpl#FilterTests(135501e31c83aba7).(ReactionToShardingcxx . . $ testing/internal/UnitTestImpl#ReactionToSharding# shard_tests); |
| 752 | |
| 753 | // Prints the names of the tests matching the user-specified filter flag. |
| 754 | void ListTestsMatchingFiltercxx . . $ testing/internal/UnitTestImpl#ListTestsMatchingFilter(49f6e7a06ebc5aa8).(); |
| 755 | |
| 756 | const TestSuitecxx . . $ testing/TestSuite#* current_test_suitecxx . . $ testing/internal/UnitTestImpl#current_test_suite(b25da1ab8eff8f06).() const { return current_test_suite_cxx . . $ testing/internal/UnitTestImpl#current_test_suite_.; } |
| 757 | TestInfocxx . . $ testing/TestInfo#* current_test_infocxx . . $ testing/internal/UnitTestImpl#current_test_info(1b3a5cef5d7fc031).() { return current_test_info_cxx . . $ testing/internal/UnitTestImpl#current_test_info_.; } |
| 758 | const TestInfocxx . . $ testing/TestInfo#* current_test_infocxx . . $ testing/internal/UnitTestImpl#current_test_info(f8d981a8d5ca27de).() const { return current_test_info_cxx . . $ testing/internal/UnitTestImpl#current_test_info_.; } |
| 759 | |
| 760 | // Returns the vector of environments that need to be set-up/torn-down |
| 761 | // before/after the tests are run. |
| 762 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<Environmentcxx . . $ testing/Environment#*>& environmentscxx . . $ testing/internal/UnitTestImpl#environments(38952ecfacc38bdd).() { return environments_cxx . . $ testing/internal/UnitTestImpl#environments_.; } |
| 763 | |
| 764 | // Getters for the per-thread Google Test trace stack. |
| 765 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<TraceInfocxx . . $ testing/internal/TraceInfo#>& gtest_trace_stackcxx . . $ testing/internal/UnitTestImpl#gtest_trace_stack(93820a7ae841237c).() { |
| 766 | return *(gtest_trace_stack_cxx . . $ testing/internal/UnitTestImpl#gtest_trace_stack_..pointercxx . . $ testing/internal/ThreadLocal#pointer(155dc7f103cdb9db).()); |
| 767 | } |
| 768 | const stdcxx . . $ std/::vectorcxx . . $ std/vector#<TraceInfocxx . . $ testing/internal/TraceInfo#>& gtest_trace_stackcxx . . $ testing/internal/UnitTestImpl#gtest_trace_stack(3c068242f4b51d5d).() const { |
| 769 | return gtest_trace_stack_cxx . . $ testing/internal/UnitTestImpl#gtest_trace_stack_..getcxx . . $ testing/internal/ThreadLocal#get(ea465e50d690edfe).(); |
| 770 | } |
| 771 | |
| 772 | #ifdef GTEST_HAS_DEATH_TESTcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:682:9`! |
| 773 | void InitDeathTestSubprocessControlInfocxx . . $ testing/internal/UnitTestImpl#InitDeathTestSubprocessControlInfo(49f6e7a06ebc5aa8).() { |
| 774 | internal_run_death_test_flag_cxx . . $ testing/internal/UnitTestImpl#internal_run_death_test_flag_..resetcxx . . $ std/unique_ptr#reset(c8c3025d73122d7d).(ParseInternalRunDeathTestFlagcxx . . $ testing/internal/ParseInternalRunDeathTestFlag(8dcd156610684952).()); |
| 775 | } |
| 776 | // Returns a pointer to the parsed --gtest_internal_run_death_test |
| 777 | // flag, or NULL if that flag was not specified. |
| 778 | // This information is useful only in a death test child process. |
| 779 | // Must not be called before a call to InitGoogleTest. |
| 780 | const InternalRunDeathTestFlagcxx . . $ testing/internal/InternalRunDeathTestFlag#* internal_run_death_test_flagcxx . . $ testing/internal/UnitTestImpl#internal_run_death_test_flag(9ee42e7271acb0bf).() const { |
| 781 | return internal_run_death_test_flag_cxx . . $ testing/internal/UnitTestImpl#internal_run_death_test_flag_..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).(); |
| 782 | } |
| 783 | |
| 784 | // Returns a pointer to the current death test factory. |
| 785 | internalcxx . . $ testing/internal/::DeathTestFactorycxx . . $ testing/internal/DeathTestFactory#* death_test_factorycxx . . $ testing/internal/UnitTestImpl#death_test_factory(e79b0588998bb46d).() { |
| 786 | return death_test_factory_cxx . . $ testing/internal/UnitTestImpl#death_test_factory_..getcxx . . $ std/unique_ptr#get(ea7391e9eeeaf20e).(); |
| 787 | } |
| 788 | |
| 789 | void SuppressTestEventsIfInSubprocesscxx . . $ testing/internal/UnitTestImpl#SuppressTestEventsIfInSubprocess(49f6e7a06ebc5aa8).(); |
| 790 | |
| 791 | friend class ReplaceDeathTestFactorycxx . . $ testing/internal/ReplaceDeathTestFactory#; |
| 792 | #endif // GTEST_HAS_DEATH_TEST |
| 793 | |
| 794 | // Initializes the event listener performing XML output as specified by |
| 795 | // UnitTestOptions. Must not be called before InitGoogleTest. |
| 796 | void ConfigureXmlOutputcxx . . $ testing/internal/UnitTestImpl#ConfigureXmlOutput(49f6e7a06ebc5aa8).(); |
| 797 | |
| 798 | #if GTEST_CAN_STREAM_RESULTS_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:709:9`! |
| 799 | // Initializes the event listener for streaming test results to a socket. |
| 800 | // Must not be called before InitGoogleTest. |
| 801 | void ConfigureStreamingOutputcxx . . $ testing/internal/UnitTestImpl#ConfigureStreamingOutput(49f6e7a06ebc5aa8).(); |
| 802 | #endif |
| 803 | |
| 804 | // Performs initialization dependent upon flag values obtained in |
| 805 | // ParseGoogleTestFlagsOnly. Is called from InitGoogleTest after the call to |
| 806 | // ParseGoogleTestFlagsOnly. In case a user neglects to call InitGoogleTest |
| 807 | // this function is also called from RunAllTests. Since this function can be |
| 808 | // called more than once, it has to be idempotent. |
| 809 | void PostFlagParsingInitcxx . . $ testing/internal/UnitTestImpl#PostFlagParsingInit(49f6e7a06ebc5aa8).(); |
| 810 | |
| 811 | // Gets the random seed used at the start of the current test iteration. |
| 812 | int random_seedcxx . . $ testing/internal/UnitTestImpl#random_seed(455f465bc33b4cdf).() const { return random_seed_cxx . . $ testing/internal/UnitTestImpl#random_seed_.; } |
| 813 | |
| 814 | // Gets the random number generator. |
| 815 | internalcxx . . $ testing/internal/::Randomcxx . . $ testing/internal/Random#* randomcxx . . $ testing/internal/UnitTestImpl#random(d48fc8d66ae825ca).() { return &random_cxx . . $ testing/internal/UnitTestImpl#random_.; } |
| 816 | |
| 817 | // Shuffles all test suites, and the tests within each test suite, |
| 818 | // making sure that death tests are still run first. |
| 819 | void ShuffleTestscxx . . $ testing/internal/UnitTestImpl#ShuffleTests(49f6e7a06ebc5aa8).(); |
| 820 | |
| 821 | // Restores the test suites and tests to their order before the first shuffle. |
| 822 | void UnshuffleTestscxx . . $ testing/internal/UnitTestImpl#UnshuffleTests(49f6e7a06ebc5aa8).(); |
| 823 | |
| 824 | // Returns the value of GTEST_FLAG(catch_exceptions) at the moment |
| 825 | // UnitTest::Run() starts. |
| 826 | bool catch_exceptionscxx . . $ testing/internal/UnitTestImpl#catch_exceptions(50ce9a9e25b4a850).() const { return catch_exceptions_cxx . . $ testing/internal/UnitTestImpl#catch_exceptions_.; } |
| 827 | |
| 828 | private: |
| 829 | // Returns true if a warning should be issued if no tests match the test |
| 830 | // filter flag. |
| 831 | bool ShouldWarnIfNoTestsMatchFiltercxx . . $ testing/internal/UnitTestImpl#ShouldWarnIfNoTestsMatchFilter(50ce9a9e25b4a850).() const; |
| 832 | |
| 833 | struct CompareTestSuitesByPointercxx . . $ testing/internal/UnitTestImpl#CompareTestSuitesByPointer# { |
| 834 | bool operatorcxx . . $ testing/internal/UnitTestImpl#CompareTestSuitesByPointer#`operator()`(788c2791a684daf3).()(const TestSuitecxx . . $ testing/TestSuite#* lhs, const TestSuitecxx . . $ testing/TestSuite#* rhs) const { |
| 835 | return lhs->name_cxx . . $ testing/TestSuite#name_. <cxx . . $ std/`operator<`(5ea818b58063a774). rhs->name_cxx . . $ testing/TestSuite#name_.; |
| 836 | } |
| 837 | }; |
| 838 | |
| 839 | friend class ::testingcxx . . $ testing/::UnitTestcxx . . $ testing/UnitTest#; |
| 840 | |
| 841 | // Used by UnitTest::Run() to capture the state of |
| 842 | // GTEST_FLAG(catch_exceptions) at the moment it starts. |
| 843 | void set_catch_exceptionscxx . . $ testing/internal/UnitTestImpl#set_catch_exceptions(b45ddcbc8423892c).(bool value) { catch_exceptions_cxx . . $ testing/internal/UnitTestImpl#catch_exceptions_. = value; } |
| 844 | |
| 845 | // Sets the TestSuite object for the test that's currently running. |
| 846 | void set_current_test_suitecxx . . $ testing/internal/UnitTestImpl#set_current_test_suite(3d73e9eae00ef24e).(TestSuitecxx . . $ testing/TestSuite#* a_current_test_suite) { |
| 847 | current_test_suite_cxx . . $ testing/internal/UnitTestImpl#current_test_suite_. = a_current_test_suite; |
| 848 | } |
| 849 | |
| 850 | // Sets the TestInfo object for the test that's currently running. If |
| 851 | // current_test_info is NULL, the assertion results will be stored in |
| 852 | // ad_hoc_test_result_. |
| 853 | void set_current_test_infocxx . . $ testing/internal/UnitTestImpl#set_current_test_info(5d778fbee045d268).(TestInfocxx . . $ testing/TestInfo#* a_current_test_info) { |
| 854 | current_test_info_cxx . . $ testing/internal/UnitTestImpl#current_test_info_. = a_current_test_info; |
| 855 | } |
| 856 | |
| 857 | // The UnitTest object that owns this implementation object. |
| 858 | UnitTestcxx . . $ testing/UnitTest#* const parent_cxx . . $ testing/internal/UnitTestImpl#parent_.; |
| 859 | |
| 860 | #if GTEST_HAS_FILE_SYSTEMcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:528:9`! |
| 861 | // The working directory when the first TEST() or TEST_F() was |
| 862 | // executed. |
| 863 | internalcxx . . $ testing/internal/::FilePathcxx . . $ testing/internal/FilePath# original_working_dir_cxx . . $ testing/internal/UnitTestImpl#original_working_dir_.; |
| 864 | #endif // GTEST_HAS_FILE_SYSTEM |
| 865 | |
| 866 | // The default test part result reporters. |
| 867 | DefaultGlobalTestPartResultReportercxx . . $ testing/internal/DefaultGlobalTestPartResultReporter# default_global_test_part_result_reporter_cxx . . $ testing/internal/UnitTestImpl#default_global_test_part_result_reporter_.; |
| 868 | DefaultPerThreadTestPartResultReportercxx . . $ testing/internal/DefaultPerThreadTestPartResultReporter# |
| 869 | default_per_thread_test_part_result_reporter_cxx . . $ testing/internal/UnitTestImpl#default_per_thread_test_part_result_reporter_.; |
| 870 | |
| 871 | // Points to (but doesn't own) the global test part result reporter. |
| 872 | TestPartResultReporterInterfacecxx . . $ testing/TestPartResultReporterInterface#* global_test_part_result_reporter_cxx . . $ testing/internal/UnitTestImpl#global_test_part_result_reporter_.; |
| 873 | |
| 874 | // Protects read and write access to global_test_part_result_reporter_. |
| 875 | internalcxx . . $ testing/internal/::Mutexcxx . . $ testing/internal/Mutex# global_test_part_result_reporter_mutex_cxx . . $ testing/internal/UnitTestImpl#global_test_part_result_reporter_mutex_.; |
| 876 | |
| 877 | // Points to (but doesn't own) the per-thread test part result reporter. |
| 878 | internalcxx . . $ testing/internal/::ThreadLocalcxx . . $ testing/internal/ThreadLocal#<TestPartResultReporterInterfacecxx . . $ testing/TestPartResultReporterInterface#*> |
| 879 | per_thread_test_part_result_reporter_cxx . . $ testing/internal/UnitTestImpl#per_thread_test_part_result_reporter_.; |
| 880 | |
| 881 | // The vector of environments that need to be set-up/torn-down |
| 882 | // before/after the tests are run. |
| 883 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<Environmentcxx . . $ testing/Environment#*> environments_cxx . . $ testing/internal/UnitTestImpl#environments_.; |
| 884 | |
| 885 | // The vector of TestSuites in their original order. It owns the |
| 886 | // elements in the vector. |
| 887 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<TestSuitecxx . . $ testing/TestSuite#*> test_suites_cxx . . $ testing/internal/UnitTestImpl#test_suites_.; |
| 888 | |
| 889 | // The set of TestSuites by name. |
| 890 | stdcxx . . $ std/::unordered_mapcxx . . $ std/unordered_map#<stdcxx . . $ std/::stringcxx . . $ std/string#, TestSuitecxx . . $ testing/TestSuite#*> test_suites_by_name_cxx . . $ testing/internal/UnitTestImpl#test_suites_by_name_.; |
| 891 | |
| 892 | // Provides a level of indirection for the test suite list to allow |
| 893 | // easy shuffling and restoring the test suite order. The i-th |
| 894 | // element of this vector is the index of the i-th test suite in the |
| 895 | // shuffled order. |
| 896 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<int> test_suite_indices_cxx . . $ testing/internal/UnitTestImpl#test_suite_indices_.; |
| 897 | |
| 898 | // ParameterizedTestRegistry object used to register value-parameterized |
| 899 | // tests. |
| 900 | internalcxx . . $ testing/internal/::ParameterizedTestSuiteRegistrycxx . . $ testing/internal/ParameterizedTestSuiteRegistry# parameterized_test_registry_cxx . . $ testing/internal/UnitTestImpl#parameterized_test_registry_.; |
| 901 | internalcxx . . $ testing/internal/::TypeParameterizedTestSuiteRegistrycxx . . $ testing/internal/TypeParameterizedTestSuiteRegistry# |
| 902 | type_parameterized_test_registry_cxx . . $ testing/internal/UnitTestImpl#type_parameterized_test_registry_.; |
| 903 | |
| 904 | // The set holding the name of parameterized |
| 905 | // test suites that may go uninstantiated. |
| 906 | stdcxx . . $ std/::setcxx . . $ std/set#<stdcxx . . $ std/::stringcxx . . $ std/string#> ignored_parameterized_test_suites_cxx . . $ testing/internal/UnitTestImpl#ignored_parameterized_test_suites_.; |
| 907 | |
| 908 | // Indicates whether RegisterParameterizedTests() has been called already. |
| 909 | bool parameterized_tests_registered_cxx . . $ testing/internal/UnitTestImpl#parameterized_tests_registered_.; |
| 910 | |
| 911 | // Index of the last death test suite registered. Initially -1. |
| 912 | int last_death_test_suite_cxx . . $ testing/internal/UnitTestImpl#last_death_test_suite_.; |
| 913 | |
| 914 | // This points to the TestSuite for the currently running test. It |
| 915 | // changes as Google Test goes through one test suite after another. |
| 916 | // When no test is running, this is set to NULL and Google Test |
| 917 | // stores assertion results in ad_hoc_test_result_. Initially NULL. |
| 918 | TestSuitecxx . . $ testing/TestSuite#* current_test_suite_cxx . . $ testing/internal/UnitTestImpl#current_test_suite_.; |
| 919 | |
| 920 | // This points to the TestInfo for the currently running test. It |
| 921 | // changes as Google Test goes through one test after another. When |
| 922 | // no test is running, this is set to NULL and Google Test stores |
| 923 | // assertion results in ad_hoc_test_result_. Initially NULL. |
| 924 | TestInfocxx . . $ testing/TestInfo#* current_test_info_cxx . . $ testing/internal/UnitTestImpl#current_test_info_.; |
| 925 | |
| 926 | // Normally, a user only writes assertions inside a TEST or TEST_F, |
| 927 | // or inside a function called by a TEST or TEST_F. Since Google |
| 928 | // Test keeps track of which test is current running, it can |
| 929 | // associate such an assertion with the test it belongs to. |
| 930 | // |
| 931 | // If an assertion is encountered when no TEST or TEST_F is running, |
| 932 | // Google Test attributes the assertion result to an imaginary "ad hoc" |
| 933 | // test, and records the result in ad_hoc_test_result_. |
| 934 | TestResultcxx . . $ testing/TestResult# ad_hoc_test_result_cxx . . $ testing/internal/UnitTestImpl#ad_hoc_test_result_.; |
| 935 | |
| 936 | // The list of event listeners that can be used to track events inside |
| 937 | // Google Test. |
| 938 | TestEventListenerscxx . . $ testing/TestEventListeners# listeners_cxx . . $ testing/internal/UnitTestImpl#listeners_.; |
| 939 | |
| 940 | // The OS stack trace getter. Will be deleted when the UnitTest |
| 941 | // object is destructed. By default, an OsStackTraceGetter is used, |
| 942 | // but the user can set this field to use a custom getter if that is |
| 943 | // desired. |
| 944 | OsStackTraceGetterInterfacecxx . . $ testing/internal/OsStackTraceGetterInterface#* os_stack_trace_getter_cxx . . $ testing/internal/UnitTestImpl#os_stack_trace_getter_.; |
| 945 | |
| 946 | // True if and only if PostFlagParsingInit() has been called. |
| 947 | bool post_flag_parse_init_performed_cxx . . $ testing/internal/UnitTestImpl#post_flag_parse_init_performed_.; |
| 948 | |
| 949 | // The random number seed used at the beginning of the test run. |
| 950 | int random_seed_cxx . . $ testing/internal/UnitTestImpl#random_seed_.; |
| 951 | |
| 952 | // Our random number generator. |
| 953 | internalcxx . . $ testing/internal/::Randomcxx . . $ testing/internal/Random# random_cxx . . $ testing/internal/UnitTestImpl#random_.; |
| 954 | |
| 955 | // The time of the test program start, in ms from the start of the |
| 956 | // UNIX epoch. |
| 957 | TimeInMilliscxx . . $ testing/internal/TimeInMillis# start_timestamp_cxx . . $ testing/internal/UnitTestImpl#start_timestamp_.; |
| 958 | |
| 959 | // How long the test took to run, in milliseconds. |
| 960 | TimeInMilliscxx . . $ testing/internal/TimeInMillis# elapsed_time_cxx . . $ testing/internal/UnitTestImpl#elapsed_time_.; |
| 961 | |
| 962 | #ifdef GTEST_HAS_DEATH_TESTcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:682:9`! |
| 963 | // The decomposed components of the gtest_internal_run_death_test flag, |
| 964 | // parsed when RUN_ALL_TESTS is called. |
| 965 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<InternalRunDeathTestFlagcxx . . $ testing/internal/InternalRunDeathTestFlag#> internal_run_death_test_flag_cxx . . $ testing/internal/UnitTestImpl#internal_run_death_test_flag_.; |
| 966 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<internalcxx . . $ testing/internal/::DeathTestFactorycxx . . $ testing/internal/DeathTestFactory#> death_test_factory_cxx . . $ testing/internal/UnitTestImpl#death_test_factory_.; |
| 967 | #endif // GTEST_HAS_DEATH_TEST |
| 968 | |
| 969 | // A per-thread stack of traces created by the SCOPED_TRACE() macro. |
| 970 | internalcxx . . $ testing/internal/::ThreadLocalcxx . . $ testing/internal/ThreadLocal#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<TraceInfocxx . . $ testing/internal/TraceInfo#> > gtest_trace_stack_cxx . . $ testing/internal/UnitTestImpl#gtest_trace_stack_.; |
| 971 | |
| 972 | // The value of GTEST_FLAG(catch_exceptions) at the moment RunAllTests() |
| 973 | // starts. |
| 974 | bool catch_exceptions_cxx . . $ testing/internal/UnitTestImpl#catch_exceptions_.; |
| 975 | |
| 976 | UnitTestImplcxx . . $ testing/internal/UnitTestImpl#UnitTestImpl(b9d213293b6a78ef).(const UnitTestImplcxx . . $ testing/internal/UnitTestImpl#&) = delete; |
| 977 | UnitTestImplcxx . . $ testing/internal/UnitTestImpl#& operatorcxx . . $ testing/internal/UnitTestImpl#`operator=`(700c4b09b8604622).=(const UnitTestImplcxx . . $ testing/internal/UnitTestImpl#&) = delete; |
| 978 | }; // class UnitTestImpl |
| 979 | |
| 980 | // Convenience function for accessing the global UnitTest |
| 981 | // implementation object. |
| 982 | inline UnitTestImplcxx . . $ testing/internal/UnitTestImpl#* GetUnitTestImplcxx . . $ testing/internal/GetUnitTestImpl(a45056208e361854).() { |
| 983 | return UnitTestcxx . . $ testing/UnitTest#::GetInstancecxx . . $ testing/UnitTest#GetInstance(30d0691cc143c28d).()->implcxx . . $ testing/UnitTest#impl(a45056208e361854).(); |
| 984 | } |
| 985 | |
| 986 | #ifdef GTEST_USES_SIMPLE_RE |
| 987 | |
| 988 | // Internal helper functions for implementing the simple regular |
| 989 | // expression matcher. |
| 990 | GTEST_API_ bool IsInSet(char ch, const char* str); |
| 991 | GTEST_API_ bool IsAsciiDigit(char ch); |
| 992 | GTEST_API_ bool IsAsciiPunct(char ch); |
| 993 | GTEST_API_ bool IsRepeat(char ch); |
| 994 | GTEST_API_ bool IsAsciiWhiteSpace(char ch); |
| 995 | GTEST_API_ bool IsAsciiWordChar(char ch); |
| 996 | GTEST_API_ bool IsValidEscape(char ch); |
| 997 | GTEST_API_ bool AtomMatchesChar(bool escaped, char pattern, char ch); |
| 998 | GTEST_API_ bool ValidateRegex(const char* regex); |
| 999 | GTEST_API_ bool MatchRegexAtHead(const char* regex, const char* str); |
| 1000 | GTEST_API_ bool MatchRepetitionAndRegexAtHead(bool escaped, char ch, |
| 1001 | char repeat, const char* regex, |
| 1002 | const char* str); |
| 1003 | GTEST_API_ bool MatchRegexAnywhere(const char* regex, const char* str); |
| 1004 | |
| 1005 | #endif // GTEST_USES_SIMPLE_RE |
| 1006 | |
| 1007 | // Parses the command line for Google Test flags, without initializing |
| 1008 | // other parts of Google Test. |
| 1009 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! void ParseGoogleTestFlagsOnlycxx . . $ testing/internal/ParseGoogleTestFlagsOnly(3edcbbaac3b21c8b).(int* argc, char** argv); |
| 1010 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! void ParseGoogleTestFlagsOnlycxx . . $ testing/internal/ParseGoogleTestFlagsOnly(1f108cbebd33fde2).(int* argc, wchar_t** argv); |
| 1011 | |
| 1012 | #ifdef GTEST_HAS_DEATH_TESTcxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:682:9`! |
| 1013 | |
| 1014 | // Returns the message describing the last system error, regardless of the |
| 1015 | // platform. |
| 1016 | GTEST_API_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:844:9`! stdcxx . . $ std/::stringcxx . . $ std/string# GetLastErrnoDescriptioncxx . . $ testing/internal/GetLastErrnoDescription(efd28698952f529a).(); |
| 1017 | |
| 1018 | // Attempts to parse a string into a positive integer pointed to by the |
| 1019 | // number parameter. Returns true if that is possible. |
| 1020 | // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use |
| 1021 | // it here. |
| 1022 | template <typename Integer> |
| 1023 | bool ParseNaturalNumbercxx . . $ testing/internal/ParseNaturalNumber(b49f8d853823e674).(const ::stdcxx . . $ std/::stringcxx . . $ std/string#& str, Integer* number) { |
| 1024 | // Fail fast if the given string does not begin with a digit; |
| 1025 | // this bypasses strtoXXX's "optional leading whitespace and plus |
| 1026 | // or minus sign" semantics, which are undesirable here. |
| 1027 | if (str.emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() || !IsDigitcxx . . $ testing/internal/IsDigit(b5fd09639b7a0261).(str[cxx . . $ std/__cxx11/basic_string#`operator[]`(dd01cf3f78ddc127).0])) { |
| 1028 | return false; |
| 1029 | } |
| 1030 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = 0; |
| 1031 | |
| 1032 | char* end; |
| 1033 | // BiggestConvertible is the largest integer type that system-provided |
| 1034 | // string-to-number conversion routines can return. |
| 1035 | using BiggestConvertiblecxx . . $ testing/internal/ParseNaturalNumber(b49f8d853823e674).BiggestConvertible# = unsigned long long; // NOLINT |
| 1036 | |
| 1037 | const BiggestConvertiblecxx . . $ testing/internal/ParseNaturalNumber(b49f8d853823e674).BiggestConvertible# parsed = strtoull(str.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), &end, 10); // NOLINT |
| 1038 | const bool parse_success = *end == '\0' && errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! == 0; |
| 1039 | |
| 1040 | GTEST_CHECK_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:1086:9`!(sizeof(Integer) <= sizeof(parsed)); |
| 1041 | |
| 1042 | const Integer result = static_cast<Integer>(parsed); |
| 1043 | if (parse_success && static_cast<BiggestConvertiblecxx . . $ testing/internal/ParseNaturalNumber(b49f8d853823e674).BiggestConvertible#>(result) == parsed) { |
| 1044 | *number = result; |
| 1045 | return true; |
| 1046 | } |
| 1047 | return false; |
| 1048 | } |
| 1049 | #endif // GTEST_HAS_DEATH_TEST |
| 1050 | |
| 1051 | // TestResult contains some private methods that should be hidden from |
| 1052 | // Google Test user but are required for testing. This class allow our tests |
| 1053 | // to access them. |
| 1054 | // |
| 1055 | // This class is supplied only for the purpose of testing Google Test's own |
| 1056 | // constructs. Do not use it in user tests, either directly or indirectly. |
| 1057 | class TestResultAccessorcxx . . $ testing/internal/TestResultAccessor# { |
| 1058 | public: |
| 1059 | static void RecordPropertycxx . . $ testing/internal/TestResultAccessor#RecordProperty(a33296ed53369731).(TestResultcxx . . $ testing/TestResult#* test_result, |
| 1060 | const stdcxx . . $ std/::stringcxx . . $ std/string#& xml_element, |
| 1061 | const TestPropertycxx . . $ testing/TestProperty#& property) { |
| 1062 | test_result->RecordPropertycxx . . $ testing/TestResult#RecordProperty(ba77f5d3feb06ce).(xml_element, property); |
| 1063 | } |
| 1064 | |
| 1065 | static void ClearTestPartResultscxx . . $ testing/internal/TestResultAccessor#ClearTestPartResults(9f04140cfd1852b6).(TestResultcxx . . $ testing/TestResult#* test_result) { |
| 1066 | test_result->ClearTestPartResultscxx . . $ testing/TestResult#ClearTestPartResults(49f6e7a06ebc5aa8).(); |
| 1067 | } |
| 1068 | |
| 1069 | static const stdcxx . . $ std/::vectorcxx . . $ std/vector#<testingcxx . . $ testing/::TestPartResultcxx . . $ testing/TestPartResult#>& test_part_resultscxx . . $ testing/internal/TestResultAccessor#test_part_results(39ddbda4e9778c40).( |
| 1070 | const TestResultcxx . . $ testing/TestResult#& test_result) { |
| 1071 | return test_result.test_part_resultscxx . . $ testing/TestResult#test_part_results(8dd4aa2e615ffa21).(); |
| 1072 | } |
| 1073 | }; |
| 1074 | |
| 1075 | #if GTEST_CAN_STREAM_RESULTS_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:709:9`! |
| 1076 | |
| 1077 | // Streams test results to the given port on the given host machine. |
| 1078 | class StreamingListenercxx . . $ testing/internal/StreamingListener# : public EmptyTestEventListenercxx . . $ testing/EmptyTestEventListener# { |
| 1079 | public: |
| 1080 | // Abstract base class for writing strings to a socket. |
| 1081 | class AbstractSocketWritercxx . . $ testing/internal/StreamingListener#AbstractSocketWriter# { |
| 1082 | public: |
| 1083 | virtual ~cxx . . $ testing/internal/StreamingListener#AbstractSocketWriter#`~AbstractSocketWriter`(ced63f7c635d850d).AbstractSocketWritercxx . . $ testing/internal/StreamingListener#AbstractSocketWriter#() = default; |
| 1084 | |
| 1085 | // Sends a string to the socket. |
| 1086 | virtual void Sendcxx . . $ testing/internal/StreamingListener#AbstractSocketWriter#Send(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string#& message) = 0; |
| 1087 | |
| 1088 | // Closes the socket. |
| 1089 | virtual void CloseConnectioncxx . . $ testing/internal/StreamingListener#AbstractSocketWriter#CloseConnection(49f6e7a06ebc5aa8).() {} |
| 1090 | |
| 1091 | // Sends a string and a newline to the socket. |
| 1092 | void SendLncxx . . $ testing/internal/StreamingListener#AbstractSocketWriter#SendLn(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string#& message) { Sendcxx . . $ testing/internal/StreamingListener#AbstractSocketWriter#Send(9c546c94e5fcce4e).(message +cxx . . $ std/operator+(40fc1db9226233c6). "\n"); } |
| 1093 | }; |
| 1094 | |
| 1095 | // Concrete class for actually writing strings to a socket. |
| 1096 | class SocketWritercxx . . $ testing/internal/StreamingListener#SocketWriter# : public AbstractSocketWritercxx . . $ testing/internal/StreamingListener#AbstractSocketWriter# { |
| 1097 | public: |
| 1098 | SocketWritercxx . . $ testing/internal/StreamingListener#SocketWriter#SocketWriter(c3ca1c130ce09c52).(const stdcxx . . $ std/::stringcxx . . $ std/string#& host, const stdcxx . . $ std/::stringcxx . . $ std/string#& port) |
| 1099 | : sockfd_cxx . . $ testing/internal/StreamingListener#SocketWriter#sockfd_.(-1), host_name_cxx . . $ testing/internal/StreamingListener#SocketWriter#host_name_.(host), port_num_cxx . . $ testing/internal/StreamingListener#SocketWriter#port_num_.(port) { |
| 1100 | MakeConnectioncxx . . $ testing/internal/StreamingListener#SocketWriter#MakeConnection(49f6e7a06ebc5aa8).(); |
| 1101 | } |
| 1102 | |
| 1103 | ~cxx . . $ testing/internal/StreamingListener#SocketWriter#`~SocketWriter`(ced63f7c635d850d).SocketWritercxx . . $ testing/internal/StreamingListener#SocketWriter#() override { |
| 1104 | if (sockfd_cxx . . $ testing/internal/StreamingListener#SocketWriter#sockfd_. != -1) CloseConnectioncxx . . $ testing/internal/StreamingListener#SocketWriter#CloseConnection(49f6e7a06ebc5aa8).(); |
| 1105 | } |
| 1106 | |
| 1107 | // Sends a string to the socket. |
| 1108 | void Sendcxx . . $ testing/internal/StreamingListener#SocketWriter#Send(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string#& message) override { |
| 1109 | GTEST_CHECK_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:1086:9`!(sockfd_ != -1) |
| 1110 | <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Send() can be called only when there is a connection."; |
| 1111 | |
| 1112 | const auto len = static_cast<size_t>(message.lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).()); |
| 1113 | if (write(sockfd_cxx . . $ testing/internal/StreamingListener#SocketWriter#sockfd_., message.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), len) != static_cast<ssize_t>(len)) { |
| 1114 | GTEST_LOG_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:1061:9`!(WARNING) <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "stream_result_to: failed to stream to " |
| 1115 | <<cxx . . $ std/`operator<<`(88df5bef833f7f83). host_name_cxx . . $ testing/internal/StreamingListener#SocketWriter#host_name_. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). ":" <<cxx . . $ std/`operator<<`(88df5bef833f7f83). port_num_cxx . . $ testing/internal/StreamingListener#SocketWriter#port_num_.; |
| 1116 | } |
| 1117 | } |
| 1118 | |
| 1119 | private: |
| 1120 | // Creates a client socket and connects to the server. |
| 1121 | void MakeConnectioncxx . . $ testing/internal/StreamingListener#SocketWriter#MakeConnection(49f6e7a06ebc5aa8).(); |
| 1122 | |
| 1123 | // Closes the socket. |
| 1124 | void CloseConnectioncxx . . $ testing/internal/StreamingListener#SocketWriter#CloseConnection(49f6e7a06ebc5aa8).() override { |
| 1125 | GTEST_CHECK_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:1086:9`!(sockfd_ != -1) |
| 1126 | <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "CloseConnection() can be called only when there is a connection."; |
| 1127 | |
| 1128 | close(sockfd_cxx . . $ testing/internal/StreamingListener#SocketWriter#sockfd_.); |
| 1129 | sockfd_cxx . . $ testing/internal/StreamingListener#SocketWriter#sockfd_. = -1; |
| 1130 | } |
| 1131 | |
| 1132 | int sockfd_cxx . . $ testing/internal/StreamingListener#SocketWriter#sockfd_.; // socket file descriptor |
| 1133 | const stdcxx . . $ std/::stringcxx . . $ std/string# host_name_cxx . . $ testing/internal/StreamingListener#SocketWriter#host_name_.; |
| 1134 | const stdcxx . . $ std/::stringcxx . . $ std/string# port_num_cxx . . $ testing/internal/StreamingListener#SocketWriter#port_num_.; |
| 1135 | |
| 1136 | SocketWritercxx . . $ testing/internal/StreamingListener#SocketWriter#SocketWriter(7a7c103712fcf6b).(const SocketWritercxx . . $ testing/internal/StreamingListener#SocketWriter#&) = delete; |
| 1137 | SocketWritercxx . . $ testing/internal/StreamingListener#SocketWriter#& operatorcxx . . $ testing/internal/StreamingListener#SocketWriter#`operator=`(4584c2c4ebdc7ecd).=(const SocketWritercxx . . $ testing/internal/StreamingListener#SocketWriter#&) = delete; |
| 1138 | }; // class SocketWriter |
| 1139 | |
| 1140 | // Escapes '=', '&', '%', and '\n' characters in str as "%xx". |
| 1141 | static stdcxx . . $ std/::stringcxx . . $ std/string# UrlEncodecxx . . $ testing/internal/StreamingListener#UrlEncode(d06bf7adff8c4caf).(const char* str); |
| 1142 | |
| 1143 | StreamingListenercxx . . $ testing/internal/StreamingListener#StreamingListener(c3ca1c130ce09c52).(const stdcxx . . $ std/::stringcxx . . $ std/string#& host, const stdcxx . . $ std/::stringcxx . . $ std/string#& port) |
| 1144 | : socket_writer_cxx . . $ testing/internal/StreamingListener#socket_writer_.(new SocketWritercxx . . $ testing/internal/StreamingListener#SocketWriter#(host, port)) { |
| 1145 | Startcxx . . $ testing/internal/StreamingListener#Start(49f6e7a06ebc5aa8).(); |
| 1146 | } |
| 1147 | |
| 1148 | explicit StreamingListenercxx . . $ testing/internal/StreamingListener#StreamingListener(f5c44e0c757b9b60).(AbstractSocketWritercxx . . $ testing/internal/StreamingListener#AbstractSocketWriter#* socket_writer) |
| 1149 | : socket_writer_cxx . . $ testing/internal/StreamingListener#socket_writer_.(socket_writer) { |
| 1150 | Startcxx . . $ testing/internal/StreamingListener#Start(49f6e7a06ebc5aa8).(); |
| 1151 | } |
| 1152 | |
| 1153 | void OnTestProgramStartcxx . . $ testing/internal/StreamingListener#OnTestProgramStart(82e4b97d787a23a1).(const UnitTestcxx . . $ testing/UnitTest#& /* unit_test */) override { |
| 1154 | SendLncxx . . $ testing/internal/StreamingListener#SendLn(9c546c94e5fcce4e).("event=TestProgramStart"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 1155 | } |
| 1156 | |
| 1157 | void OnTestProgramEndcxx . . $ testing/internal/StreamingListener#OnTestProgramEnd(82e4b97d787a23a1).(const UnitTestcxx . . $ testing/UnitTest#& unit_test) override { |
| 1158 | // Note that Google Test current only report elapsed time for each |
| 1159 | // test iteration, not for the entire test program. |
| 1160 | SendLncxx . . $ testing/internal/StreamingListener#SendLn(9c546c94e5fcce4e).("event=TestProgramEnd&passed=" +cxx . . $ std/operator+(39ed2c165380f78e). FormatBoolcxx . . $ testing/internal/StreamingListener#FormatBool(2bf49bfa21fefb8c).(unit_test.Passedcxx . . $ testing/UnitTest#Passed(50ce9a9e25b4a850).())); |
| 1161 | |
| 1162 | // Notify the streaming server to stop. |
| 1163 | socket_writer_cxx . . $ testing/internal/StreamingListener#socket_writer_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).CloseConnectioncxx . . $ testing/internal/StreamingListener#AbstractSocketWriter#CloseConnection(49f6e7a06ebc5aa8).(); |
| 1164 | } |
| 1165 | |
| 1166 | void OnTestIterationStartcxx . . $ testing/internal/StreamingListener#OnTestIterationStart(f26a9356cea35c28).(const UnitTestcxx . . $ testing/UnitTest#& /* unit_test */, |
| 1167 | int iteration) override { |
| 1168 | SendLncxx . . $ testing/internal/StreamingListener#SendLn(9c546c94e5fcce4e).("event=TestIterationStart&iteration=" +cxx . . $ std/operator+(39ed2c165380f78e). |
| 1169 | StreamableToStringcxx . . $ testing/internal/StreamableToString(23b83986b497e4d5).(iteration)); |
| 1170 | } |
| 1171 | |
| 1172 | void OnTestIterationEndcxx . . $ testing/internal/StreamingListener#OnTestIterationEnd(f26a9356cea35c28).(const UnitTestcxx . . $ testing/UnitTest#& unit_test, |
| 1173 | int /* iteration */) override { |
| 1174 | SendLncxx . . $ testing/internal/StreamingListener#SendLn(9c546c94e5fcce4e).("event=TestIterationEnd&passed=" +cxx . . $ std/operator+(39ed2c165380f78e). FormatBoolcxx . . $ testing/internal/StreamingListener#FormatBool(2bf49bfa21fefb8c).(unit_test.Passedcxx . . $ testing/UnitTest#Passed(50ce9a9e25b4a850).()) +cxx . . $ std/operator+(900ec9581c410ad9). |
| 1175 | "&elapsed_time=" +cxx . . $ std/operator+(aa1c00e85b87da6b). StreamableToStringcxx . . $ testing/internal/StreamableToString(23b83986b497e4d5).(unit_test.elapsed_timecxx . . $ testing/UnitTest#elapsed_time(57a65ae535d7db84).()) +cxx . . $ std/operator+(900ec9581c410ad9). |
| 1176 | "ms"); |
| 1177 | } |
| 1178 | |
| 1179 | // Note that "event=TestCaseStart" is a wire format and has to remain |
| 1180 | // "case" for compatibility |
| 1181 | void OnTestSuiteStartcxx . . $ testing/internal/StreamingListener#OnTestSuiteStart(f9d5ee5f824bdd27).(const TestSuitecxx . . $ testing/TestSuite#& test_suite) override { |
| 1182 | SendLncxx . . $ testing/internal/StreamingListener#SendLn(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string#("event=TestCaseStart&name=") +cxx . . $ std/operator+(900ec9581c410ad9). test_suite.namecxx . . $ testing/TestSuite#name(a9f41ea0e82d88cf).()); |
| 1183 | } |
| 1184 | |
| 1185 | // Note that "event=TestCaseEnd" is a wire format and has to remain |
| 1186 | // "case" for compatibility |
| 1187 | void OnTestSuiteEndcxx . . $ testing/internal/StreamingListener#OnTestSuiteEnd(f9d5ee5f824bdd27).(const TestSuitecxx . . $ testing/TestSuite#& test_suite) override { |
| 1188 | SendLncxx . . $ testing/internal/StreamingListener#SendLn(9c546c94e5fcce4e).("event=TestCaseEnd&passed=" +cxx . . $ std/operator+(39ed2c165380f78e). FormatBoolcxx . . $ testing/internal/StreamingListener#FormatBool(2bf49bfa21fefb8c).(test_suite.Passedcxx . . $ testing/TestSuite#Passed(50ce9a9e25b4a850).()) +cxx . . $ std/operator+(900ec9581c410ad9). |
| 1189 | "&elapsed_time=" +cxx . . $ std/operator+(aa1c00e85b87da6b). StreamableToStringcxx . . $ testing/internal/StreamableToString(23b83986b497e4d5).(test_suite.elapsed_timecxx . . $ testing/TestSuite#elapsed_time(57a65ae535d7db84).()) +cxx . . $ std/operator+(900ec9581c410ad9). |
| 1190 | "ms"); |
| 1191 | } |
| 1192 | |
| 1193 | void OnTestStartcxx . . $ testing/internal/StreamingListener#OnTestStart(2a5ebb2021169723).(const TestInfocxx . . $ testing/TestInfo#& test_info) override { |
| 1194 | SendLncxx . . $ testing/internal/StreamingListener#SendLn(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string#("event=TestStart&name=") +cxx . . $ std/operator+(900ec9581c410ad9). test_info.namecxx . . $ testing/TestInfo#name(a9f41ea0e82d88cf).()); |
| 1195 | } |
| 1196 | |
| 1197 | void OnTestEndcxx . . $ testing/internal/StreamingListener#OnTestEnd(2a5ebb2021169723).(const TestInfocxx . . $ testing/TestInfo#& test_info) override { |
| 1198 | SendLncxx . . $ testing/internal/StreamingListener#SendLn(9c546c94e5fcce4e).("event=TestEnd&passed=" +cxx . . $ std/operator+(39ed2c165380f78e). |
| 1199 | FormatBoolcxx . . $ testing/internal/StreamingListener#FormatBool(2bf49bfa21fefb8c).((test_info.resultcxx . . $ testing/TestInfo#result(f95a393b3e6dac1d).())->Passedcxx . . $ testing/TestResult#Passed(50ce9a9e25b4a850).()) +cxx . . $ std/operator+(900ec9581c410ad9). "&elapsed_time=" +cxx . . $ std/operator+(aa1c00e85b87da6b). |
| 1200 | StreamableToStringcxx . . $ testing/internal/StreamableToString(23b83986b497e4d5).((test_info.resultcxx . . $ testing/TestInfo#result(f95a393b3e6dac1d).())->elapsed_timecxx . . $ testing/TestResult#elapsed_time(57a65ae535d7db84).()) +cxx . . $ std/operator+(900ec9581c410ad9). "ms"); |
| 1201 | } |
| 1202 | |
| 1203 | void OnTestPartResultcxx . . $ testing/internal/StreamingListener#OnTestPartResult(1671c14f799d0273).(const TestPartResultcxx . . $ testing/TestPartResult#& test_part_result) override { |
| 1204 | const char* file_name = test_part_result.file_namecxx . . $ testing/TestPartResult#file_name(a9f41ea0e82d88cf).(); |
| 1205 | if (file_name == nullptr) file_name = ""; |
| 1206 | SendLncxx . . $ testing/internal/StreamingListener#SendLn(9c546c94e5fcce4e).("event=TestPartResult&file=" +cxx . . $ std/operator+(39ed2c165380f78e). UrlEncodecxx . . $ testing/internal/StreamingListener#UrlEncode(d06bf7adff8c4caf).(file_name) +cxx . . $ std/operator+(900ec9581c410ad9). |
| 1207 | "&line=" +cxx . . $ std/operator+(aa1c00e85b87da6b). StreamableToStringcxx . . $ testing/internal/StreamableToString(23b83986b497e4d5).(test_part_result.line_numbercxx . . $ testing/TestPartResult#line_number(455f465bc33b4cdf).()) +cxx . . $ std/operator+(900ec9581c410ad9). |
| 1208 | "&message=" +cxx . . $ std/operator+(aa1c00e85b87da6b). UrlEncodecxx . . $ testing/internal/StreamingListener#UrlEncode(d06bf7adff8c4caf).(test_part_result.messagecxx . . $ testing/TestPartResult#message(a9f41ea0e82d88cf).())); |
| 1209 | } |
| 1210 | |
| 1211 | private: |
| 1212 | // Sends the given message and a newline to the socket. |
| 1213 | void SendLncxx . . $ testing/internal/StreamingListener#SendLn(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string#& message) { socket_writer_cxx . . $ testing/internal/StreamingListener#socket_writer_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).SendLncxx . . $ testing/internal/StreamingListener#AbstractSocketWriter#SendLn(9c546c94e5fcce4e).(message); } |
| 1214 | |
| 1215 | // Called at the start of streaming to notify the receiver what |
| 1216 | // protocol we are using. |
| 1217 | void Startcxx . . $ testing/internal/StreamingListener#Start(49f6e7a06ebc5aa8).() { SendLncxx . . $ testing/internal/StreamingListener#SendLn(9c546c94e5fcce4e).("gtest_streaming_protocol_version=1.0"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); } |
| 1218 | |
| 1219 | stdcxx . . $ std/::stringcxx . . $ std/string# FormatBoolcxx . . $ testing/internal/StreamingListener#FormatBool(2bf49bfa21fefb8c).(bool value) { return valuecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d). ? "1" : "0"; } |
| 1220 | |
| 1221 | const stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<AbstractSocketWritercxx . . $ testing/internal/StreamingListener#AbstractSocketWriter#> socket_writer_cxx . . $ testing/internal/StreamingListener#socket_writer_.; |
| 1222 | |
| 1223 | StreamingListenercxx . . $ testing/internal/StreamingListener#StreamingListener(c14f9c50169a64eb).(const StreamingListenercxx . . $ testing/internal/StreamingListener#&) = delete; |
| 1224 | StreamingListenercxx . . $ testing/internal/StreamingListener#& operatorcxx . . $ testing/internal/StreamingListener#`operator=`(708d149abdd587be).=(const StreamingListenercxx . . $ testing/internal/StreamingListener#&) = delete; |
| 1225 | }; // class StreamingListener |
| 1226 | |
| 1227 | #endif // GTEST_CAN_STREAM_RESULTS_ |
| 1228 | |
| 1229 | } // namespace internal |
| 1230 | } // namespace testing |
| 1231 | |
| 1232 | GTEST_DISABLE_MSC_WARNINGS_POP_cxx . . $ `vendor/googletest/include/gtest/internal/gtest-port.h:376:9`!() // 4251 |
| 1233 | |
| 1234 | #endif // GOOGLETEST_SRC_GTEST_INTERNAL_INL_H_ |