mirror of
https://github.com/google/googletest.git
synced 2024-12-27 10:11:03 +08:00
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:
parent
4848324c5f
commit
1a3e2a265f
@ -264,10 +264,10 @@ void ExpectationBase::UntypedTimes(const Cardinality& a_cardinality) {
|
||||
".Times() cannot appear "
|
||||
"more than once in an EXPECT_CALL().");
|
||||
} else {
|
||||
ExpectSpecProperty(last_clause_ < kTimes,
|
||||
".Times() cannot appear after "
|
||||
".InSequence(), .WillOnce(), .WillRepeatedly(), "
|
||||
"or .RetiresOnSaturation().");
|
||||
ExpectSpecProperty(
|
||||
last_clause_ < kTimes,
|
||||
".Times() may only appear *before* .InSequence(), .WillOnce(), "
|
||||
".WillRepeatedly(), or .RetiresonSaturation(), not after.");
|
||||
}
|
||||
last_clause_ = kTimes;
|
||||
|
||||
|
@ -390,7 +390,7 @@ TEST(ExpectCallSyntaxTest, TimesMustBeBeforeInSequence) {
|
||||
EXPECT_CALL(a, DoA(1))
|
||||
.InSequence(s)
|
||||
.Times(1);
|
||||
}, ".Times() cannot appear after ");
|
||||
}, ".Times() may only appear *before* ");
|
||||
|
||||
a.DoA(1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user