title: Google Test/Mock test fail if expected call is over-saturated
body: <p>How can I make google test fail if google mocked method is called more than expected times?</p>
  
  <p>Here is the example:</p>
  
  <pre><code>class MockIO : iIO
  {
      MOCK_METHOD1(IO_Read, void (uint8_t));
  };
  
  TEST(case, test)
  {
      MockIO io;
      EXPECT_CALL(io, IO_Read(0x01)).Times(10);
      for (i=0; i&lt;20; i++)
          io.IO_Read(0x01);
  }
  </code></pre>
  
  <p>As I understand I should try </p>
  
  <pre><code>EXPECT_CALL(io, IO_Read(0x01)).Times(10).Throw(exception);
  </code></pre>
  
  <p>But in embedded projects exceptions not used.</p>
  
  <p>Any ideas?</p>