UTC missing tests for TypeInfo & NativeImageInterface 42/40242/2
authorLee Morgan <Lee.morgan@partner.samsung.com>
Mon, 1 Jun 2015 10:24:16 +0000 (11:24 +0100)
committerLee Morgan <Lee.morgan@partner.samsung.com>
Mon, 1 Jun 2015 11:58:38 +0000 (12:58 +0100)
Change-Id: I9aa4b337c6e1f03460668c678731d5398c105299

automated-tests/src/dali/utc-Dali-NativeImage.cpp
automated-tests/src/dali/utc-Dali-TypeRegistry.cpp
dali/internal/event/common/type-info-impl.cpp
dali/public-api/object/type-info.cpp
dali/public-api/object/type-info.h

index 6368762..1f080a7 100644 (file)
@@ -199,3 +199,16 @@ int UtcDaliNativeImageContextLoss(void)
 
   END_TEST;
 }
+
+int UtcDaliNativeImageExtensionP(void)
+{
+  TestApplication application;
+  tet_infoline( "Testing Dali::NativeImage::GenerateGlTexture()" );
+
+  TestNativeImagePointer testNativeImage = TestNativeImage::New( 16, 16 );
+  DALI_TEST_CHECK( testNativeImage );
+
+  DALI_TEST_CHECK( NULL == testNativeImage->GetExtension() );
+
+  END_TEST;
+}
index 19c5a8d..7175643 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <iostream>
 #include <stdlib.h>
+#include <limits>
 #include <dali/public-api/dali-core.h>
 #include <dali-test-suite-utils.h>
 #include <dali/integration-api/events/long-press-gesture-event.h>
@@ -994,9 +995,6 @@ int UtcDaliTypeRegistryPropertyRegistrationP(void)
   typeInfo.GetPropertyIndices( indices );
   DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
 
-  // check property name count
-  DALI_TEST_CHECK( 1 == typeInfo.GetPropertyCount() );
-
   // Ensure indices returned from actor and customActor differ by two
   Actor actor = Actor::New();
   actor.GetPropertyIndices( indices );
@@ -1681,3 +1679,71 @@ int UtcDaliTypeRegistryNamedType(void)
   DALI_TEST_CHECK( namedActorPropertyCount > actorPropertyCount );
   END_TEST;
 }
+
+int UtcDaliTypeInfoGetActionNameP(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" );
+  DALI_TEST_CHECK( typeInfo );
+
+  DALI_TEST_CHECK( 0 != typeInfo.GetActionCount() );
+
+  std::string name = typeInfo.GetActionName(0);
+
+  DALI_TEST_EQUALS( name, "show", TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetActionNameN(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" );
+  DALI_TEST_CHECK( typeInfo );
+
+  DALI_TEST_CHECK( 0 != typeInfo.GetActionCount() );
+
+  std::string name = typeInfo.GetActionName(std::numeric_limits<size_t>::max());
+
+  DALI_TEST_EQUALS( 0, name.size(), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetSignalNameP(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" );
+  DALI_TEST_CHECK( typeInfo );
+
+  DALI_TEST_CHECK( 0 != typeInfo.GetSignalCount() );
+
+  std::string name = typeInfo.GetSignalName(0);
+
+  DALI_TEST_EQUALS( name, "touched", TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetSignalNameN(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" );
+  DALI_TEST_CHECK( typeInfo );
+
+  DALI_TEST_CHECK( 0 != typeInfo.GetSignalCount() );
+
+  std::string name = typeInfo.GetSignalName(std::numeric_limits<size_t>::max());
+
+  DALI_TEST_EQUALS( 0, name.size(), TEST_LOCATION );
+
+  END_TEST;
+}
index 7efff52..b73d925 100644 (file)
@@ -292,22 +292,6 @@ std::string TypeInfo::GetSignalName(size_t index) const
   return name;
 }
 
-std::string TypeInfo::GetPropertyName(size_t index) const
-{
-  std::string name;
-  Property::IndexContainer indices;
-
-  GetPropertyIndices(indices);
-
-  if( index < indices.Size() )
-  {
-    name = GetPropertyName( indices[index] );
-  }
-
-  return name;
-}
-
-
 void TypeInfo::GetPropertyIndices( Property::IndexContainer& indices ) const
 {
   Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
index 0aeb2f1..03d96dc 100644 (file)
@@ -90,12 +90,6 @@ size_t TypeInfo::GetPropertyCount() const
   return GetImplementation(*this).GetPropertyCount();
 }
 
-std::string TypeInfo::GetPropertyName(size_t index)
-{
-  return GetImplementation(*this).GetPropertyName(index);
-}
-
-
 void TypeInfo::GetPropertyIndices( Property::IndexContainer& indices ) const
 {
   indices.Clear(); // We do not want to clear the container if called internally, so only clear here
index 4cb68b0..e0f3bb9 100644 (file)
@@ -164,21 +164,14 @@ public:
    */
   std::string GetSignalName(size_t index);
 
-/**
-   * @brief Retrieve the number of propertys for this type.
+  /**
+   * @brief Retrieve the number of event side type registered properties for this type.
    *
+   * This count does not include all properties
    * @return The count
    */
   size_t GetPropertyCount() const;
 
-  /**
-   * @brief Retrieve the property name for the index.
-   *
-   * @param[in] index Index to lookup
-   * @return property name or empty string where index is invalid
-   */
-  std::string GetPropertyName(size_t index);
-
   // Properties
 
   /**
@@ -192,6 +185,8 @@ public:
   /**
    * @brief Given a property index, retrieve the property name associated with it.
    *
+   * @exception DaliException If index is not valid.
+   *
    * @param[in] index The property index.
    * @return The name of the property at the given index.
    */