Remove duplicated Erase iteration code by introducing EraseObject method in OwnerCont...
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Handle.cpp
index f66177b..874b936 100644 (file)
@@ -896,9 +896,36 @@ int UtcDaliHandleWeightNew(void)
 {
   TestApplication application;
 
-  Handle handle = WeightObject::New();;
+  Handle handle = WeightObject::New();
   DALI_TEST_CHECK( handle.GetProperty<float>(WeightObject::WEIGHT) == 0.0f );
 
+  // process the message so scene object is added to update manager
+  application.SendNotification();
+  application.Render(0);
+
+  // no message to release scene object in this scenario
+
+  END_TEST;
+}
+
+int UtcDaliHandleWeightNew2(void)
+{
+  TestApplication application;
+
+  // scope for the weight object
+  {
+    Handle handle = WeightObject::New();
+    DALI_TEST_CHECK( handle.GetProperty<float>(WeightObject::WEIGHT) == 0.0f );
+
+    // process the message so scene object is added to update manager
+    application.SendNotification();
+    application.Render(0);
+  }
+  // handle out of scope so object gets destroyed
+  // process the message so update manager destroys the scene object
+  application.SendNotification();
+  application.Render(0);
+
   END_TEST;
 }