| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
When -Wdouble-promotion is enabled, the templatized function AppropriateResolution fails to compile since its float instantiation promotes floats to doubles when doing arithmetic and comparisons. Add static casts to resolve these errors.
PiperOrigin-RevId: 600776333
Change-Id: Ia530b4bbca6ddce27caf0a817196d87efef711cb
|
|
|
|
|
|
|
| |
This function makes exact floating point that are correct in this context, but trigger the compiler warning.
PiperOrigin-RevId: 596944060
Change-Id: I4bba3c2abcf3ac189107530978961955ad47d6f0
|
|
|
|
|
| |
PiperOrigin-RevId: 567349341
Change-Id: I35f2679901aecbe9cb90d2e78ff28c5e383e7257
|
|
|
|
|
|
|
| |
Fixes #4318
PiperOrigin-RevId: 560089120
Change-Id: I9d0d098140033520266747a1689e953ee8307c47
|
|
|
|
|
|
|
| |
Fixes #4314
PiperOrigin-RevId: 549986457
Change-Id: Iff74f02ab1c106696f288540e9c623d56b76e3f7
|
|\
| |
| |
| |
| | |
PiperOrigin-RevId: 547250378
Change-Id: I084c30e45f331cb296535822923da1cb7e848e11
|
| | |
|
|/
|
|
|
|
|
| |
ordering.
PiperOrigin-RevId: 546373360
Change-Id: I2538b45d8c7710592071cc352da6771480c324e6
|
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| |
| |
| | |
PiperOrigin-RevId: 523706897
Change-Id: If6dcc97c81a20f8fe675241518ae1d6cf23ebf39
|
| |
| |
| |
| |
| |
| |
| | |
see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51577
ADL seems to work properly when we do the SFINAE check via the return type, but not when using a dummy template parameter
fix #3992
|
|\ \
| | |
| | |
| | |
| | | |
PiperOrigin-RevId: 517470997
Change-Id: I12b079dc1536f136dd0514871fe79f9678b1fd6a
|
| | |
| | |
| | |
| | | |
__cpp_lib_char8_t does
|
|/ /
| |
| |
| |
| |
| |
| | |
This allows compilation with "-Wundef" (#3267).
PiperOrigin-RevId: 513945230
Change-Id: I45ef19c7ff3d20e97216bd031d406a03365471da
|
| |
| |
| |
| |
| | |
PiperOrigin-RevId: 512708763
Change-Id: I1f24f2e1d17359aee5aa4cdf614c9357872ca03b
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We're intentionally losing precision in this case, so add a cast.
googletest/googletest/include/gtest/gtest-printers.h:532:9: error:
implicit conversion from 'int32_t' (aka 'int') to 'float' may lose precision
[-Werror,-Wimplicit-int-float-conversion]
if (static_cast<int32_t>(val * mulfor6 + 0.5) / mulfor6 == val) return 6;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
googletest/googletest/include/gtest/gtest-printers.h:544:9: error:
implicit conversion from 'int32_t' (aka 'int') to 'float' may lose precision
[-Werror,-Wimplicit-int-float-conversion]
if (static_cast<int32_t>(val / divfor6 + 0.5) * divfor6 == val) return 6;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
PiperOrigin-RevId: 502646042
Change-Id: I05989ee42675b531a9907616c9582a5a7c77bed6
|
| |
| |
| |
| |
| | |
PiperOrigin-RevId: 499893032
Change-Id: I33304802b7c82ae2d008f3ee89df38866e5f57ba
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
To make debug output readable, we still use the faster 6-digit precision
sometimes, but only if it will round-trip.
This way, when a test fails due to a very small difference in floating-point
numbers, users will have enough digits to see the difference.
PiperOrigin-RevId: 488958311
Change-Id: Ibcac43f48a97006d89217530c69386cc4fa2735c
|
|/
|
|
|
|
|
| |
This matches the intention and documentation of terse printing which generally avoids printing the pointer.
PiperOrigin-RevId: 481178950
Change-Id: I27039dac1870934d2d5b212e2cc7e97ab82c5b34
|
|
|
|
| |
Some of the #ifdefs were missed in original PR.
Should be fixed now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
PiperOrigin-RevId: 422559250
Change-Id: I9f630f2186724950e5e9fbd7093d5264e8bf0a71
|
|
|
|
|
|
| |
Add printer for std::type_info.
PiperOrigin-RevId: 408375407
|
|
|
|
|
|
| |
Add printer for __{u,}int128_t.
PiperOrigin-RevId: 402417369
|
|
|
|
|
| |
googletest: Add printer for {std,absl}::nullopt.
PiperOrigin-RevId: 399928554
|
|
|
|
|
|
| |
Delete GOOGLETEST_CM.* tags from C++ code.
PiperOrigin-RevId: 386268534
|
|\
| |
| |
| | |
PiperOrigin-RevId: 378915968
|
| |
| |
| |
| |
| | |
Reference is here: https://en.cppreference.com/w/cpp/feature_test
This PR fixes the weird case of compiling with `clang++ -std=c++17 -fchar8_t`
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
exports
This was causing the following linker error on Microsoft Visual C++ when compiling as a DLL:
```
googletest-printers-test.cc.obj : error LNK2019: unresolved external symbol "void __cdecl testing::internal::PrintTo(char16_t const *,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?PrintTo@internal@testing@@YAXPEB_SPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "public: static void __cdecl testing::internal::UniversalPrinter<char16_t const *>::Print(char16_t const * const &,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?Print@?$UniversalPrinter@PEB_S@internal@testing@@SAXAEBQEB_SPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
googletest-printers-test.cc.obj : error LNK2019: unresolved external symbol "void __cdecl testing::internal::PrintTo(char32_t const *,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?PrintTo@internal@testing@@YAXPEB_UPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "public: static void __cdecl testing::internal::UniversalPrinter<char32_t const *>::Print(char32_t const * const &,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?Print@?$UniversalPrinter@PEB_U@internal@testing@@SAXAEBQEB_UPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
```
|
| |
| |
| |
| |
| |
| | |
Revert https://github.com/google/googletest/commit/ac3c2a8d0496893787015014a5abd397b766cce2 -- it seems to break some gcc users (#3384)
PiperOrigin-RevId: 370834917
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \
| | |
| | |
| | | |
PiperOrigin-RevId: 361175466
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Included the string returned by their `name()` member function with the output of `PrintTo`.
Typical use case:
std::unique_ptr<AbstractProduct> product = FactoryMethod();
// Assert that the product is of type X:
ASSERT_EQ(std::type_index{typeid(*product)},
std::type_index{typeid(ProductX)});
Possible output in case of a test assert failure, now including the names of the compared type indices:
> error: Expected equality of these values:
> std::type_index(typeid(*product))
> Which is: 8-byte object <D0-65 54-8C F6-7F 00-00> ("class ProductY")
> std::type_index(typeid(ProductX))
> Which is: 8-byte object <40-64 54-8C F6-7F 00-00> ("class ProductX")
With help from Krystian Kuzniarek.
|
| |
| |
| |
| |
| |
| | |
Make include guards conform with https://google.github.io/styleguide/cppguide.html#The__define_Guard, attempt #2
PiperOrigin-RevId: 357056902
|
| |
| |
| |
| |
| |
| | |
Revert include guard fix
PiperOrigin-RevId: 356588893
|
| |
| |
| |
| |
| |
| |
| | |
Fix #2987
Removing const before passing any types through UniversalPrinter.
PiperOrigin-RevId: 356508875
|
| |
| |
| |
| |
| |
| | |
Make include guards conform with https://google.github.io/styleguide/cppguide.html#The__define_Guard
PiperOrigin-RevId: 355882793
|
| |
| |
| |
| |
| |
| |
| |
| | |
Print unique_ptr/shared_ptr recursively.
Given that they are smart pointers, it is unlikely that the inner object is
invalid.
PiperOrigin-RevId: 351586888
|
| |
| |
| |
| |
| |
| | |
Fix Objective-C++ compatibility
PiperOrigin-RevId: 350192165
|
|/
|
|
|
|
| |
Add support for printing incomplete types in the universal printer.
PiperOrigin-RevId: 350154637
|
|\
| |
| |
| | |
PiperOrigin-RevId: 340266002
|
| |
| |
| |
| |
| |
| | |
Detection of string_view type (whether it's std or Abseil)
is done in googletest/include/gtest/internal/gtest-port.h
with GTEST_INTERNAL_HAS_STRING_VIEW.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Improve lookup of operator<< for user types
Without this fix, trying to use this class with googletest
struct Foo {};
template <typename OutputStream>
OutputStream& operator<<(OutputStream& os, const Foo&) {
os << "TemplatedStreamableInFoo";
return os;
}
results in an ambiguity error between the class' operator<< and the
operator<< in gtest-printers.h removed in this CL.
This fix also enables implicit conversions to happen, so that e.g.
we will find the base class operator<< if a subclass has no
operator<< of its own.
PiperOrigin-RevId: 336261221
|
|\ \
| | |
| | |
| | | |
PiperOrigin-RevId: 336087297
|
| | |
| | |
| | |
| | |
| | |
| | | |
Adds support for printing pointers of types char8_t, char16_t, and char32_t.
PiperOrigin-RevId: 316112767
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \
| |/
|/|
| | |
PiperOrigin-RevId: 314593695
|
| | |
|
| | |
|
| | |
|