test/cpuwatch_rt.cpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Includes
10 *****************************************************************************/
11 
12 #include <gtest/gtest.h>
13 #include "../../include/ecl/time/cpuwatch.hpp"
14 
15 /*****************************************************************************
16 ** Platform Check
17 *****************************************************************************/
18 
19 #include <ecl/config.hpp>
20 
21 #if defined(ECL_IS_POSIX)
22  // monotonic clock, cpu clock -> clock_gettime; clock_selection -> clock_nanosleep
23  #if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK) >= 0L && defined(_POSIX_CLOCK_SELECTION) && (_POSIX_CLOCK_SELECTION) >= 0L
24 
25 /*****************************************************************************
26 ** Using
27 *****************************************************************************/
28 
29 using ecl::CpuWatch;
30 using ecl::TimeStamp;
31 
32 /*****************************************************************************
33 ** Tests
34 *****************************************************************************/
35 
36 TEST(StopwatchTests,silent) {
37 
38  CpuWatch stopwatch;
39  TimeStamp time;
40 
41  time = stopwatch.split();
42  time = stopwatch.split();
43  time = stopwatch.elapsed();
44  // Can't really verify stuff, so this is just a unit test to make sure
45  // it compiles.
46  SUCCEED();
47 }
48 
49  #endif /* MANY POSIX TIME REQ'MENTS */
50 #endif /* ECL_IS_POSIX */
51 
52 /*****************************************************************************
53 ** Main program
54 *****************************************************************************/
55 
56 int main(int argc, char **argv) {
57 
58  testing::InitGoogleTest(&argc,argv);
59  return RUN_ALL_TESTS();
60 }
61 
int main(int argc, char **argv)
TEST(TimeDataTests, container)


ecl_time
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:08:15