title: Gmock with struct data
body: <p>I want to verify function parameters with gmock. Function parameters are in struct format as follows:</p>
  
  <p><strong>SomeClass.h:</strong></p>
  
  <pre><code>class SomeClass {
  public:
      SomeClass();
      virtual ~SomeClass();
      struct SomeData {
          int Value;
          int Serie;
      };
      virtual void getData(SomeData &amp;data);
  };
  </code></pre>
  
  <p><strong>SomeClass.cpp:</strong></p>
  
  <pre><code>#include "../include/SomeClass.h"
  
      SomeClass::SomeClass(){}
      SomeClass::~SomeClass(){}
  
      void SomeClass::getData(SomeData &amp;data){
          data.Serie = 4;
          data.Value = 5;
      }
  </code></pre>
  
  <p><strong>MockSomeClass.h</strong></p>
  
  <pre><code>#include "gmock/gmock.h"
  #include "gtest/gtest.h"
  #include "../include/SomeClass.h"
  
  class MockSomeClass: public SomeClass {
  public:
      MockSomeClass(){};
      virtual ~MockSomeClass(){};
      SomeData data;
      MOCK_METHOD1(getData, void(SomeData &amp;data));
  };
  </code></pre>
  
  <p><strong>testSomeClass:</strong></p>
  
  <pre><code>#include &lt;gtest/gtest.h&gt;
  #include &lt;gmock/gmock.h&gt;
  
  #include "../include/SomeClass.h"
  #include "MockSomeClass.h"
  
  using ::testing::_;
  using ::testing::AtLeast;
  
  TEST(testSomeMethod, test1){
      MockSomeClass mock1;
      SomeClass::SomeData data;
      EXPECT_CALL(mock1, getData(_)).Times(AtLeast(2));
      mock1.getData(data);
      mock1.getData(data);
  }
  
  TEST(testSomeMethod, test2){
      MockSomeClass mock2;
      SomeClass::SomeData data;
      EXPECT_CALL(mock2, getData(SomeClass::SomeData &amp;data));
      mock2.getData(data);
  }
  </code></pre>
  
  <p>When I run testSomeClass, test1 goes through without errors but test2 is causing trouble. Any proposals how to include data in struct format to function call with gmock?</p>