Commit 6cea87d5 by Christian Kern

fix cpplint warnings

parent 68d10aa4
...@@ -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)]);
} }
} }
......
...@@ -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);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment