Commit 1a3e2a26 authored by Taylor Cramer's avatar Taylor Cramer Committed by Copybara-Service
Browse files

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
parent 4848324c
...@@ -264,10 +264,10 @@ void ExpectationBase::UntypedTimes(const Cardinality& a_cardinality) { ...@@ -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;
......
...@@ -390,7 +390,7 @@ TEST(ExpectCallSyntaxTest, TimesMustBeBeforeInSequence) { ...@@ -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);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment