Pulls in gtest r615.

Renames internal enums to the kFoo naming style.

Fixes gmock doctor to work with newer versions of Clang.
This commit is contained in:
zhanyong.wan
2012-05-31 20:40:56 +00:00
parent 79a367eb21
commit 2fd619edd3
8 changed files with 61 additions and 57 deletions

View File

@@ -2216,9 +2216,6 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
p9##_type>::gmock_Impl<F>::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

View File

@@ -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

View File

@@ -353,12 +353,11 @@ class OnCallSpec : public UntypedOnCallSpecBase {
Action<F> 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<F>& 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<F>& 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_);
}

View File

@@ -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.