Changeset 10624 for code/trunk/test/core/object/WeakPtrTest.cc
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (10 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/test/core/object/WeakPtrTest.cc
r9603 r10624 45 45 test->destroy(); 46 46 } 47 48 void isNull(const WeakPtr<DestroyableTest> weakPtr) 49 { 50 EXPECT_TRUE(weakPtr == NULL); 51 EXPECT_TRUE(weakPtr == 0); 52 EXPECT_TRUE(!weakPtr); 53 EXPECT_FALSE(weakPtr != NULL); 54 EXPECT_FALSE(weakPtr != 0); 55 EXPECT_FALSE(weakPtr); 56 } 57 58 TEST(WeakPtrTest, IsNull) 59 { 60 { 61 WeakPtr<DestroyableTest> weakPtr; 62 isNull(weakPtr); 63 } 64 { 65 WeakPtr<DestroyableTest> weakPtr = NULL; 66 isNull(weakPtr); 67 } 68 { 69 WeakPtr<DestroyableTest> weakPtr; 70 weakPtr = NULL; 71 isNull(weakPtr); 72 } 73 { 74 WeakPtr<DestroyableTest> weakPtr = 0; 75 isNull(weakPtr); 76 } 77 { 78 WeakPtr<DestroyableTest> weakPtr; 79 weakPtr = 0; 80 isNull(weakPtr); 81 } 82 } 83 84 TEST(WeakPtrTest, IsNotNull) 85 { 86 DestroyableTest* test = new DestroyableTest(); 87 WeakPtr<DestroyableTest> weakPtr = test; 88 EXPECT_FALSE(weakPtr == NULL); 89 EXPECT_FALSE(weakPtr == 0); 90 EXPECT_FALSE(!weakPtr); 91 EXPECT_TRUE(weakPtr != NULL); 92 EXPECT_TRUE(weakPtr != 0); 93 EXPECT_TRUE(weakPtr); 94 test->destroy(); 95 } 47 96 }
Note: See TracChangeset
for help on using the changeset viewer.