diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-09-23 19:27:15 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-09-23 19:27:19 +0300 |
commit | 0a8a726014fb4135414eedbe98170790fe09c2c2 (patch) | |
tree | ae380a7e9ef4c36c2d7e218b872680f678a7d8f1 /source/blender/blenlib/tests | |
parent | 18a4dc869d16fca315df32a790843a0068c72a47 (diff) |
bUUID: make it explicit the default constructor produces the nil value
The implicit default constructor zeroes all plain data fields, and now
this behaviour is explicit & tested for in a unit test.
Diffstat (limited to 'source/blender/blenlib/tests')
-rw-r--r-- | source/blender/blenlib/tests/BLI_uuid_test.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenlib/tests/BLI_uuid_test.cc b/source/blender/blenlib/tests/BLI_uuid_test.cc index b5d636ed1c3..f2160f614ba 100644 --- a/source/blender/blenlib/tests/BLI_uuid_test.cc +++ b/source/blender/blenlib/tests/BLI_uuid_test.cc @@ -54,9 +54,12 @@ 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}; + const bUUID default_constructed{}; EXPECT_EQ(nil_uuid, zeroes_uuid); EXPECT_TRUE(BLI_uuid_is_nil(nil_uuid)); + EXPECT_TRUE(BLI_uuid_is_nil(default_constructed)) + << "Default constructor should produce the nil value."; std::string buffer(36, '\0'); BLI_uuid_format(buffer.data(), nil_uuid); |