diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-09-23 18:22:17 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-09-23 18:58:20 +0300 |
commit | 105115da9f601c53d87cdc038f795f00f56a3495 (patch) | |
tree | c0b8c200f485ed604c58c88f21b4fdfb1d723482 /source/blender/blenlib/tests | |
parent | bd63944a739b4dcd49e8a65294ffb1b8a0a7b20b (diff) |
UUID: add `!=` operator for comparing UUIDs
Make it possible to unit test with `EXPECT_NE(uuid1, uuid2)`.
Diffstat (limited to 'source/blender/blenlib/tests')
-rw-r--r-- | source/blender/blenlib/tests/BLI_uuid_test.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/tests/BLI_uuid_test.cc b/source/blender/blenlib/tests/BLI_uuid_test.cc index 42aa618963f..b5d636ed1c3 100644 --- a/source/blender/blenlib/tests/BLI_uuid_test.cc +++ b/source/blender/blenlib/tests/BLI_uuid_test.cc @@ -40,7 +40,7 @@ TEST(BLI_uuid, generate_many_random) /* Generate lots of UUIDs to get some indication that the randomness is okay. */ for (int i = 0; i < 1000000; ++i) { const bUUID uuid = BLI_uuid_generate_random(); - EXPECT_FALSE(BLI_uuid_equal(first_uuid, uuid)); + EXPECT_NE(first_uuid, uuid); // Check that the non-random bits are set according to RFC4122. const uint16_t version = uuid.time_hi_and_version >> 12; @@ -55,7 +55,7 @@ TEST(BLI_uuid, nil_value) const bUUID nil_uuid = BLI_uuid_nil(); const bUUID zeroes_uuid{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - EXPECT_TRUE(BLI_uuid_equal(nil_uuid, zeroes_uuid)); + EXPECT_EQ(nil_uuid, zeroes_uuid); EXPECT_TRUE(BLI_uuid_is_nil(nil_uuid)); std::string buffer(36, '\0'); @@ -68,8 +68,8 @@ TEST(BLI_uuid, equality) const bUUID uuid1 = BLI_uuid_generate_random(); const bUUID uuid2 = BLI_uuid_generate_random(); - EXPECT_TRUE(BLI_uuid_equal(uuid1, uuid1)); - EXPECT_FALSE(BLI_uuid_equal(uuid1, uuid2)); + EXPECT_EQ(uuid1, uuid1); + EXPECT_NE(uuid1, uuid2); } TEST(BLI_uuid, string_formatting) |