Advanced Chunk Processing Library 0.2.0
A comprehensive C++ library for advanced data chunking strategies and processing operations
Loading...
Searching...
No Matches
test_base.cpp
Go to the documentation of this file.
1#include "test_base.hpp"
2
3// Define static members
5std::condition_variable ChunkTestBase::test_cv_;
7
9 std::unique_lock<std::mutex> lock(global_test_mutex_);
10 // Wait until no other test is running
11 test_cv_.wait(lock, [] { return !test_running_; });
12 test_running_ = true;
13}
14
16 {
17 std::lock_guard<std::mutex> lock(global_test_mutex_);
18 test_running_ = false;
19 }
20 // Notify next test can run
21 test_cv_.notify_one();
22 // Add cooldown period between tests
23 std::this_thread::sleep_for(TEST_COOLDOWN);
24}
static constexpr auto TEST_COOLDOWN
Definition test_base.hpp:14
void SetUp() override
Definition test_base.cpp:8
static bool test_running_
Definition test_base.hpp:13
void TearDown() override
Definition test_base.cpp:15
static std::mutex global_test_mutex_
Definition test_base.hpp:11
static std::condition_variable test_cv_
Definition test_base.hpp:12