summaryrefslogtreecommitdiffstats
path: root/googlemock
diff options
context:
space:
mode:
authorTaylor Cramer <cramertj@google.com>2021-11-15 21:47:36 (GMT)
committerCopybara-Service <copybara-worker@google.com>2021-11-15 21:48:12 (GMT)
commit1a3e2a265f35e604378156cd675b11ef0a184627 (patch)
treef20f52ef000f59ecec86ab51629c211c3f7b41da /googlemock
parent4848324c5ff3186a7f72a674f6760d0b8da585d7 (diff)
downloadgoogletest-1a3e2a265f35e604378156cd675b11ef0a184627.zip
googletest-1a3e2a265f35e604378156cd675b11ef0a184627.tar.gz
googletest-1a3e2a265f35e604378156cd675b11ef0a184627.tar.bz2
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
Diffstat (limited to 'googlemock')
-rw-r--r--googlemock/src/gmock-spec-builders.cc8
-rw-r--r--googlemock/test/gmock-spec-builders_test.cc2
2 files changed, 5 insertions, 5 deletions
diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc
index df023e4..8f8d7f9 100644
--- a/googlemock/src/gmock-spec-builders.cc
+++ b/googlemock/src/gmock-spec-builders.cc
@@ -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;
diff --git a/googlemock/test/gmock-spec-builders_test.cc b/googlemock/test/gmock-spec-builders_test.cc
index b13e1c1..7f29b61 100644
--- a/googlemock/test/gmock-spec-builders_test.cc
+++ b/googlemock/test/gmock-spec-builders_test.cc
@@ -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);
}