mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-30 00:25:52 +00:00
@@ -39,10 +39,6 @@ using testing::MockFunction;
|
||||
using testing::StrictMock;
|
||||
|
||||
struct SignalsHandlerTestsBase : NoLoggerFixture {
|
||||
StrictMock<MockFunction<void()>> forceExitHandler_;
|
||||
StrictMock<MockFunction<void()>> stopHandler_;
|
||||
StrictMock<MockFunction<void()>> anotherStopHandler_;
|
||||
|
||||
void
|
||||
allowTestToFinish()
|
||||
{
|
||||
@@ -58,6 +54,11 @@ struct SignalsHandlerTestsBase : NoLoggerFixture {
|
||||
cv_.wait(lock, [this] { return testCanBeFinished_; });
|
||||
}
|
||||
|
||||
protected:
|
||||
StrictMock<MockFunction<void()>> forceExitHandler_;
|
||||
StrictMock<MockFunction<void()>> stopHandler_;
|
||||
StrictMock<MockFunction<void()>> anotherStopHandler_;
|
||||
|
||||
std::mutex mutex_;
|
||||
std::condition_variable cv_;
|
||||
bool testCanBeFinished_{false};
|
||||
@@ -75,6 +76,7 @@ TEST(SignalsHandlerDeathTest, CantCreateTwoSignalsHandlers)
|
||||
}
|
||||
|
||||
struct SignalsHandlerTests : SignalsHandlerTestsBase {
|
||||
protected:
|
||||
SignalsHandler handler_{
|
||||
ClioConfigDefinition{{"graceful_period", ConfigValue{ConfigType::Double}.defaultValue(3.0)}},
|
||||
forceExitHandler_.AsStdFunction()
|
||||
@@ -99,6 +101,7 @@ TEST_F(SignalsHandlerTests, OneSignal)
|
||||
}
|
||||
|
||||
struct SignalsHandlerTimeoutTests : SignalsHandlerTestsBase {
|
||||
protected:
|
||||
SignalsHandler handler_{
|
||||
ClioConfigDefinition{{"graceful_period", ConfigValue{ConfigType::Double}.defaultValue(0.001)}},
|
||||
forceExitHandler_.AsStdFunction()
|
||||
|
||||
Reference in New Issue
Block a user