Austin Schuh | 64fab80 | 2020-09-09 22:47:47 -0700 | [diff] [blame] | 1 | #include "aos/events/logging/uuid.h" |
| 2 | |
| 3 | #include "glog/logging.h" |
| 4 | #include "gtest/gtest.h" |
| 5 | |
| 6 | namespace aos { |
| 7 | namespace testing { |
| 8 | |
| 9 | // Tests that random UUIDs are actually random, and we can convert them to a |
| 10 | // string. Not very exhaustive, but it is a good smoke test. |
| 11 | TEST(UUIDTest, GetOne) { |
| 12 | LOG(INFO) << UUID::Random().string_view(); |
| 13 | |
| 14 | EXPECT_NE(UUID::Random(), UUID::Random()); |
Brian Silverman | 1f34522 | 2020-09-24 21:14:48 -0700 | [diff] [blame] | 15 | EXPECT_NE(UUID::Random(), UUID::Zero()); |
| 16 | EXPECT_EQ(UUID::Zero(), UUID::Zero()); |
Austin Schuh | 64fab80 | 2020-09-09 22:47:47 -0700 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | } // namespace testing |
| 20 | } // namespace aos |