We could make this a normal object instead of a shared_ptr, by using the Test fixture constructor, instead of SetUp(), to initialize the fixture.
In general, I prefer using the constructor since it allows us to initialize members objects (like session_manager in this case) and also to have const members variables. Of course, there are a few cases when we need to use SetUp(), as mentioned in the linked FAQ below.
34 + std::shared_ ptr<msess: :SessionManager > session_manager;
We could make this a normal object instead of a shared_ptr, by using the Test fixture constructor, instead of SetUp(), to initialize the fixture.
In general, I prefer using the constructor since it allows us to initialize members objects (like session_manager in this case) and also to have const members variables. Of course, there are a few cases when we need to use SetUp(), as mentioned in the linked FAQ below.
See https:/ /code.google. com/p/googletes t/wiki/ V1_6_FAQ# Should_ I_use_the_ constructor/ destructor_ of_the_ test_fixture_ or_t