proxygen
ChronoTest.cpp File Reference

Go to the source code of this file.

Functions

 TEST_F (ChronoTest, ceil_duration)
 
 TEST_F (ChronoTest, ceil_time_point)
 
 TEST_F (ChronoTest, floor_duration)
 
 TEST_F (ChronoTest, floor_time_point)
 
 TEST_F (ChronoTest, round_duration)
 
 TEST_F (ChronoTest, round_time_point)
 

Function Documentation

TEST_F ( ChronoTest  ,
ceil_duration   
)

Definition at line 28 of file ChronoTest.cpp.

References EXPECT_EQ.

28  {
29  EXPECT_EQ(seconds(7), ceil<seconds>(seconds(7)));
30  EXPECT_EQ(seconds(7), ceil<seconds>(milliseconds(7000)));
31  EXPECT_EQ(seconds(7), ceil<seconds>(milliseconds(6200)));
32 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TEST_F ( ChronoTest  ,
ceil_time_point   
)

Definition at line 34 of file ChronoTest.cpp.

References EXPECT_EQ.

34  {
35  auto const point = steady_clock::time_point{};
36  EXPECT_EQ(point + seconds(7), ceil<seconds>(point + seconds(7)));
37  EXPECT_EQ(point + seconds(7), ceil<seconds>(point + milliseconds(7000)));
38  EXPECT_EQ(point + seconds(7), ceil<seconds>(point + milliseconds(6200)));
39 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TEST_F ( ChronoTest  ,
floor_duration   
)

Definition at line 41 of file ChronoTest.cpp.

References EXPECT_EQ.

41  {
42  EXPECT_EQ(seconds(7), floor<seconds>(seconds(7)));
43  EXPECT_EQ(seconds(7), floor<seconds>(milliseconds(7000)));
44  EXPECT_EQ(seconds(7), floor<seconds>(milliseconds(7800)));
45 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TEST_F ( ChronoTest  ,
floor_time_point   
)

Definition at line 47 of file ChronoTest.cpp.

References EXPECT_EQ.

47  {
48  auto const point = steady_clock::time_point{};
49  EXPECT_EQ(point + seconds(7), floor<seconds>(point + seconds(7)));
50  EXPECT_EQ(point + seconds(7), floor<seconds>(point + milliseconds(7000)));
51  EXPECT_EQ(point + seconds(7), floor<seconds>(point + milliseconds(7800)));
52 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TEST_F ( ChronoTest  ,
round_duration   
)

Definition at line 54 of file ChronoTest.cpp.

References EXPECT_EQ.

54  {
55  EXPECT_EQ(seconds(7), round<seconds>(seconds(7)));
56  EXPECT_EQ(seconds(6), round<seconds>(milliseconds(6200)));
57  EXPECT_EQ(seconds(6), round<seconds>(milliseconds(6500)));
58  EXPECT_EQ(seconds(7), round<seconds>(milliseconds(6800)));
59  EXPECT_EQ(seconds(7), round<seconds>(milliseconds(7000)));
60  EXPECT_EQ(seconds(7), round<seconds>(milliseconds(7200)));
61  EXPECT_EQ(seconds(8), round<seconds>(milliseconds(7500)));
62  EXPECT_EQ(seconds(8), round<seconds>(milliseconds(7800)));
63 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TEST_F ( ChronoTest  ,
round_time_point   
)

Definition at line 65 of file ChronoTest.cpp.

References EXPECT_EQ.

65  {
66  auto const point = steady_clock::time_point{};
67  EXPECT_EQ(point + seconds(7), round<seconds>(point + seconds(7)));
68  EXPECT_EQ(point + seconds(6), round<seconds>(point + milliseconds(6200)));
69  EXPECT_EQ(point + seconds(6), round<seconds>(point + milliseconds(6500)));
70  EXPECT_EQ(point + seconds(7), round<seconds>(point + milliseconds(6800)));
71  EXPECT_EQ(point + seconds(7), round<seconds>(point + milliseconds(7000)));
72  EXPECT_EQ(point + seconds(7), round<seconds>(point + milliseconds(7200)));
73  EXPECT_EQ(point + seconds(8), round<seconds>(point + milliseconds(7500)));
74  EXPECT_EQ(point + seconds(8), round<seconds>(point + milliseconds(7800)));
75 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922