Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
3f5a8c6e
Commit
3f5a8c6e
authored
Oct 07, 2019
by
Gennadiy Civil
Browse files
Merge pull request #2495 from hyukmyeong:typo
PiperOrigin-RevId: 273346440
parents
4360e426
51f7396d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
9 deletions
+7
-9
googlemock/docs/for_dummies.md
googlemock/docs/for_dummies.md
+1
-1
googletest/docs/advanced.md
googletest/docs/advanced.md
+4
-6
googletest/docs/faq.md
googletest/docs/faq.md
+2
-2
No files found.
googlemock/docs/for_dummies.md
View file @
3f5a8c6e
...
@@ -213,7 +213,7 @@ specific domain much better than `Foo` does.
...
@@ -213,7 +213,7 @@ specific domain much better than `Foo` does.
Once you have a mock class, using it is easy. The typical work flow is:
Once you have a mock class, using it is easy. The typical work flow is:
1.
Import the gMock names from the
`testing`
namespace such that you can use
1.
Import the gMock names from the
`testing`
namespace such that you can use
them unqualified (You only have to do it once per file. Remember that
them unqualified (You only have to do it once per file
)
. Remember that
namespaces are a good idea.
namespaces are a good idea.
2.
Create some mock objects.
2.
Create some mock objects.
3.
Specify your expectations on them (How many times will a method be called?
3.
Specify your expectations on them (How many times will a method be called?
...
...
googletest/docs/advanced.md
View file @
3f5a8c6e
...
@@ -642,7 +642,7 @@ Fatal assertion | Nonfatal assertion
...
@@ -642,7 +642,7 @@ Fatal assertion | Nonfatal assertion
where
`statement`
is a statement that is expected to cause the process to die,
where
`statement`
is a statement that is expected to cause the process to die,
`predicate`
is a function or function object that evaluates an integer exit
`predicate`
is a function or function object that evaluates an integer exit
status, and
`matcher`
is either a
G
Mock matcher matching a
`const std::string&`
status, and
`matcher`
is either a
g
Mock matcher matching a
`const std::string&`
or a (Perl) regular expression - either of which is matched against the stderr
or a (Perl) regular expression - either of which is matched against the stderr
output of
`statement`
. For legacy reasons, a bare string (i.e. with no matcher)
output of
`statement`
. For legacy reasons, a bare string (i.e. with no matcher)
is interpreted as
`ContainsRegex(str)`
,
**not**
`Eq(str)`
. Note that
`statement`
is interpreted as
`ContainsRegex(str)`
,
**not**
`Eq(str)`
. Note that
`statement`
...
@@ -657,7 +657,7 @@ As usual, the `ASSERT` variants abort the current test function, while the
...
@@ -657,7 +657,7 @@ As usual, the `ASSERT` variants abort the current test function, while the
> has called `exit()` or `_exit()` with a non-zero value, or it may be killed by
> has called `exit()` or `_exit()` with a non-zero value, or it may be killed by
> a signal.
> a signal.
>
>
> This means that if
`
*statement
*
` terminates the process with a 0 exit code, it
> This means that if *
`
statement`
*
terminates the process with a 0 exit code, it
> is *not* considered a crash by `EXPECT_DEATH`. Use `EXPECT_EXIT` instead if
> is *not* considered a crash by `EXPECT_DEATH`. Use `EXPECT_EXIT` instead if
> this is the case, or if you want to restrict the exit code more precisely.
> this is the case, or if you want to restrict the exit code more precisely.
...
@@ -687,7 +687,7 @@ Note that a death test only cares about three things:
...
@@ -687,7 +687,7 @@ Note that a death test only cares about three things:
2.
(in the case of
`ASSERT_EXIT`
and
`EXPECT_EXIT`
) does the exit status
2.
(in the case of
`ASSERT_EXIT`
and
`EXPECT_EXIT`
) does the exit status
satisfy
`predicate`
? Or (in the case of
`ASSERT_DEATH`
and
`EXPECT_DEATH`
)
satisfy
`predicate`
? Or (in the case of
`ASSERT_DEATH`
and
`EXPECT_DEATH`
)
is the exit status non-zero? And
is the exit status non-zero? And
3.
does the stderr output match
`
regex
`
?
3.
does the stderr output match
`
matcher
`
?
In particular, if
`statement`
generates an
`ASSERT_*`
or
`EXPECT_*`
failure, it
In particular, if
`statement`
generates an
`ASSERT_*`
or
`EXPECT_*`
failure, it
will
**not**
cause the death test to fail, as googletest assertions don't abort
will
**not**
cause the death test to fail, as googletest assertions don't abort
...
@@ -1132,7 +1132,7 @@ will output XML like this:
...
@@ -1132,7 +1132,7 @@ will output XML like this:
> * `RecordProperty()` is a static member of the `Test` class. Therefore it
> * `RecordProperty()` is a static member of the `Test` class. Therefore it
> needs to be prefixed with `::testing::Test::` if used outside of the
> needs to be prefixed with `::testing::Test::` if used outside of the
> `TEST` body and the test fixture class.
> `TEST` body and the test fixture class.
> *
`
*key
*
` must be a valid XML attribute name, and cannot conflict with the
> * *
`
key`
*
must be a valid XML attribute name, and cannot conflict with the
> ones already used by googletest (`name`, `status`, `time`, `classname`,
> ones already used by googletest (`name`, `status`, `time`, `classname`,
> `type_param`, and `value_param`).
> `type_param`, and `value_param`).
> * Calling `RecordProperty()` outside of the lifespan of a test is allowed.
> * Calling `RecordProperty()` outside of the lifespan of a test is allowed.
...
@@ -1904,8 +1904,6 @@ To obtain a `TestInfo` object for the currently running test, call
...
@@ -1904,8 +1904,6 @@ To obtain a `TestInfo` object for the currently running test, call
const
::
testing
::
TestInfo
*
const
test_info
=
const
::
testing
::
TestInfo
*
const
test_info
=
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
();
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
();
printf
(
"We are in test %s of test suite %s.
\n
"
,
printf
(
"We are in test %s of test suite %s.
\n
"
,
test_info
->
name
(),
test_info
->
name
(),
test_info
->
test_suite_name
());
test_info
->
test_suite_name
());
...
...
googletest/docs/faq.md
View file @
3f5a8c6e
...
@@ -531,8 +531,8 @@ There are several good reasons:
...
@@ -531,8 +531,8 @@ There are several good reasons:
## What can the statement argument in ASSERT_DEATH() be?
## What can the statement argument in ASSERT_DEATH() be?
`ASSERT_DEATH(
*
statement
*
,
*regex*
)`
(or any death assertion macro) can be used
`ASSERT_DEATH(statement,
matcher
)`
(or any death assertion macro) can be used
wherever
`
*statement
*
`
is valid. So basically
`
*statement
*
`
can be any C++
wherever
*
`
statement`
*
is valid. So basically
*
`
statement`
*
can be any C++
statement that makes sense in the current context. In particular, it can
statement that makes sense in the current context. In particular, it can
reference global and/or local variables, and can be:
reference global and/or local variables, and can be:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment