Advanced Chunk Processing Library 0.2.0
A comprehensive C++ library for advanced data chunking strategies and processing operations
Loading...
Searching...
No Matches
ParallelChunkProcessorTest Class Reference
+ Inheritance diagram for ParallelChunkProcessorTest:
+ Collaboration diagram for ParallelChunkProcessorTest:

Protected Member Functions

template<typename T >
bool is_valid_resource (const T &resource)
 
template<typename T >
void safe_cleanup (T &resource)
 
void SetUp () override
 
void TearDown () override
 

Protected Attributes

std::vector< std::vector< int > > chunks
 
std::vector< int > test_data
 

Static Protected Attributes

static std::mutex global_test_mutex_
 
static constexpr auto TEST_COOLDOWN = std::chrono::milliseconds(100)
 
static std::condition_variable test_cv_
 
static bool test_running_ = false
 

Detailed Description

Definition at line 8 of file parallel_chunk_test.cpp.

Member Function Documentation

◆ is_valid_resource()

template<typename T >
bool ChunkTestBase::is_valid_resource ( const T &  resource)
inlineprotectedinherited

Definition at line 33 of file test_base.hpp.

33 {
34 return resource != nullptr;
35 }

◆ safe_cleanup()

template<typename T >
void ChunkTestBase::safe_cleanup ( T &  resource)
inlineprotectedinherited

Definition at line 21 of file test_base.hpp.

21 {
22 try {
23 if (resource) {
24 resource.reset();
25 }
26 } catch (...) {
27 // Log or handle cleanup errors
28 }
29 }

◆ SetUp()

void ParallelChunkProcessorTest::SetUp ( )
inlineoverrideprotected

Definition at line 13 of file parallel_chunk_test.cpp.

13 {
15
16 try {
17 test_data = {1, 2, 3, 4, 5, 6, 7, 8, 9};
18 chunks = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
19 } catch (const std::exception& e) {
20 FAIL() << "Setup failed: " << e.what();
21 }
22 }
void SetUp() override
Definition test_base.cpp:8
std::vector< std::vector< int > > chunks

References chunks, ChunkTestBase::SetUp(), and test_data.

◆ TearDown()

void ParallelChunkProcessorTest::TearDown ( )
inlineoverrideprotected

Definition at line 24 of file parallel_chunk_test.cpp.

24 {
25 try {
26 test_data.clear();
27 chunks.clear();
28 } catch (...) {
29 // Ensure base teardown still happens
30 }
32 }
void TearDown() override
Definition test_base.cpp:15

References chunks, ChunkTestBase::TearDown(), and test_data.

Member Data Documentation

◆ chunks

std::vector<std::vector<int> > ParallelChunkProcessorTest::chunks
protected

Definition at line 11 of file parallel_chunk_test.cpp.

Referenced by SetUp(), and TearDown().

◆ global_test_mutex_

std::mutex ChunkTestBase::global_test_mutex_
staticprotectedinherited

Definition at line 11 of file test_base.hpp.

Referenced by ChunkTestBase::SetUp(), and ChunkTestBase::TearDown().

◆ TEST_COOLDOWN

constexpr auto ChunkTestBase::TEST_COOLDOWN = std::chrono::milliseconds(100)
staticconstexprprotectedinherited

Definition at line 14 of file test_base.hpp.

Referenced by ChunkTestBase::TearDown().

◆ test_cv_

std::condition_variable ChunkTestBase::test_cv_
staticprotectedinherited

Definition at line 12 of file test_base.hpp.

Referenced by ChunkTestBase::SetUp(), and ChunkTestBase::TearDown().

◆ test_data

std::vector<int> ParallelChunkProcessorTest::test_data
protected

Definition at line 10 of file parallel_chunk_test.cpp.

Referenced by SetUp(), and TearDown().

◆ test_running_

bool ChunkTestBase::test_running_ = false
staticprotectedinherited

Definition at line 13 of file test_base.hpp.

Referenced by ChunkTestBase::SetUp(), and ChunkTestBase::TearDown().


The documentation for this class was generated from the following file: