Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/common/intern/object_identifier_test.cc
- This file was moved from tests/gtests/usd/object_identifier_test.cc.
| Show All 18 Lines | |||||
| #include "IO_abstract_hierarchy_iterator.h" | #include "IO_abstract_hierarchy_iterator.h" | ||||
| #include "testing/testing.h" | #include "testing/testing.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include <climits> | #include <climits> | ||||
| namespace blender { | namespace blender::io { | ||||
| namespace io { | |||||
| namespace { | namespace { | ||||
| /* Return object pointer for use in tests. This makes it possible to reliably test for | /* Return object pointer for use in tests. This makes it possible to reliably test for | ||||
| * order/equality functions while using hard-coded values for simplicity. */ | * order/equality functions while using hard-coded values for simplicity. */ | ||||
| Object *fake_pointer(int value) | Object *fake_pointer(int value) | ||||
| { | { | ||||
| return static_cast<Object *>(POINTER_FROM_INT(value)); | return static_cast<Object *>(POINTER_FROM_INT(value)); | ||||
| ▲ Show 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | TEST_F(PersistentIDTest, as_object_name_suffix) | ||||
| EXPECT_EQ("7-6-5-4-3-2-1-0", TestPersistentID(0, 1, 2, 3, 4, 5, 6, 7).as_object_name_suffix()); | EXPECT_EQ("7-6-5-4-3-2-1-0", TestPersistentID(0, 1, 2, 3, 4, 5, 6, 7).as_object_name_suffix()); | ||||
| EXPECT_EQ("0-0-0", TestPersistentID(0, 0, 0).as_object_name_suffix()); | EXPECT_EQ("0-0-0", TestPersistentID(0, 0, 0).as_object_name_suffix()); | ||||
| EXPECT_EQ("0-0", TestPersistentID(0, 0).as_object_name_suffix()); | EXPECT_EQ("0-0", TestPersistentID(0, 0).as_object_name_suffix()); | ||||
| EXPECT_EQ("-3--2--1", TestPersistentID(-1, -2, -3).as_object_name_suffix()); | EXPECT_EQ("-3--2--1", TestPersistentID(-1, -2, -3).as_object_name_suffix()); | ||||
| } | } | ||||
| } // namespace io | } // namespace blender::io | ||||
| } // namespace blender | |||||