Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Googletest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Meng
Googletest
Commits
a781fe29
Commit
a781fe29
authored
4 years ago
by
vslashg
Browse files
Options
Downloads
Plain Diff
Merge pull request #2937 from Ashikpaul:patch-1
PiperOrigin-RevId: 321178217
parents
eb660507
c4a5ee3a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
googletest/docs/faq.md
+5
-5
5 additions, 5 deletions
googletest/docs/faq.md
with
5 additions
and
5 deletions
googletest/docs/faq.md
+
5
−
5
View file @
a781fe29
...
...
@@ -295,7 +295,7 @@ program from the beginning in the child process. Therefore make sure your
program can run side-by-side with itself and is deterministic.
In the end, this boils down to good concurrent programming. You have to make
sure that there
is
no race conditions or dead
locks in your program. No silver
sure that there
are
no race conditions or deadlocks in your program. No silver
bullet - sorry!
## Should I use the constructor/destructor of the test fixture or SetUp()/TearDown()? {#CtorVsSetUp}
...
...
@@ -401,7 +401,7 @@ you can use it in a predicate assertion like this:
ASSERT_PRED1
(
IsNegative
<
int
>
,
-
5
);
```
Things are more interesting if your template has more than one parameter
s
. The
Things are more interesting if your template has more than one parameter. The
following won't compile:
```
c++
...
...
@@ -555,7 +555,7 @@ TEST(MyDeathTest, ComplexExpression) {
"(Func1|Method) failed"
);
}
// Death assertions can be used any
where in a function. In
// Death assertions can be used anywhere in a function. In
// particular, they can be inside a loop.
TEST
(
MyDeathTest
,
InsideLoop
)
{
// Verifies that Foo(0), Foo(1), ..., and Foo(4) all die.
...
...
@@ -597,7 +597,7 @@ However, there are cases where you have to define your own:
## Why does ASSERT_DEATH complain about previous threads that were already joined?
With the Linux pthread library, there is no turning back once you cross the line
from single thread to multiple threads. The first time you create a thread, a
from
a
single thread to multiple threads. The first time you create a thread, a
manager thread is created in addition, so you get 3, not 2, threads. Later when
the thread you create joins the main thread, the thread count decrements by 1,
but the manager thread will never be killed, so you still have 2 threads, which
...
...
@@ -612,7 +612,7 @@ runs on, you shouldn't depend on this.
googletest does not interleave tests from different test suites. That is, it
runs all tests in one test suite first, and then runs all tests in the next test
suite, and so on. googletest does this because it needs to set up a test suite
before the first test in it is run, and tear it down afterw
o
rds. Splitting up
before the first test in it is run, and tear it down afterw
a
rds. Splitting up
the test case would require multiple set-up and tear-down processes, which is
inefficient and makes the semantics unclean.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment