diff options
Diffstat (limited to 'googletest/docs/faq.md')
-rw-r--r-- | googletest/docs/faq.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/googletest/docs/faq.md b/googletest/docs/faq.md index 0e9cfee..d6e7f54 100644 --- a/googletest/docs/faq.md +++ b/googletest/docs/faq.md @@ -8,7 +8,7 @@ Underscore (`_`) is special, as C++ reserves the following to be used by the compiler and the standard library: 1. any identifier that starts with an `_` followed by an upper-case letter, and -1. any identifier that contains two consecutive underscores (i.e. `__`) +2. any identifier that contains two consecutive underscores (i.e. `__`) *anywhere* in its name. User code is *prohibited* from using such identifiers. @@ -22,11 +22,11 @@ contains `_`? 1. If `TestSuiteName` starts with an `_` followed by an upper-case letter (say, `_Foo`), we end up with `_Foo_TestName_Test`, which is reserved and thus invalid. -1. If `TestSuiteName` ends with an `_` (say, `Foo_`), we get +2. If `TestSuiteName` ends with an `_` (say, `Foo_`), we get `Foo__TestName_Test`, which is invalid. -1. If `TestName` starts with an `_` (say, `_Bar`), we get +3. If `TestName` starts with an `_` (say, `_Bar`), we get `TestSuiteName__Bar_Test`, which is invalid. -1. If `TestName` ends with an `_` (say, `Bar_`), we get +4. If `TestName` ends with an `_` (say, `Bar_`), we get `TestSuiteName_Bar__Test`, which is invalid. So clearly `TestSuiteName` and `TestName` cannot start or end with `_` @@ -524,8 +524,8 @@ There are several good reasons: contaminating others, making debugging difficult. By using fixtures, each test has a fresh set of variables that's different (but with the same names). Thus, tests are kept independent of each other. -1. Global variables pollute the global namespace. -1. Test fixtures can be reused via subclassing, which cannot be done easily +2. Global variables pollute the global namespace. +3. Test fixtures can be reused via subclassing, which cannot be done easily with global variables. This is useful if many test suites have something in common. |