Skip to content

Commit d672039

Browse files
committed
Introduce UnitTestCRP to unconditionally allow processing CheckResults in tests
1 parent 61d98ad commit d672039

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

lib/remote/crproducer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
using namespace icinga;
66

7+
bool UnitTestCRP::try_lock_shared() noexcept
8+
{
9+
return true;
10+
}
11+
12+
void UnitTestCRP::unlock_shared() noexcept
13+
{
14+
}
15+
716
bool CheckResultProducerComponent::try_lock_shared() noexcept
817
{
918
std::unique_lock lock (m_Mutex);

lib/remote/crproducer.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ class CheckResultProducer : virtual public Object
3434
virtual void unlock_shared() noexcept = 0;
3535
};
3636

37+
class UnitTestCRP : public CheckResultProducer
38+
{
39+
public:
40+
bool try_lock_shared() noexcept override;
41+
void unlock_shared() noexcept override;
42+
};
43+
3744
class CheckResultProducerComponent : public CheckResultProducer
3845
{
3946
public:

0 commit comments

Comments
 (0)