From a1a98f840e25692ddcb0ca872aaf8362a2b4e088 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Fri, 1 Mar 2013 21:28:40 +0000 Subject: [PATCH] Adds a cmake target for gmock_ex_test; also fixes name shadowing warnings. --- CMakeLists.txt | 1 + test/gmock-actions_test.cc | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ded9ca9d..572d0444 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,7 @@ if (gmock_build_tests) cxx_test(gmock-actions_test gmock_main) cxx_test(gmock-cardinalities_test gmock_main) + cxx_test(gmock_ex_test gmock_main) cxx_test(gmock-generated-actions_test gmock_main) cxx_test(gmock-generated-function-mockers_test gmock_main) cxx_test(gmock-generated-internal-utils_test gmock_main) diff --git a/test/gmock-actions_test.cc b/test/gmock-actions_test.cc index 68bdadee..8cd77e20 100644 --- a/test/gmock-actions_test.cc +++ b/test/gmock-actions_test.cc @@ -323,9 +323,9 @@ TEST(DefaultValueOfReferenceDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) { // Tests that ActionInterface can be implemented by defining the // Perform method. -typedef int MyFunction(bool, int); +typedef int MyGlobalFunction(bool, int); -class MyActionImpl : public ActionInterface { +class MyActionImpl : public ActionInterface { public: virtual int Perform(const tuple& args) { return get<0>(args) ? get<1>(args) : 0; @@ -338,7 +338,7 @@ TEST(ActionInterfaceTest, CanBeImplementedByDefiningPerform) { } TEST(ActionInterfaceTest, MakeAction) { - Action action = MakeAction(new MyActionImpl); + Action action = MakeAction(new MyActionImpl); // When exercising the Perform() method of Action, we must pass // it a tuple whose size and type are compatible with F's argument @@ -351,12 +351,12 @@ TEST(ActionInterfaceTest, MakeAction) { // Tests that Action can be contructed from a pointer to // ActionInterface. TEST(ActionTest, CanBeConstructedFromActionInterface) { - Action action(new MyActionImpl); + Action action(new MyActionImpl); } // Tests that Action delegates actual work to ActionInterface. TEST(ActionTest, DelegatesWorkToActionInterface) { - const Action action(new MyActionImpl); + const Action action(new MyActionImpl); EXPECT_EQ(5, action.Perform(make_tuple(true, 5))); EXPECT_EQ(0, action.Perform(make_tuple(false, 1))); @@ -364,8 +364,8 @@ TEST(ActionTest, DelegatesWorkToActionInterface) { // Tests that Action can be copied. TEST(ActionTest, IsCopyable) { - Action a1(new MyActionImpl); - Action a2(a1); // Tests the copy constructor. + Action a1(new MyActionImpl); + Action a2(a1); // Tests the copy constructor. // a1 should continue to work after being copied from. EXPECT_EQ(5, a1.Perform(make_tuple(true, 5)));