diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-30 12:12:13 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-31 12:24:03 +0300 |
commit | de21ddf821ce073031aa0154874cebcfad7cb481 (patch) | |
tree | 8b76d624c393e789abc15455e021062cd9ab7609 /tests/gtests/blenlib/BLI_session_uuid_test.cc | |
parent | cd579c49960510b9979842284b94b35c9175e059 (diff) |
BLI: Initial implementation of generic session UUID API
Covers basics like generation of new UUID.
Also contains code needed to use the SessionUUID as a key in the Map.
Diffstat (limited to 'tests/gtests/blenlib/BLI_session_uuid_test.cc')
-rw-r--r-- | tests/gtests/blenlib/BLI_session_uuid_test.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/gtests/blenlib/BLI_session_uuid_test.cc b/tests/gtests/blenlib/BLI_session_uuid_test.cc new file mode 100644 index 00000000000..1a5f17be06c --- /dev/null +++ b/tests/gtests/blenlib/BLI_session_uuid_test.cc @@ -0,0 +1,20 @@ +/* Apache License, Version 2.0 */ + +#include "testing/testing.h" + +#include "BLI_session_uuid.h" + +TEST(SessionUUID, GenerateBasic) +{ + { + const SessionUUID uuid = BLI_session_uuid_generate(); + EXPECT_TRUE(BLI_session_uuid_is_generated(&uuid)); + } + + { + const SessionUUID uuid1 = BLI_session_uuid_generate(); + const SessionUUID uuid2 = BLI_session_uuid_generate(); + + EXPECT_FALSE(BLI_session_uuid_is_equal(&uuid1, &uuid2)); + } +} |