Lines Matching full:timestamp
13 #include "api/units/timestamp.h"
20 constexpr Timestamp kTimestampInf = Timestamp::PlusInfinity(); in TEST()
24 constexpr Timestamp kTimestampSeconds = Timestamp::Seconds(kValue); in TEST()
25 constexpr Timestamp kTimestampMs = Timestamp::Millis(kValue); in TEST()
26 constexpr Timestamp kTimestampUs = Timestamp::Micros(kValue); in TEST()
41 EXPECT_EQ(Timestamp::Millis(kValue).ms(), kValue); in TEST()
42 EXPECT_EQ(Timestamp::Micros(kValue).us(), kValue); in TEST()
43 EXPECT_EQ(Timestamp::Seconds(kValue).seconds(), kValue); in TEST()
48 EXPECT_EQ(Timestamp::Micros(kValue).seconds(), kValue / 1000000); in TEST()
49 EXPECT_EQ(Timestamp::Millis(kValue).seconds(), kValue / 1000); in TEST()
50 EXPECT_EQ(Timestamp::Micros(kValue).ms(), kValue / 1000); in TEST()
52 EXPECT_EQ(Timestamp::Millis(kValue).us(), kValue * 1000); in TEST()
53 EXPECT_EQ(Timestamp::Seconds(kValue).ms(), kValue * 1000); in TEST()
54 EXPECT_EQ(Timestamp::Seconds(kValue).us(), kValue * 1000000); in TEST()
60 EXPECT_TRUE(Timestamp::PlusInfinity().IsInfinite()); in TEST()
61 EXPECT_TRUE(Timestamp::MinusInfinity().IsInfinite()); in TEST()
62 EXPECT_FALSE(Timestamp::Millis(kValue).IsInfinite()); in TEST()
64 EXPECT_FALSE(Timestamp::PlusInfinity().IsFinite()); in TEST()
65 EXPECT_FALSE(Timestamp::MinusInfinity().IsFinite()); in TEST()
66 EXPECT_TRUE(Timestamp::Millis(kValue).IsFinite()); in TEST()
68 EXPECT_TRUE(Timestamp::PlusInfinity().IsPlusInfinity()); in TEST()
69 EXPECT_FALSE(Timestamp::MinusInfinity().IsPlusInfinity()); in TEST()
71 EXPECT_TRUE(Timestamp::MinusInfinity().IsMinusInfinity()); in TEST()
72 EXPECT_FALSE(Timestamp::PlusInfinity().IsMinusInfinity()); in TEST()
79 EXPECT_EQ(Timestamp::PlusInfinity(), Timestamp::PlusInfinity()); in TEST()
80 EXPECT_GE(Timestamp::PlusInfinity(), Timestamp::PlusInfinity()); in TEST()
81 EXPECT_GT(Timestamp::PlusInfinity(), Timestamp::Millis(kLarge)); in TEST()
82 EXPECT_EQ(Timestamp::Millis(kSmall), Timestamp::Millis(kSmall)); in TEST()
83 EXPECT_LE(Timestamp::Millis(kSmall), Timestamp::Millis(kSmall)); in TEST()
84 EXPECT_GE(Timestamp::Millis(kSmall), Timestamp::Millis(kSmall)); in TEST()
85 EXPECT_NE(Timestamp::Millis(kSmall), Timestamp::Millis(kLarge)); in TEST()
86 EXPECT_LE(Timestamp::Millis(kSmall), Timestamp::Millis(kLarge)); in TEST()
87 EXPECT_LT(Timestamp::Millis(kSmall), Timestamp::Millis(kLarge)); in TEST()
88 EXPECT_GE(Timestamp::Millis(kLarge), Timestamp::Millis(kSmall)); in TEST()
89 EXPECT_GT(Timestamp::Millis(kLarge), Timestamp::Millis(kSmall)); in TEST()
94 EXPECT_EQ(Timestamp::Seconds(kMaxInt).us(), in TEST()
96 EXPECT_EQ(Timestamp::Millis(kMaxInt).us(), in TEST()
106 EXPECT_EQ(Timestamp::Micros(kMicros).seconds<double>(), kSecondsDouble); in TEST()
107 EXPECT_EQ(Timestamp::Seconds(kSecondsDouble).us(), kMicros); in TEST()
109 EXPECT_EQ(Timestamp::Micros(kMicros).ms<double>(), kMillisDouble); in TEST()
110 EXPECT_EQ(Timestamp::Millis(kMillisDouble).us(), kMicros); in TEST()
112 EXPECT_EQ(Timestamp::Micros(kMicros).us<double>(), kMicrosDouble); in TEST()
113 EXPECT_EQ(Timestamp::Micros(kMicrosDouble).us(), kMicros); in TEST()
118 EXPECT_EQ(Timestamp::PlusInfinity().seconds<double>(), kPlusInfinity); in TEST()
119 EXPECT_EQ(Timestamp::MinusInfinity().seconds<double>(), kMinusInfinity); in TEST()
120 EXPECT_EQ(Timestamp::PlusInfinity().ms<double>(), kPlusInfinity); in TEST()
121 EXPECT_EQ(Timestamp::MinusInfinity().ms<double>(), kMinusInfinity); in TEST()
122 EXPECT_EQ(Timestamp::PlusInfinity().us<double>(), kPlusInfinity); in TEST()
123 EXPECT_EQ(Timestamp::MinusInfinity().us<double>(), kMinusInfinity); in TEST()
125 EXPECT_TRUE(Timestamp::Seconds(kPlusInfinity).IsPlusInfinity()); in TEST()
126 EXPECT_TRUE(Timestamp::Seconds(kMinusInfinity).IsMinusInfinity()); in TEST()
127 EXPECT_TRUE(Timestamp::Millis(kPlusInfinity).IsPlusInfinity()); in TEST()
128 EXPECT_TRUE(Timestamp::Millis(kMinusInfinity).IsMinusInfinity()); in TEST()
129 EXPECT_TRUE(Timestamp::Micros(kPlusInfinity).IsPlusInfinity()); in TEST()
130 EXPECT_TRUE(Timestamp::Micros(kMinusInfinity).IsMinusInfinity()); in TEST()
136 const Timestamp time_a = Timestamp::Millis(kValueA); in TEST()
137 const Timestamp time_b = Timestamp::Millis(kValueB); in TEST()
142 EXPECT_EQ((time_b - delta_a), Timestamp::Millis(kValueB - kValueA)); in TEST()
143 EXPECT_EQ((time_b + delta_a), Timestamp::Millis(kValueB + kValueA)); in TEST()
145 Timestamp mutable_time = time_a; in TEST()
154 const Timestamp finite_time = Timestamp::Millis(kValue); in TEST()
156 EXPECT_TRUE((Timestamp::PlusInfinity() + finite_delta).IsInfinite()); in TEST()
157 EXPECT_TRUE((Timestamp::PlusInfinity() - finite_delta).IsInfinite()); in TEST()