title: EXPECT_CALL of googlemock leads to "unknown file:error: SEH exception with code 0xc0000005 thrown in the test body"
body: <p>I am novice to googlemock. My current project needs googlemock to use. I have learned from basics of gmock from google help site. But when I have tried to implement the same in my project it threw <code>SEH exception with code 0xc0000005</code> error.
  My project has multiple threads, one of the thread call RUN_ALL_TESTS
  The above code leads to <code>SEH exception</code></p>
  
  <p>tools: VS2010, windows 7 </p>
  
  <p><code>Try to mock the function of a class</code></p>
  
  <pre><code>using ::testing::Return;
  using ::testing::Test;
  using ::testing::NiceMock;
  
  class OsInterfaceCPP
  {  
  
  public: 
  
      OsInterfaceCPP(void){};
      virtual ~OsInterfaceCPP(void){};
      virtual int add_test(int a, int b) = 0;
      int calladdtest(int aa, int bb)
      {
          return add_test(aa,bb);
      }
  };  
  class OsCPPApis : public OsInterfaceCPP 
  {  
  public: 
      OsCPPApis(void){};
      virtual ~OsCPPApis(void){};
      virtual int add_test(int aa, int bb)
      {
          return (aa+bb);
      }
  };
  
  class MockedOSCPPApis : public  OsCPPApis
  {
  public:
      MockedOSCPPApis(void){};
      virtual ~MockedOSCPPApis(void){};
      MOCK_METHOD2(add_test, int(int aaa, int bbb));
  };
  
  
  OSapiTestFunc::OSapiTestFunc(void){}
  
  OSapiTestFunc::~OSapiTestFunc(void){}
  
  void OSapiTestFunc::SetUp(){}
  
  void OSapiTestFunc::TearDown(){}
  
  void OSapiTestFunc::RunTests()
  {
      int argc=0;
      char **argv = 0;
      ::testing::InitGoogleMock(&amp;argc, argv); 
  
  }
  
  TEST_F(OSapiTestFunc, OS_Test1)
  {
  
      OsCPPApis TestOscppapis;
      MockedOSCPPApis Testmockosapi;
      int a, b;
      a = 2;
      b = 5;
      bool test1var = true;
      EXPECT_CALL(Testmockosapi,add_test(a, b));
  
      TestOscppapis.add_test(5,3);
  }
  </code></pre>