Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
6dabd081
Commit
6dabd081
authored
Mar 24, 2021
by
Abseil Team
Committed by
Dino Radaković
Mar 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Googletest export
Code style cleanup in docs PiperOrigin-RevId: 364907938
parent
5142ccd2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
advanced.md
docs/advanced.md
+6
-6
gmock_cook_book.md
docs/gmock_cook_book.md
+3
-3
No files found.
docs/advanced.md
View file @
6dabd081
...
@@ -1205,10 +1205,10 @@ class FooTest : public testing::Test {
...
@@ -1205,10 +1205,10 @@ class FooTest : public testing::Test {
}
}
// You can define per-test set-up logic as usual.
// You can define per-test set-up logic as usual.
v
irtual
void
SetUp
()
{
...
}
v
oid
SetUp
()
override
{
...
}
// You can define per-test tear-down logic as usual.
// You can define per-test tear-down logic as usual.
v
irtual
void
TearDown
()
{
...
}
v
oid
TearDown
()
override
{
...
}
// Some expensive resource shared by all tests.
// Some expensive resource shared by all tests.
static
T
*
shared_resource_
;
static
T
*
shared_resource_
;
...
@@ -1239,7 +1239,7 @@ First, you subclass the `::testing::Environment` class to define a test
...
@@ -1239,7 +1239,7 @@ First, you subclass the `::testing::Environment` class to define a test
environment, which knows how to set-up and tear-down:
environment, which knows how to set-up and tear-down:
```
c++
```
c++
class
Environment
:
public
testing
::
Environment
{
class
Environment
:
public
::
testing
::
Environment
{
public
:
public
:
~
Environment
()
override
{}
~
Environment
()
override
{}
...
@@ -1974,13 +1974,13 @@ Here's an example:
...
@@ -1974,13 +1974,13 @@ Here's an example:
```
c++
```
c++
class
MinimalistPrinter
:
public
testing
::
EmptyTestEventListener
{
class
MinimalistPrinter
:
public
testing
::
EmptyTestEventListener
{
// Called before a test starts.
// Called before a test starts.
v
irtual
void
OnTestStart
(
const
testing
::
TestInfo
&
test_info
)
{
v
oid
OnTestStart
(
const
testing
::
TestInfo
&
test_info
)
override
{
printf
(
"*** Test %s.%s starting.
\n
"
,
printf
(
"*** Test %s.%s starting.
\n
"
,
test_info
.
test_suite_name
(),
test_info
.
name
());
test_info
.
test_suite_name
(),
test_info
.
name
());
}
}
// Called after a failed assertion or a SUCCESS().
// Called after a failed assertion or a SUCCESS().
v
irtual
void
OnTestPartResult
(
const
testing
::
TestPartResult
&
test_part_result
)
{
v
oid
OnTestPartResult
(
const
testing
::
TestPartResult
&
test_part_result
)
override
{
printf
(
"%s in %s:%d
\n
%s
\n
"
,
printf
(
"%s in %s:%d
\n
%s
\n
"
,
test_part_result
.
failed
()
?
"*** Failure"
:
"Success"
,
test_part_result
.
failed
()
?
"*** Failure"
:
"Success"
,
test_part_result
.
file_name
(),
test_part_result
.
file_name
(),
...
@@ -1989,7 +1989,7 @@ Here's an example:
...
@@ -1989,7 +1989,7 @@ Here's an example:
}
}
// Called after a test ends.
// Called after a test ends.
v
irtual
void
OnTestEnd
(
const
testing
::
TestInfo
&
test_info
)
{
v
oid
OnTestEnd
(
const
testing
::
TestInfo
&
test_info
)
override
{
printf
(
"*** Test %s.%s ending.
\n
"
,
printf
(
"*** Test %s.%s ending.
\n
"
,
test_info
.
test_suite_name
(),
test_info
.
name
());
test_info
.
test_suite_name
(),
test_info
.
name
());
}
}
...
...
docs/gmock_cook_book.md
View file @
6dabd081
...
@@ -268,7 +268,7 @@ class FileInterface {
...
@@ -268,7 +268,7 @@ class FileInterface {
class
File
:
public
FileInterface
{
class
File
:
public
FileInterface
{
public
:
public
:
...
...
virtual
bool
Open
(
const
char
*
path
,
const
char
*
mode
)
{
bool
Open
(
const
char
*
path
,
const
char
*
mode
)
override
{
return
OpenFile
(
path
,
mode
);
return
OpenFile
(
path
,
mode
);
}
}
};
};
...
@@ -512,9 +512,9 @@ The trick is to redispatch the method in the mock class:
...
@@ -512,9 +512,9 @@ The trick is to redispatch the method in the mock class:
class
ScopedMockLog
:
public
LogSink
{
class
ScopedMockLog
:
public
LogSink
{
public
:
public
:
...
...
v
irtual
v
oid
send
(
LogSeverity
severity
,
const
char
*
full_filename
,
void
send
(
LogSeverity
severity
,
const
char
*
full_filename
,
const
char
*
base_filename
,
int
line
,
const
tm
*
tm_time
,
const
char
*
base_filename
,
int
line
,
const
tm
*
tm_time
,
const
char
*
message
,
size_t
message_len
)
{
const
char
*
message
,
size_t
message_len
)
override
{
// We are only interested in the log severity, full file name, and
// We are only interested in the log severity, full file name, and
// log message.
// log message.
Log
(
severity
,
full_filename
,
std
::
string
(
message
,
message_len
));
Log
(
severity
,
full_filename
,
std
::
string
(
message
,
message_len
));
...
...
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