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
6cea87d5
authored
May 27, 2015
by
Christian Kern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix cpplint warnings
parent
68d10aa4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
mtapi_c/test/embb_mtapi_test_id_pool.cc
+4
-3
mtapi_c/test/embb_mtapi_test_id_pool.h
+2
-3
No files found.
mtapi_c/test/embb_mtapi_test_id_pool.cc
View file @
6cea87d5
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
*/
*/
#include <embb_mtapi_test_id_pool.h>
#include <embb_mtapi_test_id_pool.h>
#include <vector>
IdPoolTest
::
IdPoolTest
()
{
IdPoolTest
::
IdPoolTest
()
{
CreateUnit
(
"mtapi id pool test single threaded"
).
CreateUnit
(
"mtapi id pool test single threaded"
).
...
@@ -58,7 +59,7 @@ void IdPoolTest::TestParallelPost() {
...
@@ -58,7 +59,7 @@ void IdPoolTest::TestParallelPost() {
// elements sequentially.
// elements sequentially.
TestAllocateDeallocateNElementsFromPool
(
id_pool_parallel
,
TestAllocateDeallocateNElementsFromPool
(
id_pool_parallel
,
concurrent_accessors_id_pool_2
*
id_elements_per_accessor
,
true
);
concurrent_accessors_id_pool_2
*
id_elements_per_accessor
,
true
);
// finalize pool
// finalize pool
embb_mtapi_id_pool_finalize
(
&
id_pool_parallel
);
embb_mtapi_id_pool_finalize
(
&
id_pool_parallel
);
}
}
...
@@ -79,7 +80,7 @@ void IdPoolTest::TestBasicPost() {
...
@@ -79,7 +80,7 @@ void IdPoolTest::TestBasicPost() {
void
IdPoolTest
::
TestAllocateDeallocateNElementsFromPool
(
void
IdPoolTest
::
TestAllocateDeallocateNElementsFromPool
(
embb_mtapi_id_pool_t
&
pool
,
embb_mtapi_id_pool_t
&
pool
,
int
count_elements
,
int
count_elements
,
bool
empty_check
)
{
bool
empty_check
)
{
std
::
vector
<
unsigned
int
>
allocated
;
std
::
vector
<
unsigned
int
>
allocated
;
...
@@ -112,7 +113,7 @@ void IdPoolTest::TestAllocateDeallocateNElementsFromPool(
...
@@ -112,7 +113,7 @@ void IdPoolTest::TestAllocateDeallocateNElementsFromPool(
::
std
::
random_shuffle
(
allocated
.
begin
(),
allocated
.
end
());
::
std
::
random_shuffle
(
allocated
.
begin
(),
allocated
.
end
());
for
(
int
i
=
0
;
i
!=
count_elements
;
++
i
)
{
for
(
int
i
=
0
;
i
!=
count_elements
;
++
i
)
{
embb_mtapi_id_pool_deallocate
(
&
pool
,
embb_mtapi_id_pool_deallocate
(
&
pool
,
allocated
[
static_cast
<
unsigned
int
>
(
i
)]);
allocated
[
static_cast
<
unsigned
int
>
(
i
)]);
}
}
}
}
...
...
mtapi_c/test/embb_mtapi_test_id_pool.h
View file @
6cea87d5
...
@@ -41,11 +41,10 @@ class IdPoolTest : public partest::TestCase {
...
@@ -41,11 +41,10 @@ class IdPoolTest : public partest::TestCase {
IdPoolTest
();
IdPoolTest
();
private
:
private
:
static
const
unsigned
int
id_pool_size_1
=
100
;
static
const
unsigned
int
id_pool_size_1
=
100
;
static
const
unsigned
int
concurrent_accessors_id_pool_2
=
10
;
static
const
unsigned
int
concurrent_accessors_id_pool_2
=
10
;
static
const
unsigned
int
id_elements_per_accessor
=
10
;
static
const
unsigned
int
id_elements_per_accessor
=
10
;
/**
/**
* We create a pool of size number_accessors*elements_per_accessor, so
* We create a pool of size number_accessors*elements_per_accessor, so
* at each time we can guarantee each thread to be able to allocate
* at each time we can guarantee each thread to be able to allocate
...
@@ -72,7 +71,7 @@ class IdPoolTest : public partest::TestCase {
...
@@ -72,7 +71,7 @@ class IdPoolTest : public partest::TestCase {
static
void
TestAllocateDeallocateNElementsFromPool
(
static
void
TestAllocateDeallocateNElementsFromPool
(
embb_mtapi_id_pool_t
&
pool
,
embb_mtapi_id_pool_t
&
pool
,
int
count_elements
,
int
count_elements
,
bool
empty_check
=
false
);
bool
empty_check
=
false
);
};
};
...
...
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