gMock Cookbook: Fix incorrect comment about EXPECT priority order
It's actually the last matching expectation that's used, not the first.
PiperOrigin-RevId: 316490770
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.
Make visible ParseInt32 in case users have separate gmock/gtest libraries and hidden-by-default symbols.
This function is still considered an internal implementation detail and is subject to change without notice. It is still unsafe/unsupported to link together libraries built at different commits.
PiperOrigin-RevId: 315405429
Fail TEST_Ps or TYPED_TEST_Ps that are defined but are not instantiated, as well as the opposite case, where INSTANTIATE_TEST_SUITE_P or INSTANTIATE_TYPED_TEST_SUITE_P is used but without any matching TEST_P or TYPED_TEST_P.
PiperOrigin-RevId: 315255779
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_ltlt2Fixes#2854
PiperOrigin-RevId: 314826912
gMock Cookbook: Slight rewording
Remove "I" because documentation can have multiple authors. And remove unnecessary "guy".
PiperOrigin-RevId: 314533746
Note that EXPECT_EQ(actual_value, expected_value) or EXPECT_THAT(actual_value, Eq(expected_value)) is preferred over EXPECT_THAT(actual_value, expected_value).
PiperOrigin-RevId: 314350852
Silence MSVC C4100 (unused formal parameter) to fix breakage from recently added testcase. This warning is silenced in many files throughout googletest, but was not needed here until this testcase was added.
PiperOrigin-RevId: 312121200
Mark ACTION_Pn()-generated functions as must-use-result.
This catches when a client creates an action and discards it, thinking that the action has actually been applied to something.
This will help people who make the mistake of defining, for example, both `void Use(Foo*)` and `ACTION(Use) { Use(arg); }` for later application to a Foo. With such an overload, a client may then write `Use();`, forgetting the param and being confused why nothing happens.
This also catches when a client defines their own action in terms of an ACTION()-generated one, invokes the ACTION's builder, and then fails to invoke the resulting action, thinking it's operating on the outer action's parameters.
PiperOrigin-RevId: 312108101
Fix the ACTION* macros to allow for more than 10 arguments in the action.
Only the first 10 will be passed as individual arguments as `argN`, but the rest
can be accessed from the `args` tuple.
PiperOrigin-RevId: 311542098
Fixed#2823 - Make it so that a semicolon appearing after an invocation of GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ does not trigger a redundant semicolon warning.
This works by introducing an else block with a statement that intentionally does not end with a semicolon, forcing users to place the semicolon after the expansion. The approach here is preferred as opposed to removing semicolons that appear after each invocation because complete statements that do not have a visible semicolon or braces confuse users and code formatters, since the macro invocation looks superficially like an expression.
PiperOrigin-RevId: 311327491