diff options
| author | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-11-17 23:33:18 +0000 | 
|---|---|---|
| committer | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-11-17 23:33:18 +0000 | 
| commit | b6c141fe2ad9665e975dfcc9ebf238cac4e77242 (patch) | |
| tree | 2c2b07470ff5b0cb2f631a2a775cebe01830c2f0 | |
| parent | fe25aea9716b29fc02e61af096054ea665db9ee3 (diff) | |
| download | googletest-b6c141fe2ad9665e975dfcc9ebf238cac4e77242.tar.gz googletest-b6c141fe2ad9665e975dfcc9ebf238cac4e77242.tar.bz2 googletest-b6c141fe2ad9665e975dfcc9ebf238cac4e77242.zip | |
Fixes comments in sample7_unittest.cc.
| -rw-r--r-- | samples/sample7_unittest.cc | 20 | 
1 files changed, 9 insertions, 11 deletions
| diff --git a/samples/sample7_unittest.cc b/samples/sample7_unittest.cc index 441acf97..1b651a21 100644 --- a/samples/sample7_unittest.cc +++ b/samples/sample7_unittest.cc @@ -45,12 +45,11 @@  using ::testing::TestWithParam;  using ::testing::Values; -// As a general rule, tested objects should not be reused between tests. -// Also, their constructors and destructors of tested objects can have -// side effects. Thus you should create and destroy them for each test. -// In this sample we will define a simple factory function for PrimeTable -// objects. We will instantiate objects in test's SetUp() method and -// delete them in TearDown() method. +// As a general rule, to prevent a test from affecting the tests that come +// after it, you should create and destroy the tested objects for each test +// instead of reusing them.  In this sample we will define a simple factory +// function for PrimeTable objects.  We will instantiate objects in test's +// SetUp() method and delete them in TearDown() method.  typedef PrimeTable* CreatePrimeTableFunc();  PrimeTable* CreateOnTheFlyPrimeTable() { @@ -62,11 +61,10 @@ PrimeTable* CreatePreCalculatedPrimeTable() {    return new PreCalculatedPrimeTable(max_precalculated);  } -// Inside the test body, fixture constructor, SetUp(), and TearDown() -// you can refer to the test parameter by GetParam(). -// In this case, the test parameter is a PrimeTableFactory interface pointer -// which we use in fixture's SetUp() to create and store an instance of -// PrimeTable. +// Inside the test body, fixture constructor, SetUp(), and TearDown() you +// can refer to the test parameter by GetParam().  In this case, the test +// parameter is a factory function which we call in fixture's SetUp() to +// create and store an instance of PrimeTable.  class PrimeTableTest : public TestWithParam<CreatePrimeTableFunc*> {   public:    virtual ~PrimeTableTest() { delete table_; } | 
