| 21 | using std::stringstream; |
| 22 | |
| 23 | TEST(UUID, Constuctors) { |
| 24 | // default constructor should be null |
| 25 | UUID null; |
| 26 | EXPECT_TRUE(null.isNull()); |
| 27 | |
| 28 | // created UUID is not null |
| 29 | UUID uuid = createUUID(); |
| 30 | EXPECT_FALSE(uuid.isNull()); |
| 31 | |
| 32 | // copy UUID |
| 33 | UUID uuid2(uuid); |
| 34 | EXPECT_FALSE(uuid2.isNull()); |
| 35 | EXPECT_TRUE(uuid == uuid2); |
| 36 | |
| 37 | // from string |
| 38 | string str = toString(uuid); |
| 39 | UUID uuid3 = toUUID(str); |
| 40 | EXPECT_FALSE(uuid3.isNull()); |
| 41 | EXPECT_TRUE(uuid == uuid3); |
| 42 | |
| 43 | // from bad string |
| 44 | UUID uuid4 = toUUID(std::string("Not a UUID")); |
| 45 | EXPECT_TRUE(uuid4.isNull()); |
| 46 | } |
| 47 | |
| 48 | TEST(UUID, BigSet) { |
| 49 | // create a bunch of uuids, insert into set, make sure no uuids collided |
nothing calls this directly
no test coverage detected