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 | |
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')
-rw-r--r-- | tests/gtests/blenlib/BLI_session_uuid_test.cc | 20 | ||||
-rw-r--r-- | tests/gtests/blenlib/CMakeLists.txt | 1 |
2 files changed, 21 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)); + } +} diff --git a/tests/gtests/blenlib/CMakeLists.txt b/tests/gtests/blenlib/CMakeLists.txt index d151dacd7a4..937279bceb9 100644 --- a/tests/gtests/blenlib/CMakeLists.txt +++ b/tests/gtests/blenlib/CMakeLists.txt @@ -68,6 +68,7 @@ BLENDER_TEST(BLI_memiter "bf_blenlib") BLENDER_TEST(BLI_memory_utils "bf_blenlib") BLENDER_TEST(BLI_path_util "${BLI_path_util_extra_libs}") BLENDER_TEST(BLI_polyfill_2d "bf_blenlib") +BLENDER_TEST(BLI_session_uuid "bf_blenlib") BLENDER_TEST(BLI_set "bf_blenlib") BLENDER_TEST(BLI_span "bf_blenlib") BLENDER_TEST(BLI_stack "bf_blenlib") |