Clarify "Times() after X" error message

The previous error message could be misinterpreted to mean that `Times` could not be
used in combination with `WillRepeatedly`, when in fact the call to `Times` just needs to happen *first*.

PiperOrigin-RevId: 410070405
Change-Id: I747d34a4334cf2e56d589dcad3a08a8f322d77c8
This commit is contained in:
Taylor Cramer 2021-11-15 13:47:36 -08:00 committed by Copybara-Service
parent 4848324c5f
commit 1a3e2a265f
2 changed files with 5 additions and 5 deletions

View File

@ -264,10 +264,10 @@ void ExpectationBase::UntypedTimes(const Cardinality& a_cardinality) {
".Times() cannot appear " ".Times() cannot appear "
"more than once in an EXPECT_CALL()."); "more than once in an EXPECT_CALL().");
} else { } else {
ExpectSpecProperty(last_clause_ < kTimes, ExpectSpecProperty(
".Times() cannot appear after " last_clause_ < kTimes,
".InSequence(), .WillOnce(), .WillRepeatedly(), " ".Times() may only appear *before* .InSequence(), .WillOnce(), "
"or .RetiresOnSaturation()."); ".WillRepeatedly(), or .RetiresonSaturation(), not after.");
} }
last_clause_ = kTimes; last_clause_ = kTimes;

View File

@ -390,7 +390,7 @@ TEST(ExpectCallSyntaxTest, TimesMustBeBeforeInSequence) {
EXPECT_CALL(a, DoA(1)) EXPECT_CALL(a, DoA(1))
.InSequence(s) .InSequence(s)
.Times(1); .Times(1);
}, ".Times() cannot appear after "); }, ".Times() may only appear *before* ");
a.DoA(1); a.DoA(1);
} }