Make warning message instead of Assert when getting Child Property 63/143463/5
authorminho.sun <minho.sun@samsung.com>
Thu, 10 Aug 2017 04:37:18 +0000 (13:37 +0900)
committerminho.sun <minho.sun@samsung.com>
Mon, 21 Aug 2017 02:59:13 +0000 (11:59 +0900)
If there is no child property, makes warning message instead of Assert
and ignores behaviour.

Change-Id: I0ac8936e203607a14a6891228b54955cf3702f7a
Signed-off-by: minho.sun <minho.sun@samsung.com>
automated-tests/src/dali/utc-Dali-TypeRegistry.cpp
dali/internal/event/common/type-info-impl.cpp

index 0594fe5..f184936 100644 (file)
@@ -1715,6 +1715,8 @@ int UtcDaliTypeRegistryChildPropertyRegistrationP(void)
   Property::Type type = typeInfoImpl.GetChildPropertyType( typeInfoImpl.GetChildPropertyIndex("childProp4") );
   DALI_TEST_EQUALS( type, Property::INTEGER, TEST_LOCATION );
 
+  std::string unRegisteredChildName( typeInfoImpl.GetChildPropertyName( CHILD_PROPERTY_REGISTRATION_START_INDEX + 4 ) );
+  DALI_TEST_EQUALS( unRegisteredChildName, "", TEST_LOCATION );
 
   // Create a child actor
   Actor childActor = Actor::New();
index fec8ead..c8dadae 100644 (file)
@@ -639,7 +639,10 @@ const std::string& TypeInfo::GetChildPropertyName( Property::Index index ) const
     return GetImplementation(base).GetChildPropertyName( index );
   }
 
-  DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as Object
+  DALI_LOG_WARNING("Cannot find property index");
+
+  static std::string emptyString;
+  return emptyString;
 }
 
 Property::Type TypeInfo::GetChildPropertyType( Property::Index index ) const