I am writing a test to check the sequence of calls in an image processing thread. The relevant part of the test code is as follows:
Sequence s1, s2; ... EXPECT_CALL(*mMockVideoSource, getFrame()).InSequence(s2).WillRepeatedly(Return(mFakeBuffer)); EXPECT_CALL(*mMockProcessor, processFrame(_,_)).InSequence(s2).WillRepeatedly(Return(0)); EXPECT_CALL(*mMockVideoSource, releaseFrame(_)).Times(AnyNumber()).InSequence(s2); ...
In this case, the sequence of calls is extremely important. getFrame() , processFrame() and releaseFrame() should be called in that order. Unfortunately, the above code does not actually do what I want. The above code will allow getFrame() be called several times before calling processFrame() , and calling getFrame() after releaseFrame() is considered an error, as it interrupts the sequence.
Can a certain sequence of calls be expected to recur? I donβt care how many times the sequence is executed if the functions are called in order: receive, process, release, receive, process, release ...
source share