Remove std::vector from public api
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-TypeRegistry.cpp
index 49c8fc4..19c5a8d 100644 (file)
@@ -481,7 +481,7 @@ static void ResetFunctorCounts()
 }
 
 static std::string lastActionCustom;
-bool DoActionCustom(BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes)
+bool DoActionCustom(BaseObject* object, const std::string& actionName, const Property::Map& /*attributes*/)
 {
   lastActionCustom = actionName;
   return true;
@@ -674,42 +674,38 @@ int UtcDaliTypeRegistryGetTypeInfoFromTypeIdN(void)
   END_TEST;
 }
 
-int UtcDaliTypeRegistryGetTypeNamesP(void)
+int UtcDaliTypeRegistryGetTypeNameCountP(void)
 {
   TestApplication application;
-
+  TypeRegistry typeRegistry = TypeRegistry::Get();
   TypeInfo type;
 
-  TypeRegistry::NameContainer names = TypeRegistry::Get().GetTypeNames();
-
-  for(TypeRegistry::NameContainer::iterator iter = names.begin();
-      iter != names.end(); ++iter)
+  for(size_t i = 0; i < typeRegistry.GetTypeNameCount(); i++)
   {
-    type = TypeRegistry::Get().GetTypeInfo( *iter );
+    type = typeRegistry.GetTypeInfo( typeRegistry.GetTypeName(i) );
     DALI_TEST_CHECK( type );
   }
 
   END_TEST;
 }
 
-int UtcDaliTypeRegistryGetTypeNamesN(void)
+
+int UtcDaliTypeRegistryGetTypeNamesP(void)
 {
   TestApplication application;
-
+  TypeRegistry typeRegistry = TypeRegistry::Get();
   TypeInfo type;
 
-  TypeRegistry::NameContainer names = TypeRegistry::Get().GetTypeNames();
-
-  for(TypeRegistry::NameContainer::iterator iter = names.begin();
-      iter != names.end(); ++iter)
+  for(size_t i = 0; i < typeRegistry.GetTypeNameCount(); i++)
   {
-    type = TypeRegistry::Get().GetTypeInfo( *iter );
-    DALI_TEST_CHECK( type.GetName() != "MyDummyActor" );
+    type = typeRegistry.GetTypeInfo( typeRegistry.GetTypeName(i) );
+    DALI_TEST_CHECK( type );
   }
 
   END_TEST;
 }
 
+
 // Note: No negative test case for UtcDaliTypeRegistryTypeRegistration can be implemented.
 int UtcDaliTypeRegistryTypeRegistrationNotCallingCreateOnInitP(void)
 {
@@ -729,19 +725,9 @@ int UtcDaliTypeRegistryTypeRegistrationNotCallingCreateOnInitP(void)
   MyTestCustomActor customHandle = MyTestCustomActor::DownCast( handle );
   DALI_TEST_CHECK( customHandle );
 
-  TypeInfo::NameContainer names;
-  type.GetActions(names);
-  TypeInfo::NameContainer baseNames;
-  baseType.GetActions(baseNames);
-  DALI_TEST_EQUALS( names.size(), TEST_ACTION_COUNT + baseNames.size(), TEST_LOCATION );
-
-  names.clear();
-  type.GetSignals(names);
-
-  baseNames.clear();
-  baseType.GetSignals(baseNames);
+  DALI_TEST_EQUALS( type.GetActionCount(), TEST_ACTION_COUNT + baseType.GetActionCount(), TEST_LOCATION );
 
-  DALI_TEST_EQUALS( names.size(), TEST_SIGNAL_COUNT + baseNames.size(), TEST_LOCATION );
+  DALI_TEST_EQUALS( type.GetSignalCount(), TEST_SIGNAL_COUNT + baseType.GetSignalCount(), TEST_LOCATION );
 
   {
     TestConnectionTracker tracker;
@@ -769,7 +755,7 @@ int UtcDaliTypeRegistryTypeRegistrationNotCallingCreateOnInitP(void)
   DALI_TEST_EQUALS( CustomTestFunctor::mTotalInstanceCount, 2/*temporary copy + FunctorDelegate copy*/, TEST_LOCATION );
   DALI_TEST_EQUALS( CustomTestFunctor::mCurrentInstanceCount, 0, TEST_LOCATION );
 
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
   handle.DoAction("act1", attributes);
   DALI_TEST_CHECK( lastActionCustom == "act1" );
   END_TEST;
@@ -891,21 +877,9 @@ int UtcDaliTypeRegistrySignalConnectorTypeN(void)
   MyTestCustomActor customHandle = MyTestCustomActor::DownCast( handle );
   DALI_TEST_CHECK( customHandle );
 
-  TypeInfo::NameContainer names;
-  TypeInfo::NameContainer baseNames;
-
-  type.GetActions(names);
-  baseType.GetActions(baseNames);
-
-  DALI_TEST_EQUALS( names.size(), TEST_ACTION_COUNT + baseNames.size(), TEST_LOCATION );
-
-  names.clear();
-  baseNames.clear();
-
-  type.GetSignals(names);
-  baseType.GetSignals(baseNames);
+  DALI_TEST_EQUALS( type.GetActionCount(), TEST_ACTION_COUNT + baseType.GetActionCount(), TEST_LOCATION );
 
-  DALI_TEST_EQUALS( names.size(), TEST_SIGNAL_COUNT + baseNames.size(), TEST_LOCATION );
+  DALI_TEST_EQUALS( type.GetSignalCount(), TEST_SIGNAL_COUNT + baseType.GetSignalCount(), TEST_LOCATION );
 
   {
     TestConnectionTracker tracker;
@@ -942,7 +916,7 @@ int UtcDaliTypeRegistryTypeActionP(void)
   BaseHandle handle = type.CreateInstance();
   DALI_TEST_CHECK( handle );
 
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
   DALI_TEST_CHECK( handle.DoAction("act1", attributes) );
   DALI_TEST_CHECK( lastActionCustom == "act1" );
 
@@ -961,7 +935,7 @@ int UtcDaliTypeRegistryTypeActionN(void)
   BaseHandle handle = type.CreateInstance();
   DALI_TEST_CHECK( handle );
 
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
   DALI_TEST_CHECK( !handle.DoAction( "unknown-action", attributes ) );
 
   END_TEST;
@@ -1018,19 +992,17 @@ int UtcDaliTypeRegistryPropertyRegistrationP(void)
   // Check property count of type-info is 1
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
 
   // check property name count
-  TypeInfo::NameContainer names;
-  typeInfo.GetProperties(names);
-  DALI_TEST_CHECK( 1 == names.size() );
+  DALI_TEST_CHECK( 1 == typeInfo.GetPropertyCount() );
 
   // Ensure indices returned from actor and customActor differ by two
   Actor actor = Actor::New();
   actor.GetPropertyIndices( indices );
-  unsigned int actorIndices = indices.size();
+  unsigned int actorIndices = indices.Size();
   customActor.GetPropertyIndices( indices );
-  unsigned int customActorIndices = indices.size();
+  unsigned int customActorIndices = indices.Size();
   DALI_TEST_EQUALS( actorIndices + 2u, customActorIndices, TEST_LOCATION ); // Custom property + registered property
   END_TEST;
 }
@@ -1111,14 +1083,14 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationP(void)
   // Check property count of type-info is 1
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
 
   // Ensure indices returned from actor and customActor differ by one
   Actor actor = Actor::New();
   actor.GetPropertyIndices( indices );
-  unsigned int actorIndices = indices.size();
+  unsigned int actorIndices = indices.Size();
   customActor.GetPropertyIndices( indices );
-  unsigned int customActorIndices = indices.size();
+  unsigned int customActorIndices = indices.Size();
   DALI_TEST_EQUALS( actorIndices + 1u, customActorIndices, TEST_LOCATION ); // Custom property + registered property
 
   END_TEST;
@@ -1200,7 +1172,7 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void)
   // Check property count of type-info is 1
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
 
   // Register animatable property components
   std::string animatablePropertyComponentName1( "animatable-prop-1-x" );
@@ -1245,9 +1217,9 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void)
   // Ensure indices returned from actor and customActor differ by three
   Actor actor = Actor::New();
   actor.GetPropertyIndices( indices );
-  unsigned int actorIndices = indices.size();
+  unsigned int actorIndices = indices.Size();
   customActor.GetPropertyIndices( indices );
-  unsigned int customActorIndices = indices.size();
+  unsigned int customActorIndices = indices.Size();
   DALI_TEST_EQUALS( actorIndices + 3u, customActorIndices, TEST_LOCATION ); // Custom property + registered property
 
   END_TEST;
@@ -1343,7 +1315,7 @@ int UtcDaliTypeRegistryActionViaBaseHandle(void)
   application.Render(0);
   DALI_TEST_CHECK(!a.IsVisible());
 
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
 
   DALI_TEST_CHECK(hdl.DoAction("show", attributes));