8 #include <gtest/gtest.h>
14 using namespace ::testing;
16 TEST(Conversion, MakeOcmIfSubState) {
18 using daqif::operator==;
20 FullState({daqif::StateAcquiring, daqif::NotStarted}));
22 FullState({daqif::StateAcquiring, daqif::Acquiring}));
24 FullState({daqif::StateAcquiring, daqif::Stopping}));
26 FullState({daqif::StateAcquiring, daqif::Stopped}));
28 FullState({daqif::StateAcquiring, daqif::Aborting}));
31 FullState({daqif::StateMerging, daqif::NotScheduled}));
33 FullState({daqif::StateMerging, daqif::Scheduled}));
35 FullState({daqif::StateMerging, daqif::Collecting}));
37 FullState({daqif::StateMerging, daqif::Merging}));
39 FullState({daqif::StateMerging, daqif::Releasing}));
41 FullState({daqif::StateMerging, daqif::Aborting}));
44 FullState({daqif::StateCompleted, daqif::Completed}));
46 FullState({daqif::StateCompleted, daqif::Aborted}));
49 TEST(Conversion, MakeDaqState) {
68 TEST(Conversion, TimestampResolutionIsAtLeastMicrosecond) {
69 using Seconds = std::chrono::duration<double, std::ratio<1>>;
70 auto now_tp1 = daq::Status::Clock::now();
71 double now_d1 = std::chrono::time_point_cast<Seconds>(now_tp1).time_since_epoch().count();
73 auto now_tp2 = now_tp1 + std::chrono::microseconds(1);
74 double now_d2 = std::chrono::time_point_cast<Seconds>(now_tp2).time_since_epoch().count();
76 EXPECT_GT(now_d2, now_d1);
77 EXPECT_GT(now_tp2, now_tp1);
Contains support functions for daqif.
Declares daq::State and related functions.
daqif::FullState MakeState(State state) noexcept
Converts daq::State to DaqSubstate.
@ Completed
Completed DAQ.
@ NotScheduled
Before daq is acknowledged by dpm it remains in NotScheduled.
@ Scheduled
daq is acknowledged by dpm and is scheduled for merging (i.e.
@ Releasing
Releasing Data Product to receivers.
@ Collecting
Input files are being collected.
@ Aborted
Data acquisition has been aborted by user.
@ Merging
DAQ is being merged.
@ Stopping
Transitional state between Acquiring and Stopped.
@ AbortingMerging
Transitional state for aborting during merging.
@ Acquiring
All data sources have reported data acquisition is in progress.
@ Stopped
All data sources have reported they have stopped acquiring data.
@ AbortingAcquiring
Transitional state for aborting during acquisition.
@ NotStarted
Initial state of data acquisition.
Describes the full state and substate.
Contains declaration for Status and ObservableStatus.
TEST(Conversion, MakeOcmIfSubState)
EXPECT_EQ(meta.rr_uri, "zpb.rr://meta")