95TEST(Construction, nanoseconds)
98 for (
volatile int64_t sec = -1000000; sec <= 1000000; sec += 100000)
100 for (
volatile int64_t usec = -1000000; usec <= 1100000; usec += 10000)
102 const int64_t nsec = sec * 1000000000 + usec * 1000;
107 sec * 1000000 + usec);
109 if (usec >= 0 && usec < 1000000)
136 const int64_t max_nsec = 10000000000;
137 const int64_t step_nsec = 100000000;
138 for (
volatile int64_t a_nsec = -max_nsec; a_nsec <= max_nsec; a_nsec += step_nsec)
140 for (
volatile int64_t b_nsec = -max_nsec; b_nsec <= max_nsec; b_nsec += step_nsec)
145 EXPECT_EQ((a + b).getNanoSeconds(), a_nsec + b_nsec);
154 const int64_t max_nsec = 10000000000;
155 const int64_t step_nsec = 100000000;
156 for (
volatile int64_t a_nsec = -max_nsec; a_nsec <= max_nsec; a_nsec += step_nsec)
158 for (
volatile int64_t b_nsec = -max_nsec; b_nsec <= max_nsec; b_nsec += step_nsec)
163 EXPECT_EQ((a - b).getNanoSeconds(), a_nsec - b_nsec);