Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9c5df58a
authored
Jan 19, 2015
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
algorithms_cpp: removed cppcheck warnings
parent
a38149f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
algorithms_cpp/test/scan_test.cc
+0
-4
algorithms_cpp/test/zip_iterator_test.cc
+6
-6
No files found.
algorithms_cpp/test/scan_test.cc
View file @
9c5df58a
...
...
@@ -115,13 +115,9 @@ void ScanTest::TestFunctionPointers() {
std
::
vector
<
int
>
vector
(
kCountSize
);
std
::
vector
<
int
>
init
(
kCountSize
);
std
::
vector
<
int
>
outputVector
(
kCountSize
);
int
sum
=
0
;
int
sqr_sum
=
0
;
for
(
size_t
i
=
0
;
i
<
kCountSize
;
i
++
)
{
vector
[
i
]
=
static_cast
<
int
>
(
i
+
2
);
init
[
i
]
=
0
;
sum
+=
static_cast
<
int
>
(
i
+
2
);
sqr_sum
+=
static_cast
<
int
>
((
i
+
2
)
*
(
i
+
2
));
}
Scan
(
vector
.
begin
(),
vector
.
end
(),
outputVector
.
begin
(),
0
,
&
AddFunction
);
...
...
algorithms_cpp/test/zip_iterator_test.cc
View file @
9c5df58a
...
...
@@ -110,14 +110,14 @@ void ZipIteratorTest::TestZipReduce() {
sum
+=
static_cast
<
long
>
((
i
+
2
)
*
(
i
+
2
));
}
std
::
vector
<
int
>::
const_iterator
iterA
;
std
::
vector
<
int
>::
const_iterator
iterB
;
embb
::
algorithms
::
ZipIterator
<
constVectorIterator
,
constVectorIterator
>
start_iterator
=
embb
::
algorithms
::
Zip
(
iterA
=
vectorA
.
begin
(),
iterB
=
vectorB
.
begin
());
start_iterator
=
embb
::
algorithms
::
Zip
(
std
::
vector
<
int
>::
const_iterator
(
vectorA
.
begin
()),
std
::
vector
<
int
>::
const_iterator
(
vectorB
.
begin
()));
embb
::
algorithms
::
ZipIterator
<
constVectorIterator
,
constVectorIterator
>
end_iterator
=
embb
::
algorithms
::
Zip
(
iterA
=
vectorA
.
end
(),
iterB
=
vectorB
.
end
());
end_iterator
=
embb
::
algorithms
::
Zip
(
std
::
vector
<
int
>::
const_iterator
(
vectorA
.
end
()),
std
::
vector
<
int
>::
const_iterator
(
vectorB
.
end
()));
PT_EXPECT_EQ
(
embb
::
algorithms
::
Reduce
(
start_iterator
,
end_iterator
,
0
,
std
::
plus
<
int
>
(),
DotProductFunctor
()),
sum
);
...
...
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