aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkosak <kosak@google.com>2014-01-12 23:42:34 +0000
committerkosak <kosak@google.com>2014-01-12 23:42:34 +0000
commit04ce8521f481d857db1aa00a206278759b9b0381 (patch)
treedfe2a98ae208ef6686fd8d424d5836ba98a32752 /test
parent18489fa4f81a65ab5f42a6705c28ca2f80eab3bd (diff)
downloadgoogletest-04ce8521f481d857db1aa00a206278759b9b0381.tar.gz
googletest-04ce8521f481d857db1aa00a206278759b9b0381.tar.bz2
googletest-04ce8521f481d857db1aa00a206278759b9b0381.zip
Adds a note in the "uninteresting mock method call" warning to advise people how to handle the warning.
Clarifies the purpose of utilities in gmock-port.h and adds guidance w.r.t. gmock-port.h vs gtest-port.h. Pulls in gtest r674.
Diffstat (limited to 'test')
-rw-r--r--test/gmock-spec-builders_test.cc16
-rw-r--r--test/gmock_output_test_golden.txt4
2 files changed, 16 insertions, 4 deletions
diff --git a/test/gmock-spec-builders_test.cc b/test/gmock-spec-builders_test.cc
index 843681cf..ae811498 100644
--- a/test/gmock-spec-builders_test.cc
+++ b/test/gmock-spec-builders_test.cc
@@ -2088,6 +2088,12 @@ class GMockVerboseFlagTest : public VerboseFlagPreservingFixture {
// Tests how the flag affects uninteresting calls on a naggy mock.
void TestUninterestingCallOnNaggyMock(bool should_print) {
NaggyMock<MockA> a;
+ const string note =
+ "NOTE: You can safely ignore the above warning unless this "
+ "call should not happen. Do not suppress it by blindly adding "
+ "an EXPECT_CALL() if you don't mean to enforce the call. "
+ "See http://code.google.com/p/googlemock/wiki/CookBook#"
+ "Knowing_When_to_Expect for details.";
// A void-returning function.
CaptureStdout();
@@ -2097,8 +2103,9 @@ class GMockVerboseFlagTest : public VerboseFlagPreservingFixture {
should_print,
"\nGMOCK WARNING:\n"
"Uninteresting mock function call - returning directly.\n"
- " Function call: DoA(5)\n"
- "Stack trace:\n",
+ " Function call: DoA(5)\n" +
+ note +
+ "\nStack trace:\n",
"DoA");
// A non-void-returning function.
@@ -2110,8 +2117,9 @@ class GMockVerboseFlagTest : public VerboseFlagPreservingFixture {
"\nGMOCK WARNING:\n"
"Uninteresting mock function call - returning default value.\n"
" Function call: Binary(2, 1)\n"
- " Returns: false\n"
- "Stack trace:\n",
+ " Returns: false\n" +
+ note +
+ "\nStack trace:\n",
"Binary");
}
};
diff --git a/test/gmock_output_test_golden.txt b/test/gmock_output_test_golden.txt
index a7ff5630..b6b2d349 100644
--- a/test/gmock_output_test_golden.txt
+++ b/test/gmock_output_test_golden.txt
@@ -75,6 +75,7 @@ GMOCK WARNING:
Uninteresting mock function call - returning default value.
Function call: Bar2(0, 1)
Returns: false
+NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See http://code.google.com/p/googlemock/wiki/CookBook#Knowing_When_to_Expect for details.
Stack trace:
[ OK ] GMockOutputTest.UninterestingCall
[ RUN ] GMockOutputTest.UninterestingCallToVoidFunction
@@ -82,6 +83,7 @@ Stack trace:
GMOCK WARNING:
Uninteresting mock function call - returning directly.
Function call: Bar3(0, 1)
+NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See http://code.google.com/p/googlemock/wiki/CookBook#Knowing_When_to_Expect for details.
Stack trace:
[ OK ] GMockOutputTest.UninterestingCallToVoidFunction
[ RUN ] GMockOutputTest.RetiredExpectation
@@ -266,6 +268,7 @@ Uninteresting mock function call - taking default action specified at:
FILE:#:
Function call: Bar2(2, 2)
Returns: true
+NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See http://code.google.com/p/googlemock/wiki/CookBook#Knowing_When_to_Expect for details.
Stack trace:
GMOCK WARNING:
@@ -273,6 +276,7 @@ Uninteresting mock function call - taking default action specified at:
FILE:#:
Function call: Bar2(1, 1)
Returns: false
+NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See http://code.google.com/p/googlemock/wiki/CookBook#Knowing_When_to_Expect for details.
Stack trace:
[ OK ] GMockOutputTest.UninterestingCallWithDefaultAction
[ RUN ] GMockOutputTest.ExplicitActionsRunOutWithDefaultAction