title: Access Google Test fixture member
body: <p>I am trying to mock hardware abstraction layer function, which is <code>uint32_t hw_epoch()</code> by  writing a fake, and from a fake calling mock method, which will let me verify that the <code>hw_epoch()</code> function is called.  So considering the simplified code below:</p>
  <pre><code>#include &lt;stdint.h&gt;
  #include &quot;gmock/gmock.h&quot;
  
  using ::testing::Return;
  
  class FooInterface {
   public:
      virtual ~FooInterface() {}
      virtual uint32_t m_hw_epoch() = 0;
  };
  
  class MockFoo : public FooInterface {
   public:
      MOCK_METHOD0(m_hw_epoch, uint32_t());
   private:
  };
  
  // ----- Test Fixture:
  class FooTest : public ::testing::Test {
   public:
      FooTest() : FooInterfacePtr(&amp;MockFooObj) {}
      ~FooTest() {}
  
      MockFoo MockFooObj;
      FooInterface* FooInterfacePtr;
  };
  
  // ----- Fakes
  uint32_t hw_epoch() {
      FooInterfacePtr-&gt;m_hw_epoch();  // *** How Can I access FooInterfacePtr?
      return 5;
  }
  
  TEST_F(FooTest, constructor) {
  }
  </code></pre>
  <p>The FooTest Fixture has member <code>FooInterfacePtr</code>, how can I access this member from free function <code>uint32_t hw_epoch()</code>?</p>
  <p>Thank you...</p>