do FRIEND_TEST manually

two reasons to expand FRIEND_TEST manually:
* we don't need to depend on gtest if we don't do want to perform test
* no need to include gtest headers in dmclock_{client,server}.h in
  non-test code, it slows down the compilation by introducing unecessary
  bits in header files.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2017-07-13 12:19:30 +08:00
parent b84ccf9e61
commit d72fac147e
2 changed files with 4 additions and 6 deletions

View File

@ -19,8 +19,6 @@
#include "dmclock_util.h"
#include "dmclock_recs.h"
#include "gtest/gtest_prod.h"
namespace crimson {
namespace dmclock {
@ -57,7 +55,8 @@ namespace crimson {
// S is server identifier type
template<typename S>
class ServiceTracker {
FRIEND_TEST(dmclock_client, server_erase);
// we don't want to include gtest.h just for FRIEND_TEST
friend class dmclock_client_server_erase_Test;
using TimePoint = decltype(std::chrono::steady_clock::now());
using Duration = std::chrono::milliseconds;

View File

@ -50,8 +50,6 @@
#include "profile.h"
#endif
#include "gtest/gtest_prod.h"
namespace crimson {
@ -235,7 +233,8 @@ namespace crimson {
// branching factor
template<typename C, typename R, uint B>
class PriorityQueueBase {
FRIEND_TEST(dmclock_server, client_idle_erase);
// we don't want to include gtest.h just for FRIEND_TEST
friend class dmclock_server_client_idle_erase_Test;
public: