title: Invoking Overloaded Function on Google Mock
body: <p>I'm attempting to test an abstract class using Google Mock. Following the <a href="https://code.google.com/p/googlemock/wiki/ForDummies" rel="nofollow">forDummies</a> guide, I've constructed a mock of my class:</p>
  
  <p><strong>AbstractFoo.h</strong></p>
  
  <pre><code>class AbstractFoo {
  public:
    virtual void setSize(int w, int h) = 0;
    void setSize(const QSize&amp; s); // implemented as calling above function
  }
  </code></pre>
  
  <p><strong>MockFoo.h</strong></p>
  
  <pre><code>#include "gmock/gmock.h"
  class MockFoo : public AbstractFoo {
  public:
    MOCK_METHOD2(setSize, void(int w, int h));
  }
  </code></pre>
  
  <p><strong>FooTest.cpp</strong></p>
  
  <pre><code>#include "gmock/gmock.h"
  #include "gtest/gtest.h"
  #include "MockFoo.h"
  
  TEST(AbstractFoo, MethodSetSize) {
    MockFoo foo;
    EXPECT_CALL(foo, setSize(5, 5)).Times(1);
    foo.setSize(QSize(5, 5)); // this line produces compiler error
  }
  </code></pre>
  
  <p>The marked line produces the following compiler error:</p>
  
  <blockquote>
    <p>C2660: 'MockFoo::setSize' : function does not take 1 arguments</p>
  </blockquote>
  
  <p>My understanding is that since <code>MockFoo</code> extends <code>AbstractFoo</code>, it should inherit the <code>setSize(QSize)</code> method.  However, this does not appear to be the case.  How can I fix this?</p>
  
  <p><em>edited for code inaccuracies</em></p>