Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
08d76be4
Commit
08d76be4
authored
May 22, 2016
by
Tobias Markus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance fixes reported by cppcheck
parent
0a439623
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
gtest-param-test_test.cc
googletest/test/gtest-param-test_test.cc
+4
-4
gtest_unittest.cc
googletest/test/gtest_unittest.cc
+1
-2
No files found.
googletest/test/gtest-param-test_test.cc
View file @
08d76be4
...
@@ -141,7 +141,7 @@ void VerifyGenerator(const ParamGenerator<T>& generator,
...
@@ -141,7 +141,7 @@ void VerifyGenerator(const ParamGenerator<T>& generator,
<<
", expected_values[i] is "
<<
PrintValue
(
expected_values
[
i
])
<<
", expected_values[i] is "
<<
PrintValue
(
expected_values
[
i
])
<<
", *it is "
<<
PrintValue
(
*
it
)
<<
", *it is "
<<
PrintValue
(
*
it
)
<<
", and 'it' is an iterator created with the copy constructor.
\n
"
;
<<
", and 'it' is an iterator created with the copy constructor.
\n
"
;
it
++
;
++
it
;
}
}
EXPECT_TRUE
(
it
==
generator
.
end
())
EXPECT_TRUE
(
it
==
generator
.
end
())
<<
"At the presumed end of sequence when accessing via an iterator "
<<
"At the presumed end of sequence when accessing via an iterator "
...
@@ -161,7 +161,7 @@ void VerifyGenerator(const ParamGenerator<T>& generator,
...
@@ -161,7 +161,7 @@ void VerifyGenerator(const ParamGenerator<T>& generator,
<<
", expected_values[i] is "
<<
PrintValue
(
expected_values
[
i
])
<<
", expected_values[i] is "
<<
PrintValue
(
expected_values
[
i
])
<<
", *it is "
<<
PrintValue
(
*
it
)
<<
", *it is "
<<
PrintValue
(
*
it
)
<<
", and 'it' is an iterator created with the copy constructor.
\n
"
;
<<
", and 'it' is an iterator created with the copy constructor.
\n
"
;
it
++
;
++
it
;
}
}
EXPECT_TRUE
(
it
==
generator
.
end
())
EXPECT_TRUE
(
it
==
generator
.
end
())
<<
"At the presumed end of sequence when accessing via an iterator "
<<
"At the presumed end of sequence when accessing via an iterator "
...
@@ -196,7 +196,7 @@ TEST(IteratorTest, ParamIteratorConformsToForwardIteratorConcept) {
...
@@ -196,7 +196,7 @@ TEST(IteratorTest, ParamIteratorConformsToForwardIteratorConcept) {
<<
"element same as its source points to"
;
<<
"element same as its source points to"
;
// Verifies that iterator assignment works as expected.
// Verifies that iterator assignment works as expected.
it
++
;
++
it
;
EXPECT_FALSE
(
*
it
==
*
it2
);
EXPECT_FALSE
(
*
it
==
*
it2
);
it2
=
it
;
it2
=
it
;
EXPECT_TRUE
(
*
it
==
*
it2
)
<<
"Assigned iterators must point to the "
EXPECT_TRUE
(
*
it
==
*
it2
)
<<
"Assigned iterators must point to the "
...
@@ -215,7 +215,7 @@ TEST(IteratorTest, ParamIteratorConformsToForwardIteratorConcept) {
...
@@ -215,7 +215,7 @@ TEST(IteratorTest, ParamIteratorConformsToForwardIteratorConcept) {
// Verifies that prefix and postfix operator++() advance an iterator
// Verifies that prefix and postfix operator++() advance an iterator
// all the same.
// all the same.
it2
=
it
;
it2
=
it
;
it
++
;
++
it
;
++
it2
;
++
it2
;
EXPECT_TRUE
(
*
it
==
*
it2
);
EXPECT_TRUE
(
*
it
==
*
it2
);
}
}
...
...
googletest/test/gtest_unittest.cc
View file @
08d76be4
...
@@ -7655,7 +7655,7 @@ TEST(NativeArrayTest, MethodsWork) {
...
@@ -7655,7 +7655,7 @@ TEST(NativeArrayTest, MethodsWork) {
EXPECT_EQ
(
0
,
*
it
);
EXPECT_EQ
(
0
,
*
it
);
++
it
;
++
it
;
EXPECT_EQ
(
1
,
*
it
);
EXPECT_EQ
(
1
,
*
it
);
it
++
;
++
it
;
EXPECT_EQ
(
2
,
*
it
);
EXPECT_EQ
(
2
,
*
it
);
++
it
;
++
it
;
EXPECT_EQ
(
na
.
end
(),
it
);
EXPECT_EQ
(
na
.
end
(),
it
);
...
@@ -7703,4 +7703,3 @@ TEST(SkipPrefixTest, DoesNotSkipWhenPrefixDoesNotMatch) {
...
@@ -7703,4 +7703,3 @@ TEST(SkipPrefixTest, DoesNotSkipWhenPrefixDoesNotMatch) {
EXPECT_FALSE
(
SkipPrefix
(
"world!"
,
&
p
));
EXPECT_FALSE
(
SkipPrefix
(
"world!"
,
&
p
));
EXPECT_EQ
(
str
,
p
);
EXPECT_EQ
(
str
,
p
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment