summaryrefslogtreecommitdiffstats
path: root/googletest/src/gtest-printers.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix C++20 compatibility bug.Mike Kruskal2023-07-011-4/+4
| | | | | | | | | This was shown to work for C++14, C++17, and C++20 after patched into googletest for the protobuf repo's CI. Closes #3659 PiperOrigin-RevId: 544795507 Change-Id: I3e0a94f675e78a6ee9aeccae86c23d940efed8eb
* Add missing std includesTom Hughes2023-04-201-0/+2
| | | | | PiperOrigin-RevId: 525850646 Change-Id: I64387f5b933beb79cd05636dca81b7a75213383e
* __cpp_char8_t does not cover std::u8string implementation, but ↵refs/pull/4182/headAlexander Nikforov2023-03-071-1/+1
| | | | __cpp_lib_char8_t does
* Avoid implicit conversion from int to charrefs/pull/3916/headJérôme Travert2022-06-261-1/+1
|
* Running clang-format over all of GoogleTestAbseil Team2022-03-151-51/+26
| | | | | | | | | | | | | | | | A few tests are examining code locations and looking af the resulting line numbers to verify that GoogleTest shows those to users correctly. Some of those locations change when clang-format is run. For those locations, I've wrapped portions in: // clang-format off ... // clang-format on There may be other locations that are currently not tickled by running clang-format. PiperOrigin-RevId: 434844712 Change-Id: I3a9f0a6f39eff741c576b6de389bef9b1d11139d
* Googletest exportAbseil Team2021-10-131-0/+45
| | | | | | Add printer for __{u,}int128_t. PiperOrigin-RevId: 402417369
* Googletest exportAbseil Team2021-07-071-1/+1
| | | | | | Introduce GTEST_FLAG_GET and GTEST_FLAG_SET macros. PiperOrigin-RevId: 382808313
* Googletest exportAbseil Team2021-03-221-49/+138
| | | | | | | | | | | | | | | | | | | | Print std::u8string, std::u16string, and std::u32string as string literals Previously, these types were printed as "{ U+123, U+456, U+789 }". However, printed output in that form is difficult to compare against any literals that might be defined in code. Instead, just treat these types like std::string and std::wstring, escaping non-ASCII characters with a hexadecimal escape sequence. The tests have also been updated to cover the new functionality: as a bonus, the tests now also pass with the MSVC toolchain. Internally, the code has been reorganized to primarily operate in terms of char32_t, under the assumption that char32_t will always be at least as big as wchar_t. While that assumption is currently true, perhaps it won't be in the future... PiperOrigin-RevId: 364033132
* Googletest exportdmauro2020-06-101-1/+2
| | | | | | Add missing static_cast to char32_t printer PiperOrigin-RevId: 314925583
* Googletest exportdmauro2020-06-051-0/+5
| | | | | | | | | | | | | | | | Adds support for printing the types char8_t, char16_t, and char32_t This changes prints these types as Unicode code points. It is possible that there is a better way of printing these types, but that change is more complex, and the format in which Googletest prints these types is subject to change if someone implements a better way of printing them. This fixes the C++20 build, which removed support for printing these types. https://en.cppreference.com/w/cpp/io/basic_ostream/operator_ltlt2 Fixes #2854 PiperOrigin-RevId: 314826912
* Googletest exportAbseil Team2020-03-171-5/+1
| | | | | | Simplify the fallback printing logic to have a single sequence of trial printers. PiperOrigin-RevId: 298621376
* Fix -Wsign-conversion error by adding static_castrefs/pull/2245/headdaquexian2019-05-021-1/+1
|
* Address fallout from -Wsign-conversion work on Windowsrefs/pull/2241/headEnji Cooper2019-04-261-2/+3
| | | | | | | | Some Windows users builds were broken after a0d60be. This change addresses the lingering -Wsign-conversion issues with those platforms by adding some missing `static_cast` calls as needed. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Googletest exportAbseil Team2019-04-011-0/+3
| | | | | | | | | | | | | | | Add HWASan annotations. These mirror existing ASan annotations. HWASan uses memory (address) tagging to detect memory errors: https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html It inserts a random tag in the MSB of heap and stack allocation addresses. This tag dominates pointer comparison in StackGrowsDown(), making the result non-deterministic, and entirely unrelated to the actual stack growth direction. The function attribute disables this behavior. The annotations in gtest-printers are there because the printers are used to basically dump memory. The sanitizers may have ideas why this memory should not be accessed, and that is counter productive. In particular, the test may access only part of an array, but in case of a test failure gtest will dump the entire array which may contain uninitialized bytes - that's what SANITIZE_MEMORY annotation is for. There are similar reasons for ADDRESS and THREAD annotations. HWADDRESS in its current implementation can not cause issues there, I believe, but it falls under the same umbrella of tools whose checking should not apply to test printers because it is not the code under test. PiperOrigin-RevId: 241379822
* Googletest exportAbseil Team2019-04-011-18/+0
| | | | | | | | Remove support for "global" ::string and ::wstring types. This support existed for legacy codebases that existed from before namespaces where a thing. It is no longer necessary. PiperOrigin-RevId: 241335738
* Googletest exportmisterg2019-01-021-1/+0
| | | | | | Internal Change PiperOrigin-RevId: 227575279
* Merge c41b2bf861ef2ac1a975af05ff66d9256f280b01 into ↵KO Myung-Hun2018-10-111-1/+1
| | | | | | | | f203b2db77161fe54846ea9e839ebec81aeeccac Closes #1899 PiperOrigin-RevId: 216719020
* Apply clang-tidy modernize-use-nullptr to googletest.Abseil Team2018-10-051-2/+2
| | | | | | | | | | | Now that googletest has moved to C++11, it should no longer use NULL or 0 for the null pointer. This patch converts all such usages to nullptr using clang-tidy. This prevents LLVM from issuing -Wzero-as-null-pointer-constant warnings. PiperOrigin-RevId: 215814400
* Comments changes, no functionality changes. Gennadiy Civil2018-08-141-1/+1
|
* Comments changes, no functionality changesrefs/pull/1740/headGennadiy Civil2018-08-141-2/+1
|
* Formatting changes refs/pull/1607/headGennadiy Civil2018-05-231-1/+1
|
* Fix std::iscntrl use in gtest-printers.ccVictor Costan2018-02-121-1/+3
| | | | | | | | ContainsUnprintableControlCodes() in gtest-printers.cc passes a char argument to std::iscntrl. Although its argument is an int, std::iscntrl produces undefined behavior if its argument is not representable as an unsigned char. The standard library on Windows asserts that the argument is an unsigned char, resulting in an assertion crash on debug builds.
* Fixed typosrefs/pull/1446/headTroy Holsapple2018-02-081-2/+2
|
* upstream cl 182543808Gennadiy Civil2018-01-241-4/+84
|
* Speed up printing of characters which need hex escapingBrian Silverman2017-08-281-1/+4
| | | | | | | | | This change speeds up the runtime of a value-parameterized test I have which has lots of values with large strings full of unprintable characters by 2x. I profiled it and traced most of the slowness during googletest startup down to the way String::FormatHexInt was creating and destroyed a stringstream for each character in the string for each value.
* Move everything in googletest into googletest/googletestBilly Donahue2015-08-251-0/+373