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 6368762075627768d579724510297e301b7cee62..1f080a71fb547bfb51d5c961d6a86015e6047e0b 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 19c5a8de9de7fd4a5a96b0f8af85ee6a2b99cdef..71756436bcb45216df3211efc1e6ec48331c2912 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 7efff5237323b896b122f1bde6844f6b6d6732ce..b73d9255cdb49c879560b9a756aed8030d595615 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 0aeb2f1faba62d2df6076f8ec5e69bdd33ad38ba..03d96dce3ead63b5000cd8b8783136a65a606954 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 4cb68b08a458c25b8978969e3d48a4ae9ddfed9c..e0f3bb972823655406c61c5053501f0d41328442 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.
    */