From 2fd619edd3d1ec053f6276debdb513f1122ebcf3 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Thu, 31 May 2012 20:40:56 +0000 Subject: Pulls in gtest r615. Renames internal enums to the kFoo naming style. Fixes gmock doctor to work with newer versions of Clang. --- include/gmock/gmock-generated-actions.h | 3 --- include/gmock/gmock-generated-actions.h.pump | 3 --- include/gmock/gmock-spec-builders.h | 17 ++++++++--------- include/gmock/internal/gmock-internal-utils.h | 10 +++++----- 4 files changed, 13 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/gmock/gmock-generated-actions.h b/include/gmock/gmock-generated-actions.h index 3b599b36..2327393d 100644 --- a/include/gmock/gmock-generated-actions.h +++ b/include/gmock/gmock-generated-actions.h @@ -2216,9 +2216,6 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, p9##_type>::gmock_Impl::gmock_PerformImpl(\ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const -// TODO(wan@google.com): move the following to a different .h file -// such that we don't have to run 'pump' every time the code is -// updated. namespace testing { // The ACTION*() macros trigger warning C4100 (unreferenced formal diff --git a/include/gmock/gmock-generated-actions.h.pump b/include/gmock/gmock-generated-actions.h.pump index 57a7811a..8e2b5735 100644 --- a/include/gmock/gmock-generated-actions.h.pump +++ b/include/gmock/gmock-generated-actions.h.pump @@ -739,9 +739,6 @@ $$ } // This meta comment fixes auto-indentation in Emacs. It won't $$ // show up in the generated code. -// TODO(wan@google.com): move the following to a different .h file -// such that we don't have to run 'pump' every time the code is -// updated. namespace testing { // The ACTION*() macros trigger warning C4100 (unreferenced formal diff --git a/include/gmock/gmock-spec-builders.h b/include/gmock/gmock-spec-builders.h index 30721ce6..c677333c 100644 --- a/include/gmock/gmock-spec-builders.h +++ b/include/gmock/gmock-spec-builders.h @@ -353,12 +353,11 @@ class OnCallSpec : public UntypedOnCallSpecBase { Action action_; }; // class OnCallSpec -// Possible reactions on uninteresting calls. TODO(wan@google.com): -// rename the enum values to the kFoo style. +// Possible reactions on uninteresting calls. enum CallReaction { - ALLOW, - WARN, - FAIL + kAllow, + kWarn, + kFail }; } // namespace internal @@ -422,7 +421,7 @@ class GTEST_API_ Mock { // Returns the reaction Google Mock will have on uninteresting calls // made on the given mock object. static internal::CallReaction GetReactionOnUninterestingCalls( - const void* mock_obj); + const void* mock_obj) GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); // Verifies that all expectations on the given mock object have been @@ -1163,7 +1162,7 @@ class TypedExpectation : public ExpectationBase { << action_count << " WillOnce()" << (action_count == 1 ? " is" : "s are") << " specified - "; mocker->DescribeDefaultActionTo(args, &ss); - Log(WARNING, ss.str(), 1); + Log(kWarning, ss.str(), 1); } return count <= action_count ? @@ -1251,7 +1250,7 @@ class MockSpec { // the newly created spec. internal::OnCallSpec& InternalDefaultActionSetAt( const char* file, int line, const char* obj, const char* call) { - LogWithLocation(internal::INFO, file, line, + LogWithLocation(internal::kInfo, file, line, string("ON_CALL(") + obj + ", " + call + ") invoked"); return function_mocker_->AddNewOnCallSpec(file, line, matchers_); } @@ -1261,7 +1260,7 @@ class MockSpec { internal::TypedExpectation& InternalExpectedAt( const char* file, int line, const char* obj, const char* call) { const string source_text(string("EXPECT_CALL(") + obj + ", " + call + ")"); - LogWithLocation(internal::INFO, file, line, source_text + " invoked"); + LogWithLocation(internal::kInfo, file, line, source_text + " invoked"); return function_mocker_->AddNewExpectation( file, line, source_text, matchers_); } diff --git a/include/gmock/internal/gmock-internal-utils.h b/include/gmock/internal/gmock-internal-utils.h index aef9388e..6b6de970 100644 --- a/include/gmock/internal/gmock-internal-utils.h +++ b/include/gmock/internal/gmock-internal-utils.h @@ -260,7 +260,7 @@ class FailureReporterInterface { public: // The type of a failure (either non-fatal or fatal). enum FailureType { - NONFATAL, FATAL + kNonfatal, kFatal }; virtual ~FailureReporterInterface() {} @@ -281,7 +281,7 @@ GTEST_API_ FailureReporterInterface* GetFailureReporter(); inline void Assert(bool condition, const char* file, int line, const string& msg) { if (!condition) { - GetFailureReporter()->ReportFailure(FailureReporterInterface::FATAL, + GetFailureReporter()->ReportFailure(FailureReporterInterface::kFatal, file, line, msg); } } @@ -294,7 +294,7 @@ inline void Assert(bool condition, const char* file, int line) { inline void Expect(bool condition, const char* file, int line, const string& msg) { if (!condition) { - GetFailureReporter()->ReportFailure(FailureReporterInterface::NONFATAL, + GetFailureReporter()->ReportFailure(FailureReporterInterface::kNonfatal, file, line, msg); } } @@ -304,8 +304,8 @@ inline void Expect(bool condition, const char* file, int line) { // Severity level of a log. enum LogSeverity { - INFO = 0, - WARNING = 1 + kInfo = 0, + kWarning = 1 }; // Valid values for the --gmock_verbose flag. -- cgit v1.2.3