summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2013-03-01 06:53:35 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2013-03-01 06:53:35 +0000
commite6c09e80a3dd48f2ee02048a2856c7d6ede6a586 (patch)
treed4a6bb89f5f680b6c0ec628211ad39dfc6c7d7e6 /test
parent5027aba7ae61fb8f64c6febfe9c54966129b731b (diff)
downloadgooglemock-e6c09e80a3dd48f2ee02048a2856c7d6ede6a586.tar.gz
Removes unused variables and functions.
git-svn-id: http://googlemock.googlecode.com/svn/trunk@420 8415998a-534a-0410-bf83-d39667b30386
Diffstat (limited to 'test')
-rw-r--r--test/gmock-actions_test.cc58
-rw-r--r--test/gmock-generated-actions_test.cc13
-rw-r--r--test/gmock-generated-matchers_test.cc13
3 files changed, 27 insertions, 57 deletions
diff --git a/test/gmock-actions_test.cc b/test/gmock-actions_test.cc
index 1210d46..68bdade 100644
--- a/test/gmock-actions_test.cc
+++ b/test/gmock-actions_test.cc
@@ -1031,68 +1031,12 @@ class VoidNullaryFunctor {
void operator()() { g_done = true; }
};
-bool Unary(int x) { return x < 0; }
-
-const char* Plus1(const char* s) { return s + 1; }
-
-void VoidUnary(int /* n */) { g_done = true; }
-
-bool ByConstRef(const std::string& s) { return s == "Hi"; }
-
-const double g_double = 0;
-bool ReferencesGlobalDouble(const double& x) { return &x == &g_double; }
-
-std::string ByNonConstRef(std::string& s) { return s += "+"; } // NOLINT
-
-struct UnaryFunctor {
- int operator()(bool x) { return x ? 1 : -1; }
-};
-
-const char* Binary(const char* input, short n) { return input + n; } // NOLINT
-
-void VoidBinary(int, char) { g_done = true; }
-
-int Ternary(int x, char y, short z) { return x + y + z; } // NOLINT
-
-void VoidTernary(int, char, bool) { g_done = true; }
-
-int SumOf4(int a, int b, int c, int d) { return a + b + c + d; }
-
-void VoidFunctionWithFourArguments(char, int, float, double) { g_done = true; }
-
-int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
-
-struct SumOf5Functor {
- int operator()(int a, int b, int c, int d, int e) {
- return a + b + c + d + e;
- }
-};
-
-int SumOf6(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
-}
-
-struct SumOf6Functor {
- int operator()(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
- }
-};
-
class Foo {
public:
Foo() : value_(123) {}
int Nullary() const { return value_; }
- short Unary(long x) { return static_cast<short>(value_ + x); } // NOLINT
- std::string Binary(const std::string& str, char c) const { return str + c; }
- int Ternary(int x, bool y, char z) { return value_ + x + y*z; }
- int SumOf4(int a, int b, int c, int d) const {
- return a + b + c + d + value_;
- }
- int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
- int SumOf6(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
- }
+
private:
int value_;
};
diff --git a/test/gmock-generated-actions_test.cc b/test/gmock-generated-actions_test.cc
index 436f1a2..23f8c8b 100644
--- a/test/gmock-generated-actions_test.cc
+++ b/test/gmock-generated-actions_test.cc
@@ -956,6 +956,19 @@ TEST(ActionPnMacroTest, TypesAreCorrect) {
Plus(1, 2, 3, 4, 5, 6, 7, 8, '9');
PlusActionP10<int, int, int, int, int, int, int, int, int, char> a10 =
Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, '0');
+
+ // Avoid "unused variable" warnings.
+ (void)a0;
+ (void)a1;
+ (void)a2;
+ (void)a3;
+ (void)a4;
+ (void)a5;
+ (void)a6;
+ (void)a7;
+ (void)a8;
+ (void)a9;
+ (void)a10;
}
// Tests that an ACTION_P*() action can be explicitly instantiated
diff --git a/test/gmock-generated-matchers_test.cc b/test/gmock-generated-matchers_test.cc
index 4b7e6e0..0a750de 100644
--- a/test/gmock-generated-matchers_test.cc
+++ b/test/gmock-generated-matchers_test.cc
@@ -1039,6 +1039,19 @@ TEST(MatcherPnMacroTest, TypesAreCorrect) {
EqualsSumOf(1, 2, 3, 4, 5, 6, 7, 8, '9');
EqualsSumOfMatcherP10<int, int, int, int, int, int, int, int, int, char> a10 =
EqualsSumOf(1, 2, 3, 4, 5, 6, 7, 8, 9, '0');
+
+ // Avoid "unused variable" warnings.
+ (void)a0;
+ (void)a1;
+ (void)a2;
+ (void)a3;
+ (void)a4;
+ (void)a5;
+ (void)a6;
+ (void)a7;
+ (void)a8;
+ (void)a9;
+ (void)a10;
}
// Tests that matcher-typed parameters can be used in Value() inside a