def testSmartPointersWithNamespace(self): # Create the main object o = Obj() self.assertEqual(objCount(), 1) # Create a shared pointer to an Integer together with an Integer. ptrToInteger = o.giveSharedPtrToInteger2() self.assertEqual(objCount(), 1) self.assertEqual(integerCount(), 2) integer = ptrToInteger.data() self.assertTrue(integer)
def testSmartPointerConversions(self): # Create Obj. o = Obj() self.assertEqual(objCount(), 1) self.assertEqual(integerCount(), 1) # Create a shared pointer to an Integer2 integer2 = o.giveSharedPtrToInteger2() self.assertEqual(integer2.value(), 456) # pass Smart<Integer2> to a function that accepts Smart<Integer> r = o.takeSharedPtrToInteger(integer2) self.assertEqual(r, integer2.value())