mirror of
https://github.com/google/googletest.git
synced 2025-01-14 08:27:56 +08:00
Merge pull request #1275 from jwakely/pr/1273
Use gender-neutral pronouns in comments and docs
This commit is contained in:
commit
7b6561c56e
@ -227,7 +227,7 @@ If a mock method has no `EXPECT_CALL` spec but is called, Google Mock
|
|||||||
will print a warning about the "uninteresting call". The rationale is:
|
will print a warning about the "uninteresting call". The rationale is:
|
||||||
|
|
||||||
* New methods may be added to an interface after a test is written. We shouldn't fail a test just because a method it doesn't know about is called.
|
* New methods may be added to an interface after a test is written. We shouldn't fail a test just because a method it doesn't know about is called.
|
||||||
* However, this may also mean there's a bug in the test, so Google Mock shouldn't be silent either. If the user believes these calls are harmless, he can add an `EXPECT_CALL()` to suppress the warning.
|
* However, this may also mean there's a bug in the test, so Google Mock shouldn't be silent either. If the user believes these calls are harmless, they can add an `EXPECT_CALL()` to suppress the warning.
|
||||||
|
|
||||||
However, sometimes you may want to suppress all "uninteresting call"
|
However, sometimes you may want to suppress all "uninteresting call"
|
||||||
warnings, while sometimes you may want the opposite, i.e. to treat all
|
warnings, while sometimes you may want the opposite, i.e. to treat all
|
||||||
|
@ -240,7 +240,7 @@ You cannot mock a variadic function (i.e. a function taking ellipsis
|
|||||||
The problem is that in general, there is _no way_ for a mock object to
|
The problem is that in general, there is _no way_ for a mock object to
|
||||||
know how many arguments are passed to the variadic method, and what
|
know how many arguments are passed to the variadic method, and what
|
||||||
the arguments' types are. Only the _author of the base class_ knows
|
the arguments' types are. Only the _author of the base class_ knows
|
||||||
the protocol, and we cannot look into his head.
|
the protocol, and we cannot look into their head.
|
||||||
|
|
||||||
Therefore, to mock such a function, the _user_ must teach the mock
|
Therefore, to mock such a function, the _user_ must teach the mock
|
||||||
object how to figure out the number of arguments and their types. One
|
object how to figure out the number of arguments and their types. One
|
||||||
|
@ -1774,7 +1774,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
|
|||||||
// There is no generally useful and implementable semantics of
|
// There is no generally useful and implementable semantics of
|
||||||
// copying a mock object, so copying a mock is usually a user error.
|
// copying a mock object, so copying a mock is usually a user error.
|
||||||
// Thus we disallow copying function mockers. If the user really
|
// Thus we disallow copying function mockers. If the user really
|
||||||
// wants to copy a mock object, he should implement his own copy
|
// wants to copy a mock object, they should implement their own copy
|
||||||
// operation, for example:
|
// operation, for example:
|
||||||
//
|
//
|
||||||
// class MockFoo : public Foo {
|
// class MockFoo : public Foo {
|
||||||
|
@ -71,7 +71,7 @@ GTEST_API_ string ConvertIdentifierNameToWords(const char* id_name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This class reports Google Mock failures as Google Test failures. A
|
// This class reports Google Mock failures as Google Test failures. A
|
||||||
// user can define another class in a similar fashion if he intends to
|
// user can define another class in a similar fashion if they intend to
|
||||||
// use Google Mock with a testing framework other than Google Test.
|
// use Google Mock with a testing framework other than Google Test.
|
||||||
class GoogleTestFailureReporter : public FailureReporterInterface {
|
class GoogleTestFailureReporter : public FailureReporterInterface {
|
||||||
public:
|
public:
|
||||||
|
@ -353,10 +353,10 @@ UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args)
|
|||||||
// the behavior of ReportUninterestingCall().
|
// the behavior of ReportUninterestingCall().
|
||||||
const bool need_to_report_uninteresting_call =
|
const bool need_to_report_uninteresting_call =
|
||||||
// If the user allows this uninteresting call, we print it
|
// If the user allows this uninteresting call, we print it
|
||||||
// only when he wants informational messages.
|
// only when they want informational messages.
|
||||||
reaction == kAllow ? LogIsVisible(kInfo) :
|
reaction == kAllow ? LogIsVisible(kInfo) :
|
||||||
// If the user wants this to be a warning, we print it only
|
// If the user wants this to be a warning, we print it only
|
||||||
// when he wants to see warnings.
|
// when they want to see warnings.
|
||||||
reaction == kWarn ? LogIsVisible(kWarning) :
|
reaction == kWarn ? LogIsVisible(kWarning) :
|
||||||
// Otherwise, the user wants this to be an error, and we
|
// Otherwise, the user wants this to be an error, and we
|
||||||
// should always print detailed information in the error.
|
// should always print detailed information in the error.
|
||||||
|
@ -391,7 +391,7 @@ TEST(ExactlyTest, HasCorrectBounds) {
|
|||||||
EXPECT_EQ(3, c.ConservativeUpperBound());
|
EXPECT_EQ(3, c.ConservativeUpperBound());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests that a user can make his own cardinality by implementing
|
// Tests that a user can make their own cardinality by implementing
|
||||||
// CardinalityInterface and calling MakeCardinality().
|
// CardinalityInterface and calling MakeCardinality().
|
||||||
|
|
||||||
class EvenCardinality : public CardinalityInterface {
|
class EvenCardinality : public CardinalityInterface {
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
// implementation. It must come before gtest-internal-inl.h is
|
// implementation. It must come before gtest-internal-inl.h is
|
||||||
// included, or there will be a compiler error. This trick is to
|
// included, or there will be a compiler error. This trick is to
|
||||||
// prevent a user from accidentally including gtest-internal-inl.h in
|
// prevent a user from accidentally including gtest-internal-inl.h in
|
||||||
// his code.
|
// their code.
|
||||||
#define GTEST_IMPLEMENTATION_ 1
|
#define GTEST_IMPLEMENTATION_ 1
|
||||||
#include "src/gtest-internal-inl.h"
|
#include "src/gtest-internal-inl.h"
|
||||||
#undef GTEST_IMPLEMENTATION_
|
#undef GTEST_IMPLEMENTATION_
|
||||||
|
@ -2682,7 +2682,7 @@ TEST(SynchronizationTest, CanCallMockMethodInAction) {
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// Allows the user to define his own main and then invoke gmock_main
|
// Allows the user to define their own main and then invoke gmock_main
|
||||||
// from it. This might be necessary on some platforms which require
|
// from it. This might be necessary on some platforms which require
|
||||||
// specific setup and teardown.
|
// specific setup and teardown.
|
||||||
#if GMOCK_RENAME_MAIN
|
#if GMOCK_RENAME_MAIN
|
||||||
|
@ -1263,7 +1263,7 @@ known as <i>abstract tests</i>. As an example of its application, when you
|
|||||||
are designing an interface you can write a standard suite of abstract
|
are designing an interface you can write a standard suite of abstract
|
||||||
tests (perhaps using a factory function as the test parameter) that
|
tests (perhaps using a factory function as the test parameter) that
|
||||||
all implementations of the interface are expected to pass. When
|
all implementations of the interface are expected to pass. When
|
||||||
someone implements the interface, he can instantiate your suite to get
|
someone implements the interface, they can instantiate your suite to get
|
||||||
all the interface-conformance tests for free.
|
all the interface-conformance tests for free.
|
||||||
|
|
||||||
To define abstract tests, you should organize your code like this:
|
To define abstract tests, you should organize your code like this:
|
||||||
|
@ -102,9 +102,9 @@ Then every user of your machine can write tests without
|
|||||||
recompiling Google Test.
|
recompiling Google Test.
|
||||||
|
|
||||||
This seemed like a good idea, but it has a
|
This seemed like a good idea, but it has a
|
||||||
got-cha: every user needs to compile his tests using the _same_ compiler
|
got-cha: every user needs to compile their tests using the _same_ compiler
|
||||||
flags used to compile the installed Google Test libraries; otherwise
|
flags used to compile the installed Google Test libraries; otherwise
|
||||||
he may run into undefined behaviors (i.e. the tests can behave
|
they may run into undefined behaviors (i.e. the tests can behave
|
||||||
strangely and may even crash for no obvious reasons).
|
strangely and may even crash for no obvious reasons).
|
||||||
|
|
||||||
Why? Because C++ has this thing called the One-Definition Rule: if
|
Why? Because C++ has this thing called the One-Definition Rule: if
|
||||||
|
@ -741,7 +741,7 @@ using ::std::tuple_size;
|
|||||||
# define _TR1_FUNCTIONAL 1
|
# define _TR1_FUNCTIONAL 1
|
||||||
# include <tr1/tuple>
|
# include <tr1/tuple>
|
||||||
# undef _TR1_FUNCTIONAL // Allows the user to #include
|
# undef _TR1_FUNCTIONAL // Allows the user to #include
|
||||||
// <tr1/functional> if he chooses to.
|
// <tr1/functional> if they choose to.
|
||||||
# else
|
# else
|
||||||
# include <tr1/tuple> // NOLINT
|
# include <tr1/tuple> // NOLINT
|
||||||
# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
|
# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
|
||||||
|
@ -137,7 +137,7 @@
|
|||||||
// implementation. It must come before gtest-internal-inl.h is
|
// implementation. It must come before gtest-internal-inl.h is
|
||||||
// included, or there will be a compiler error. This trick is to
|
// included, or there will be a compiler error. This trick is to
|
||||||
// prevent a user from accidentally including gtest-internal-inl.h in
|
// prevent a user from accidentally including gtest-internal-inl.h in
|
||||||
// his code.
|
// their code.
|
||||||
#define GTEST_IMPLEMENTATION_ 1
|
#define GTEST_IMPLEMENTATION_ 1
|
||||||
#include "src/gtest-internal-inl.h"
|
#include "src/gtest-internal-inl.h"
|
||||||
#undef GTEST_IMPLEMENTATION_
|
#undef GTEST_IMPLEMENTATION_
|
||||||
|
@ -61,7 +61,7 @@ using testing::internal::AlwaysTrue;
|
|||||||
// implementation. It must come before gtest-internal-inl.h is
|
// implementation. It must come before gtest-internal-inl.h is
|
||||||
// included, or there will be a compiler error. This trick is to
|
// included, or there will be a compiler error. This trick is to
|
||||||
// prevent a user from accidentally including gtest-internal-inl.h in
|
// prevent a user from accidentally including gtest-internal-inl.h in
|
||||||
// his code.
|
// their code.
|
||||||
# define GTEST_IMPLEMENTATION_ 1
|
# define GTEST_IMPLEMENTATION_ 1
|
||||||
# include "src/gtest-internal-inl.h"
|
# include "src/gtest-internal-inl.h"
|
||||||
# undef GTEST_IMPLEMENTATION_
|
# undef GTEST_IMPLEMENTATION_
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
// implementation. It must come before gtest-internal-inl.h is
|
// implementation. It must come before gtest-internal-inl.h is
|
||||||
// included, or there will be a compiler error. This trick is to
|
// included, or there will be a compiler error. This trick is to
|
||||||
// prevent a user from accidentally including gtest-internal-inl.h in
|
// prevent a user from accidentally including gtest-internal-inl.h in
|
||||||
// his code.
|
// their code.
|
||||||
#define GTEST_IMPLEMENTATION_ 1
|
#define GTEST_IMPLEMENTATION_ 1
|
||||||
#include "src/gtest-internal-inl.h"
|
#include "src/gtest-internal-inl.h"
|
||||||
#undef GTEST_IMPLEMENTATION_
|
#undef GTEST_IMPLEMENTATION_
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
// implementation. It must come before gtest-internal-inl.h is
|
// implementation. It must come before gtest-internal-inl.h is
|
||||||
// included, or there will be a compiler error. This trick is to
|
// included, or there will be a compiler error. This trick is to
|
||||||
// prevent a user from accidentally including gtest-internal-inl.h in
|
// prevent a user from accidentally including gtest-internal-inl.h in
|
||||||
// his code.
|
// their code.
|
||||||
#define GTEST_IMPLEMENTATION_ 1
|
#define GTEST_IMPLEMENTATION_ 1
|
||||||
#include "src/gtest-internal-inl.h"
|
#include "src/gtest-internal-inl.h"
|
||||||
#undef GTEST_IMPLEMENTATION_
|
#undef GTEST_IMPLEMENTATION_
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
// implementation. It must come before gtest-internal-inl.h is
|
// implementation. It must come before gtest-internal-inl.h is
|
||||||
// included, or there will be a compiler error. This trick is to
|
// included, or there will be a compiler error. This trick is to
|
||||||
// prevent a user from accidentally including gtest-internal-inl.h in
|
// prevent a user from accidentally including gtest-internal-inl.h in
|
||||||
// his code.
|
// their code.
|
||||||
#define GTEST_IMPLEMENTATION_ 1
|
#define GTEST_IMPLEMENTATION_ 1
|
||||||
#include "src/gtest-internal-inl.h"
|
#include "src/gtest-internal-inl.h"
|
||||||
#undef GTEST_IMPLEMENTATION_
|
#undef GTEST_IMPLEMENTATION_
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
// implementation. It must come before gtest-internal-inl.h is
|
// implementation. It must come before gtest-internal-inl.h is
|
||||||
// included, or there will be a compiler error. This trick is to
|
// included, or there will be a compiler error. This trick is to
|
||||||
// prevent a user from accidentally including gtest-internal-inl.h in
|
// prevent a user from accidentally including gtest-internal-inl.h in
|
||||||
// his code.
|
// their code.
|
||||||
#define GTEST_IMPLEMENTATION_ 1
|
#define GTEST_IMPLEMENTATION_ 1
|
||||||
#include "src/gtest-internal-inl.h"
|
#include "src/gtest-internal-inl.h"
|
||||||
#undef GTEST_IMPLEMENTATION_
|
#undef GTEST_IMPLEMENTATION_
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
// implementation. It must come before gtest-internal-inl.h is
|
// implementation. It must come before gtest-internal-inl.h is
|
||||||
// included, or there will be a compiler error. This trick is to
|
// included, or there will be a compiler error. This trick is to
|
||||||
// prevent a user from accidentally including gtest-internal-inl.h in
|
// prevent a user from accidentally including gtest-internal-inl.h in
|
||||||
// his code.
|
// their code.
|
||||||
#define GTEST_IMPLEMENTATION_ 1
|
#define GTEST_IMPLEMENTATION_ 1
|
||||||
#include "src/gtest-internal-inl.h"
|
#include "src/gtest-internal-inl.h"
|
||||||
#undef GTEST_IMPLEMENTATION_
|
#undef GTEST_IMPLEMENTATION_
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
// implementation. It must come before gtest-internal-inl.h is
|
// implementation. It must come before gtest-internal-inl.h is
|
||||||
// included, or there will be a compiler error. This trick is to
|
// included, or there will be a compiler error. This trick is to
|
||||||
// prevent a user from accidentally including gtest-internal-inl.h in
|
// prevent a user from accidentally including gtest-internal-inl.h in
|
||||||
// his code.
|
// their code.
|
||||||
#define GTEST_IMPLEMENTATION_ 1
|
#define GTEST_IMPLEMENTATION_ 1
|
||||||
#include "src/gtest-internal-inl.h"
|
#include "src/gtest-internal-inl.h"
|
||||||
#undef GTEST_IMPLEMENTATION_
|
#undef GTEST_IMPLEMENTATION_
|
||||||
|
@ -71,7 +71,7 @@ TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
|
|||||||
// implementation. It must come before gtest-internal-inl.h is
|
// implementation. It must come before gtest-internal-inl.h is
|
||||||
// included, or there will be a compiler error. This trick is to
|
// included, or there will be a compiler error. This trick is to
|
||||||
// prevent a user from accidentally including gtest-internal-inl.h in
|
// prevent a user from accidentally including gtest-internal-inl.h in
|
||||||
// his code.
|
// their code.
|
||||||
#define GTEST_IMPLEMENTATION_ 1
|
#define GTEST_IMPLEMENTATION_ 1
|
||||||
#include "src/gtest-internal-inl.h"
|
#include "src/gtest-internal-inl.h"
|
||||||
#undef GTEST_IMPLEMENTATION_
|
#undef GTEST_IMPLEMENTATION_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user