10 #include "../DuneTimeConverter.h" 26 const string myname =
"test_DuneTimeConverter: ";
27 cout << myname <<
"Starting test" <<
endl;
29 cout << myname <<
"NDEBUG must be off." <<
endl;
32 string line =
"-----------------------------";
35 cout << myname << line <<
endl;
36 cout << myname <<
"Test data" <<
endl;
42 cout << myname << line <<
endl;
43 cout << myname <<
"Create test time" <<
endl;
45 uint32_t tsec = 1577836800;
47 uint32_t trem = 123456789;
49 cout << myname << line <<
endl;
50 cout << myname <<
"Create timestamp." <<
endl;
53 assert( ts1.
timeLow() == trem );
56 cout << myname << line <<
endl;
57 cout << myname <<
"Create nova time." <<
endl;
60 cout << myname <<
"Nova time: " <<tnova <<
endl;
66 cout << myname <<
"Low tolerance: " << tol <<
endl;
67 assert(
abs(lodiff) < tol );
69 cout << myname << line <<
endl;
70 cout << myname <<
"Test creation from string." <<
endl;
71 string stime =
"1577836800.123456789";
73 cout << myname <<
" String: " << stime <<
endl;
79 cout << myname << line <<
endl;
80 cout << myname <<
"Done." <<
endl;
constexpr std::uint32_t timeLow() const
static art::Timestamp fromNova(uint64_t tnova)
static std::string toString(art::Timestamp tart)
constexpr std::uint32_t timeHigh() const
static art::Timestamp makeTimestamp(uint32_t tsec, uint32_t trem)
static uint64_t novaTicksPerSec()
static art::Timestamp fromString(std::string stime)
int test_DuneTimeConverter()
Q_EXPORT QTSManip setw(int w)
static uint64_t novaT0Sec()
void line(double t, double *p, double &x, double &y, double &z)
static uint64_t toNova(art::Timestamp tart)
QTextStream & endl(QTextStream &s)
static uint64_t novaTicksPerUsec()