Rephrase the description of TEST_F() arguments for clarity.
PiperOrigin-RevId: 512937964 Change-Id: Ifa6369a80dc7d8efe60511417496d58317cfc28d
This commit is contained in:
parent
8aa75fa771
commit
555486f408
@ -227,14 +227,14 @@ When using a fixture, use `TEST_F()` instead of `TEST()` as it allows you to
|
|||||||
access objects and subroutines in the test fixture:
|
access objects and subroutines in the test fixture:
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
TEST_F(TestFixtureName, TestName) {
|
TEST_F(TestFixtureClassName, TestName) {
|
||||||
... test body ...
|
... test body ...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Like `TEST()`, the first argument is the test suite name, but for `TEST_F()`
|
Unlike `TEST()`, in `TEST_F()` the first argument must be the name of the test
|
||||||
this must be the name of the test fixture class. You've probably guessed: `_F`
|
fixture class. (`_F` stands for "Fixture"). No test suite name is specified for
|
||||||
is for fixture.
|
this macro.
|
||||||
|
|
||||||
Unfortunately, the C++ macro system does not allow us to create a single macro
|
Unfortunately, the C++ macro system does not allow us to create a single macro
|
||||||
that can handle both types of tests. Using the wrong macro causes a compiler
|
that can handle both types of tests. Using the wrong macro causes a compiler
|
||||||
|
Loading…
Reference in New Issue
Block a user