Skip to content

Commit 1a3e2a2

Browse files
cramertjcopybara-github
authored andcommitted
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
1 parent 4848324 commit 1a3e2a2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

googlemock/src/gmock-spec-builders.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ void ExpectationBase::UntypedTimes(const Cardinality& a_cardinality) {
264264
".Times() cannot appear "
265265
"more than once in an EXPECT_CALL().");
266266
} else {
267-
ExpectSpecProperty(last_clause_ < kTimes,
268-
".Times() cannot appear after "
269-
".InSequence(), .WillOnce(), .WillRepeatedly(), "
270-
"or .RetiresOnSaturation().");
267+
ExpectSpecProperty(
268+
last_clause_ < kTimes,
269+
".Times() may only appear *before* .InSequence(), .WillOnce(), "
270+
".WillRepeatedly(), or .RetiresonSaturation(), not after.");
271271
}
272272
last_clause_ = kTimes;
273273

googlemock/test/gmock-spec-builders_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ TEST(ExpectCallSyntaxTest, TimesMustBeBeforeInSequence) {
390390
EXPECT_CALL(a, DoA(1))
391391
.InSequence(s)
392392
.Times(1);
393-
}, ".Times() cannot appear after ");
393+
}, ".Times() may only appear *before* ");
394394

395395
a.DoA(1);
396396
}

0 commit comments

Comments
 (0)