From a8b80f122b7b2840a91c48af7f0740137686fd00 Mon Sep 17 00:00:00 2001 From: XAMeLeOH <14215665+XAMeLeOH@users.noreply.github.com> Date: Thu, 26 Sep 2024 00:16:25 +0200 Subject: [PATCH 1/2] Update matchers.md: include and namespace instructions * Added a note on which header to include to use the built-in matchers to the top of the page. * Moved a sentence about the namespace to the top of the page. --- docs/reference/matchers.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/reference/matchers.md b/docs/reference/matchers.md index 243e3f95..a088ba48 100644 --- a/docs/reference/matchers.md +++ b/docs/reference/matchers.md @@ -1,6 +1,11 @@ # Matchers Reference -A **matcher** matches a *single* argument. You can use it inside `ON_CALL()` or +A **matcher** matches a *single* argument. +This page lists the built-in matchers provided by GoogleTest. +To use them, add `#include `. +All matchers are defined in the `::testing` namespace unless otherwise noted. + +You can use a matcher inside `ON_CALL()` or `EXPECT_CALL()`, or use it to validate a value directly using two macros: | Macro | Description | @@ -21,8 +26,7 @@ expected_value)`. Built-in matchers (where `argument` is the function argument, e.g. `actual_value` in the example above, or when used in the context of `EXPECT_CALL(mock_object, method(matchers))`, the arguments of `method`) are -divided into several categories. All matchers are defined in the `::testing` -namespace unless otherwise noted. +divided into several categories. ## Wildcard From 15de0806de27866f5c7261e5f97a37a01f42c344 Mon Sep 17 00:00:00 2001 From: XAMeLeOH <14215665+XAMeLeOH@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:07:02 +0200 Subject: [PATCH 2/2] Update actions.md Added instruction on which header to include to the top of the page --- docs/reference/actions.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/reference/actions.md b/docs/reference/actions.md index ab81a129..c427f891 100644 --- a/docs/reference/actions.md +++ b/docs/reference/actions.md @@ -1,8 +1,10 @@ # Actions Reference [**Actions**](../gmock_for_dummies.md#actions-what-should-it-do) specify what a -mock function should do when invoked. This page lists the built-in actions -provided by GoogleTest. All actions are defined in the `::testing` namespace. +mock function should do when invoked. +This page lists the built-in actions provided by GoogleTest. +To use them, add #include . +All actions are defined in the `::testing` namespace. ## Returning a Value