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
09074c15
Commit
09074c15
authored
Sep 23, 2021
by
dinord
Browse files
Merge pull request #3573 from cclauss:patch-1
PiperOrigin-RevId: 397998384
parents
319a9d19
5b43f14b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
docs/gmock_cook_book.md
docs/gmock_cook_book.md
+3
-3
googletest/test/gtest_pred_impl_unittest.cc
googletest/test/gtest_pred_impl_unittest.cc
+5
-5
googletest/test/gtest_unittest.cc
googletest/test/gtest_unittest.cc
+1
-1
No files found.
docs/gmock_cook_book.md
View file @
09074c15
...
@@ -1452,7 +1452,7 @@ the pointer is copied. When the last matcher that references the implementation
...
@@ -1452,7 +1452,7 @@ the pointer is copied. When the last matcher that references the implementation
object dies, the implementation object will be deleted.
object dies, the implementation object will be deleted.
Therefore, if you have some complex matcher that you want to use again and
Therefore, if you have some complex matcher that you want to use again and
again, there is no need to build it everytime. Just assign it to a matcher
again, there is no need to build it every
time. Just assign it to a matcher
variable and use that variable repeatedly! For example,
variable and use that variable repeatedly! For example,
```
cpp
```
cpp
...
@@ -2601,7 +2601,7 @@ efficient. When the last action that references the implementation object dies,
...
@@ -2601,7 +2601,7 @@ efficient. When the last action that references the implementation object dies,
the implementation object will be deleted.
the implementation object will be deleted.
If you have some complex action that you want to use again and again, you may
If you have some complex action that you want to use again and again, you may
not have to build it from scratch everytime. If the action doesn't have an
not have to build it from scratch every
time. If the action doesn't have an
internal state (i.e. if it always does the same thing no matter how many times
internal state (i.e. if it always does the same thing no matter how many times
it has been called), you can assign it to an action variable and use that
it has been called), you can assign it to an action variable and use that
variable repeatedly. For example:
variable repeatedly. For example:
...
@@ -4188,7 +4188,7 @@ This implementation class does *not* need to inherit from any particular class.
...
@@ -4188,7 +4188,7 @@ This implementation class does *not* need to inherit from any particular class.
What matters is that it must have a `
Perform()
` method template. This method
What matters is that it must have a `
Perform()
` method template. This method
template takes the mock function's arguments as a tuple in a **single**
template takes the mock function's arguments as a tuple in a **single**
argument, and returns the result of the action. It can be either `
const
` or not,
argument, and returns the result of the action. It can be either `
const
` or not,
but must be invo
k
able with exactly one template argument, which is the result
but must be invo
c
able with exactly one template argument, which is the result
type. In other words, you must be able to call `
Perform
<R>
(args)
` where `
R
` is
type. In other words, you must be able to call `
Perform
<R>
(args)
` where `
R
` is
the mock function's return type and `
args
` is its arguments in a tuple.
the mock function's return type and `
args
` is its arguments in a tuple.
...
...
googletest/test/gtest_pred_impl_unittest.cc
View file @
09074c15
...
@@ -136,7 +136,7 @@ class Predicate1Test : public testing::Test {
...
@@ -136,7 +136,7 @@ class Predicate1Test : public testing::Test {
// Verifies that the control flow in the test function is expected.
// Verifies that the control flow in the test function is expected.
if
(
expected_to_finish_
&&
!
finished_
)
{
if
(
expected_to_finish_
&&
!
finished_
)
{
FAIL
()
<<
"The predicate assertion unexp
a
ctedly aborted the test."
;
FAIL
()
<<
"The predicate assertion unexp
e
ctedly aborted the test."
;
}
else
if
(
!
expected_to_finish_
&&
finished_
)
{
}
else
if
(
!
expected_to_finish_
&&
finished_
)
{
FAIL
()
<<
"The failed predicate assertion didn't abort the test "
FAIL
()
<<
"The failed predicate assertion didn't abort the test "
"as expected."
;
"as expected."
;
...
@@ -530,7 +530,7 @@ class Predicate2Test : public testing::Test {
...
@@ -530,7 +530,7 @@ class Predicate2Test : public testing::Test {
// Verifies that the control flow in the test function is expected.
// Verifies that the control flow in the test function is expected.
if
(
expected_to_finish_
&&
!
finished_
)
{
if
(
expected_to_finish_
&&
!
finished_
)
{
FAIL
()
<<
"The predicate assertion unexp
a
ctedly aborted the test."
;
FAIL
()
<<
"The predicate assertion unexp
e
ctedly aborted the test."
;
}
else
if
(
!
expected_to_finish_
&&
finished_
)
{
}
else
if
(
!
expected_to_finish_
&&
finished_
)
{
FAIL
()
<<
"The failed predicate assertion didn't abort the test "
FAIL
()
<<
"The failed predicate assertion didn't abort the test "
"as expected."
;
"as expected."
;
...
@@ -966,7 +966,7 @@ class Predicate3Test : public testing::Test {
...
@@ -966,7 +966,7 @@ class Predicate3Test : public testing::Test {
// Verifies that the control flow in the test function is expected.
// Verifies that the control flow in the test function is expected.
if
(
expected_to_finish_
&&
!
finished_
)
{
if
(
expected_to_finish_
&&
!
finished_
)
{
FAIL
()
<<
"The predicate assertion unexp
a
ctedly aborted the test."
;
FAIL
()
<<
"The predicate assertion unexp
e
ctedly aborted the test."
;
}
else
if
(
!
expected_to_finish_
&&
finished_
)
{
}
else
if
(
!
expected_to_finish_
&&
finished_
)
{
FAIL
()
<<
"The failed predicate assertion didn't abort the test "
FAIL
()
<<
"The failed predicate assertion didn't abort the test "
"as expected."
;
"as expected."
;
...
@@ -1444,7 +1444,7 @@ class Predicate4Test : public testing::Test {
...
@@ -1444,7 +1444,7 @@ class Predicate4Test : public testing::Test {
// Verifies that the control flow in the test function is expected.
// Verifies that the control flow in the test function is expected.
if
(
expected_to_finish_
&&
!
finished_
)
{
if
(
expected_to_finish_
&&
!
finished_
)
{
FAIL
()
<<
"The predicate assertion unexp
a
ctedly aborted the test."
;
FAIL
()
<<
"The predicate assertion unexp
e
ctedly aborted the test."
;
}
else
if
(
!
expected_to_finish_
&&
finished_
)
{
}
else
if
(
!
expected_to_finish_
&&
finished_
)
{
FAIL
()
<<
"The failed predicate assertion didn't abort the test "
FAIL
()
<<
"The failed predicate assertion didn't abort the test "
"as expected."
;
"as expected."
;
...
@@ -1964,7 +1964,7 @@ class Predicate5Test : public testing::Test {
...
@@ -1964,7 +1964,7 @@ class Predicate5Test : public testing::Test {
// Verifies that the control flow in the test function is expected.
// Verifies that the control flow in the test function is expected.
if
(
expected_to_finish_
&&
!
finished_
)
{
if
(
expected_to_finish_
&&
!
finished_
)
{
FAIL
()
<<
"The predicate assertion unexp
a
ctedly aborted the test."
;
FAIL
()
<<
"The predicate assertion unexp
e
ctedly aborted the test."
;
}
else
if
(
!
expected_to_finish_
&&
finished_
)
{
}
else
if
(
!
expected_to_finish_
&&
finished_
)
{
FAIL
()
<<
"The failed predicate assertion didn't abort the test "
FAIL
()
<<
"The failed predicate assertion didn't abort the test "
"as expected."
;
"as expected."
;
...
...
googletest/test/gtest_unittest.cc
View file @
09074c15
...
@@ -404,7 +404,7 @@ TEST(FormatTimeInMillisAsSecondsTest, FormatsNegativeNumber) {
...
@@ -404,7 +404,7 @@ TEST(FormatTimeInMillisAsSecondsTest, FormatsNegativeNumber) {
// Tests FormatEpochTimeInMillisAsIso8601(). The correctness of conversion
// Tests FormatEpochTimeInMillisAsIso8601(). The correctness of conversion
// for particular dates below was verified in Python using
// for particular dates below was verified in Python using
// datetime.datetime.fromutctimestamp(<timetamp>/1000).
// datetime.datetime.fromutctimestamp(<time
s
tamp>/1000).
// FormatEpochTimeInMillisAsIso8601 depends on the current timezone, so we
// FormatEpochTimeInMillisAsIso8601 depends on the current timezone, so we
// have to set up a particular timezone to obtain predictable results.
// have to set up a particular timezone to obtain predictable results.
...
...
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