10 #include <gtest/gtest.h>
11 #include <log4cplus/logger.h>
21 using namespace ::testing;
22 using namespace std::chrono_literals;
32 m_status = std::make_shared<ObservableStatus>(
"id",
"fileid");
33 m_logger= log4cplus::Logger::getInstance(
"test");
38 std::shared_ptr<daq::ObservableStatus>
m_status;
47 ASSERT_TRUE(fut.is_ready());
48 auto result = fut.get();
49 EXPECT_FALSE(result.error);
57 auto [fut, abort] = op::InitiateAbortableOperation<op::AwaitStateAsync>(
61 EXPECT_FALSE(fut.is_ready());
63 EXPECT_FALSE(fut.is_ready());
67 ASSERT_TRUE(fut.is_ready());
69 auto result = fut.get();
70 EXPECT_FALSE(result.error);
78 auto [fut, abort] = op::InitiateAbortableOperation<op::AwaitStateAsync>(
83 ASSERT_TRUE(fut.is_ready());
85 auto result = fut.get();
86 EXPECT_TRUE(result.error);
94 auto [fut, abort] = op::InitiateAbortableOperation<op::AwaitStateAsync>(
99 ASSERT_TRUE(fut.is_ready());
108 auto [fut, abort] = op::InitiateAbortableOperation<op::AwaitStateAsync>(
113 auto& mut_status =
const_cast<Status&
>(m_status->GetStatus());
117 ASSERT_TRUE(fut.is_ready());
119 auto result = fut.get();
120 EXPECT_FALSE(result.error);
Contains declaration for the AwaitStateAsync operation.
Started operation was aborted.
Contains error related declarations for DAQ.
log4cplus::Logger m_logger
boost::asio::io_context m_io_ctx
std::shared_ptr< daq::ObservableStatus > m_status
TestAsyncOpAwaitState()=default
void MakeTestProgress(boost::asio::io_context &io_ctx, Future *fut=nullptr)
Test helper that progress the test by executing pending jobs and optionally wait for a future to be r...
Contains declarations for the helper functions to initiate operations.
TEST_F(TestDpmDaqController, StatusUpdateInNotScheduledSucceeds)
@ Acquiring
All data sources have reported data acquisition is in progress.
@ NotStarted
Initial state of data acquisition.
Non observable status object that keeps stores status of data acquisition.
Async operation to await Data Acquisition state.
boost::future< ResultType > Initiate()
Initiates operation that await state.
EXPECT_EQ(meta.rr_uri, "zpb.rr://meta")
Defines shared test utilities.