Macros | Functions
TimeStamp_t.cc File Reference
#include "boost/test/unit_test.hpp"
#include "canvas/Persistency/Provenance/Timestamp.h"

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (TimeStamp_t)
 

Functions

 BOOST_AUTO_TEST_CASE (constructTest)
 
 BOOST_AUTO_TEST_CASE (comparisonTest)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (TimeStamp_t)

Definition at line 1 of file TimeStamp_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( constructTest  )

Definition at line 10 of file TimeStamp_t.cc.

11 {
12  constexpr TimeValue_t t = 2;
13  constexpr Timestamp temp(t);
14 
15  static_assert(temp.value() == t);
16 
17  static_assert(Timestamp::invalidTimestamp() < Timestamp::beginOfTime());
18  static_assert(Timestamp::beginOfTime() < Timestamp::endOfTime());
19  static_assert(Timestamp::endOfTime().value() + 1 == 0);
20 
21  constexpr Timestamp db(0xdeadbeefbeefdead);
22 
23  static_assert(db.timeLow() == 0xbeefdead);
24  static_assert(db.timeHigh() == 0xdeadbeef);
25  static_assert(db.value() == 0xdeadbeefbeefdead);
26 }
std::uint64_t TimeValue_t
Definition: Timestamp.h:8
BOOST_AUTO_TEST_CASE ( comparisonTest  )

Definition at line 28 of file TimeStamp_t.cc.

29 {
30  constexpr Timestamp small(1);
31  constexpr Timestamp med(2);
32 
33  static_assert(small < med);
34  static_assert(small <= med);
35  static_assert(!(small == med));
36  static_assert(small != med);
37  static_assert(!(small > med));
38  static_assert(!(small >= med));
39 }