aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markus <tobbi.bugs@googlemail.com>2016-05-22 18:35:47 +0200
committerTobias Markus <tobbi.bugs@googlemail.com>2016-05-22 18:35:52 +0200
commit08d76be4cc597863f6e6b43accbf299d0055ac54 (patch)
treee69d9c14e6882567742e26928220d9373f2b0483
parent0a439623f75c029912728d80cb7f1b8b48739ca4 (diff)
downloadgoogletest-08d76be4cc597863f6e6b43accbf299d0055ac54.tar.gz
googletest-08d76be4cc597863f6e6b43accbf299d0055ac54.tar.bz2
googletest-08d76be4cc597863f6e6b43accbf299d0055ac54.zip
Performance fixes reported by cppcheck
-rw-r--r--googletest/test/gtest-param-test_test.cc8
-rw-r--r--googletest/test/gtest_unittest.cc3
2 files changed, 5 insertions, 6 deletions
diff --git a/googletest/test/gtest-param-test_test.cc b/googletest/test/gtest-param-test_test.cc
index 8b278bb9..857f6c5e 100644
--- a/googletest/test/gtest-param-test_test.cc
+++ b/googletest/test/gtest-param-test_test.cc
@@ -141,7 +141,7 @@ void VerifyGenerator(const ParamGenerator<T>& generator,
<< ", expected_values[i] is " << PrintValue(expected_values[i])
<< ", *it is " << PrintValue(*it)
<< ", and 'it' is an iterator created with the copy constructor.\n";
- it++;
+ ++it;
}
EXPECT_TRUE(it == generator.end())
<< "At the presumed end of sequence when accessing via an iterator "
@@ -161,7 +161,7 @@ void VerifyGenerator(const ParamGenerator<T>& generator,
<< ", expected_values[i] is " << PrintValue(expected_values[i])
<< ", *it is " << PrintValue(*it)
<< ", and 'it' is an iterator created with the copy constructor.\n";
- it++;
+ ++it;
}
EXPECT_TRUE(it == generator.end())
<< "At the presumed end of sequence when accessing via an iterator "
@@ -196,7 +196,7 @@ TEST(IteratorTest, ParamIteratorConformsToForwardIteratorConcept) {
<< "element same as its source points to";
// Verifies that iterator assignment works as expected.
- it++;
+ ++it;
EXPECT_FALSE(*it == *it2);
it2 = it;
EXPECT_TRUE(*it == *it2) << "Assigned iterators must point to the "
@@ -215,7 +215,7 @@ TEST(IteratorTest, ParamIteratorConformsToForwardIteratorConcept) {
// Verifies that prefix and postfix operator++() advance an iterator
// all the same.
it2 = it;
- it++;
+ ++it;
++it2;
EXPECT_TRUE(*it == *it2);
}
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index 88e94134..78257fb9 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -7655,7 +7655,7 @@ TEST(NativeArrayTest, MethodsWork) {
EXPECT_EQ(0, *it);
++it;
EXPECT_EQ(1, *it);
- it++;
+ ++it;
EXPECT_EQ(2, *it);
++it;
EXPECT_EQ(na.end(), it);
@@ -7703,4 +7703,3 @@ TEST(SkipPrefixTest, DoesNotSkipWhenPrefixDoesNotMatch) {
EXPECT_FALSE(SkipPrefix("world!", &p));
EXPECT_EQ(str, p);
}
-