17 #include <gtest/gtest.h> 21 TEST(WalltimeTest, testTimestampOverflow)
23 for (uint64_t start_device_time = 0;
24 start_device_time < (1 << 24);
25 start_device_time += (1 << 23))
29 for (uint64_t device_time = start_device_time;
30 device_time < (1 << 25);
33 const uint32_t device_timestamp = device_time & 0xFFFFFF;
34 ASSERT_EQ(walltime.
update(device_timestamp), device_time);
39 TEST(WalltimeTest, testDeviceTimeBoundary)
43 uint64_t device_time = (1 << 24) - 1;
44 uint32_t device_timestamp = device_time & 0xFFFFFF;
45 ASSERT_EQ(walltime.
update(device_timestamp), device_time);
48 device_timestamp = device_time & 0xFFFFFF;
49 ASSERT_EQ(walltime.
update(device_timestamp), (1 << 24) + device_time);
51 device_time = (1 << 24) - 1;
52 device_timestamp = device_time & 0xFFFFFF;
53 ASSERT_EQ(walltime.
update(device_timestamp), device_time);
56 device_timestamp = device_time & 0xFFFFFF;
57 ASSERT_EQ(walltime.
update(device_timestamp), (1 << 24) + device_time);
60 int main(
int argc,
char** argv)
62 testing::InitGoogleTest(&argc, argv);
64 return RUN_ALL_TESTS();
uint64_t update(const uint32_t &time_device)
int main(int argc, char **argv)
TEST(WalltimeTest, testTimestampOverflow)