(AutomatedTests) Merged managed & unmanaged tests 07/35007/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 5 Feb 2015 19:37:46 +0000 (19:37 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 5 Feb 2015 19:37:46 +0000 (19:37 +0000)
Change-Id: Ice791189faca9e938edd6bf5492492e370a5e556

50 files changed:
automated-tests/README.md
automated-tests/packaging/core-dali-unmanaged-tests.spec [deleted file]
automated-tests/src/dali-internal/CMakeLists.txt
automated-tests/src/dali-unmanaged/CMakeLists.txt [deleted file]
automated-tests/src/dali-unmanaged/dali-test-suite-utils/test-platform-abstraction.cpp [deleted file]
automated-tests/src/dali-unmanaged/dali-test-suite-utils/test-platform-abstraction.h [deleted file]
automated-tests/src/dali-unmanaged/tct-dali-unmanaged-core.cpp [deleted file]
automated-tests/src/dali-unmanaged/utc-Dali-AnimatableMesh.cpp [deleted file]
automated-tests/src/dali-unmanaged/utc-Dali-CustomActor.cpp [deleted file]
automated-tests/src/dali-unmanaged/utc-Dali-MeshActor.cpp [deleted file]
automated-tests/src/dali-unmanaged/utc-Dali-RenderTask.cpp [deleted file]
automated-tests/src/dali-unmanaged/utc-Dali-ShaderEffect.cpp [deleted file]
automated-tests/src/dali/CMakeLists.txt
automated-tests/src/dali/dali-test-suite-utils/mesh-builder.cpp [moved from automated-tests/src/dali-unmanaged/dali-test-suite-utils/mesh-builder.cpp with 100% similarity]
automated-tests/src/dali/dali-test-suite-utils/mesh-builder.h [moved from automated-tests/src/dali-unmanaged/dali-test-suite-utils/mesh-builder.h with 100% similarity]
automated-tests/src/dali/dali-test-suite-utils/test-dynamics.cpp [moved from automated-tests/src/dali-unmanaged/dali-test-suite-utils/test-dynamics.cpp with 100% similarity]
automated-tests/src/dali/dali-test-suite-utils/test-dynamics.h [moved from automated-tests/src/dali-unmanaged/dali-test-suite-utils/test-dynamics.h with 100% similarity]
automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp
automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.h
automated-tests/src/dali/utc-Dali-AnimatableMesh.cpp
automated-tests/src/dali/utc-Dali-Constrainable.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-Constrainable.cpp with 96% similarity]
automated-tests/src/dali/utc-Dali-Context.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-Context.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-CustomActor.cpp
automated-tests/src/dali/utc-Dali-DistanceField.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-DistanceField.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-DynamicsBody.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-DynamicsBody.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-DynamicsBodyConfig.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-DynamicsBodyConfig.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-DynamicsJoint.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-DynamicsJoint.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-DynamicsShape.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-DynamicsShape.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-DynamicsWorld.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-DynamicsWorld.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-DynamicsWorldConfig.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-DynamicsWorldConfig.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-EncodedBufferImage.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-EncodedBufferImage.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-GlyphImage.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-GlyphImage.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-HitTestAlgorithm.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-HitTestAlgorithm.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-LightActor.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-LightActor.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-LocklessBuffer.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-LocklessBuffer.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-MeshActor.cpp
automated-tests/src/dali/utc-Dali-MeshData.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-MeshData.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-Model.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-Model.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-MouseWheelEvent.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-MouseWheelEvent.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-NinePatchImages.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-NinePatchImages.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-ObjectRegistry.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-ObjectRegistry.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-Random.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-Random.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-RenderTask.cpp
automated-tests/src/dali/utc-Dali-Scripting.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-Scripting.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-ShaderEffect.cpp
automated-tests/src/dali/utc-Dali-Spline.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-Spline.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-TypeRegistry.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-TypeRegistry.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-Utf8.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-Utf8.cpp with 100% similarity]
automated-tests/src/dali/utc-Dali-Vector.cpp [moved from automated-tests/src/dali-unmanaged/utc-Dali-Vector.cpp with 99% similarity]
build/tizen/dali-core/Makefile.am

index 2961ae1..e7a8af7 100644 (file)
@@ -5,7 +5,7 @@ Testing environment
 
 The new test environment from Tizen is the Web-TCT test suite. This was written for testing web components, but can easily be used for testing Dali.
 
-Each of the DALi repositories, **dali-core**, **dali-adaptor** and **dali-toolkit**, have their own test suites under the `automated-tests` folder. Within the src folder are a number of secondary folders - these correspond to 'managed' tests (for testing the frozen API for products), unmanaged tests (tests for other APIs) and internal (for desktop testing only)
+Each of the DALi repositories, **dali-core**, **dali-adaptor** and **dali-toolkit**, have their own test suites under the `automated-tests` folder. Within the src folder are a number of secondary folders - these correspond to 'API' tests  and internal (for desktop testing only)
 
 Installation
 ------------
@@ -64,11 +64,11 @@ Run the following commands:
     cd automated-tests
     ./build.sh
 
-This will build dali, dali-unmanaged and dali-internal test sets.
+This will build dali and dali-internal test sets.
 
 Test sets can be built individually:
 
-    ./build.sh dali-unmanaged
+    ./build.sh dali
 
 They can also be built without regenerating test case scripts (Useful for quicker rebuilds)
 
@@ -86,7 +86,7 @@ To execute tests, cd into automated-tests and run
 
     ./execute.sh
 
-This will execute dali, dali-unmanaged and dali-internal test sets. Note that the output summary for the first will be printed before running the second.
+This will execute dali and dali-internal test sets. Note that the output summary for the first will be printed before running the second.
 
 By default the tests execute in parallel, which is faster but does not produce a single output file (summary.xml).  Use this to execute the tests in series:
 
@@ -125,17 +125,14 @@ For core Dali cd into automated-tests, and use:
 
 sudo ./tcbuild build dali
 
-    sudo ./tcbuild build dali-unmanaged
+    sudo ./tcbuild build dali
     ./tcbuild install dali
-    ./tcbuild install dali-unmanaged
 
 For Dali Adaptor, cd into automated-tests, and use:
 
     sudo ./tcbuild build dali-adaptor
-    sudo ./tcbuild build dali-adaptor-unmanaged # < Currently failing as needs a ".spec" file.
     sudo ./tcbuild build dali-platform-abstraction
     ./tcbuild install dali-adaptor
-    ./tcbuild install dali-adaptor-unmanaged
     ./tcbuild install dali-platform-abstraction
 
 Ensure your handset's filesystem is writable:
@@ -146,7 +143,7 @@ To execute tests, cd into automated-tests and run
 
     tct-mgr
 
-This will bring up the java test suite program. You should see the Plan pane with a list of all tests in. Select the tct-dali-core-tests and tct-dali-unmanaged-tests. and you will be offered a dialog to choose a test plan: either create a new one or use temp.
+This will bring up the java test suite program. You should see the Plan pane with a list of all tests in. Select the tct-dali-core-tests. and you will be offered a dialog to choose a test plan: either create a new one or use temp.
 Select dali test suite, and click Run, then "Create a new plan", and call it "Dali-Core" or some such. It will now run the dali-test suite.
 
 You can find the output files under /opt/tct/manager/result/
@@ -160,11 +157,6 @@ To Managed API
 
 If you are adding test cases for new or existing managed API (CAPI), you need to add your changes to the src/dali mirror, and copy your change to the managed test suite in core-api. You need to inform HQ of your update.
 
-To Unmanaged API
-----------------
-
-If you are adding test cases for unmanaged API, you need to add your changes to the src/dali-unmanaged test suite.
-
 For internal API
 ----------------
 
@@ -203,9 +195,9 @@ On desktop, you can debug the tests by running gdb on the test program:
 
 replace `<TestCase>` with the name of the failing testcase.
 
-For example, using testcase UtcDaliNinePatch01 from the dali-core unmanaged test suite:
+For example, using testcase UtcDaliNinePatch01 from the dali-core test suite:
 
-    $ gdb build/src/dali-unmanaged/tct-dali-unmanaged-core
+    $ gdb build/src/dali/tct-dali-core
     gdb> r UtcDaliNinePatch01
 
 
diff --git a/automated-tests/packaging/core-dali-unmanaged-tests.spec b/automated-tests/packaging/core-dali-unmanaged-tests.spec
deleted file mode 100644 (file)
index 2af2c3a..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-%define MODULE_NAME dali-unmanaged
-%define MODULE_LIBNAME dali-unmanaged
-Name:       core-%{MODULE_NAME}-tests
-Summary:    Core API unit TC (%{name})
-Version:    0.1
-Release:    0
-Group:      Development/Tools
-License:    Apache License, Version 2.0, Samsung Properietary
-Source0:    %{name}-%{version}.tar.gz
-Requires: dali
-BuildRequires:  dali-devel
-BuildRequires:  dali-integration-devel
-BuildRequires:  pkgconfig(dali-core)
-BuildRequires:  pkgconfig(dali)
-BuildRequires:  boost-devel
-BuildRequires:  libxml2-devel
-BuildRequires:  cmake
-
-%description
-Core API unit TC (%{name})
-
-%prep
-%setup -q
-
-%build
-
-%define PREFIX "%{_libdir}/%{name}"
-
-export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed"
-cd automated-tests
-cmake . -DMODULE="%{MODULE_NAME}" -DCMAKE_INSTALL_PREFIX=%{_prefix}
-
-make %{?jobs:-j%jobs}
-
-%install
-rm -rf %{buildroot}
-cd automated-tests
-%make_install
-mkdir -p %{buildroot}/opt/usr/share/license
-cp %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/opt/usr/share/license/%{name}
-mkdir -p %{buildroot}/tmp/
-cp %{_builddir}/%{name}-%{version}/automated-tests/scripts/add_all_smack_rule.sh %{buildroot}/tmp/
-cp %{_builddir}/%{name}-%{version}/automated-tests/scripts/all_smack.rule %{buildroot}/tmp/
-
-%post
-
-%postun
-
-
-%files
-/opt/usr/bin/*
-/opt/usr/share/license/%{name}
-/tmp/add_all_smack_rule.sh
-/tmp/all_smack.rule
index 0b53213..4eb0052 100644 (file)
@@ -19,9 +19,11 @@ SET(TC_SOURCES
 )
 
 LIST(APPEND TC_SOURCES
+        ../dali/dali-test-suite-utils/mesh-builder.cpp
         ../dali/dali-test-suite-utils/test-harness.cpp
         ../dali/dali-test-suite-utils/dali-test-suite-utils.cpp
         ../dali/dali-test-suite-utils/test-application.cpp
+        ../dali/dali-test-suite-utils/test-dynamics.cpp
         ../dali/dali-test-suite-utils/test-gesture-manager.cpp
         ../dali/dali-test-suite-utils/test-gl-abstraction.cpp
         ../dali/dali-test-suite-utils/test-gl-sync-abstraction.cpp
@@ -29,7 +31,6 @@ LIST(APPEND TC_SOURCES
         ../dali/dali-test-suite-utils/test-platform-abstraction.cpp
         ../dali/dali-test-suite-utils/test-render-controller.cpp
         ../dali/dali-test-suite-utils/test-trace-call-stack.cpp
-        ../dali-unmanaged/dali-test-suite-utils/mesh-builder.cpp
 )
 
 PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
@@ -45,7 +46,6 @@ ENDFOREACH(directory ${CAPI_LIB_LIBRARY_DIRS})
 INCLUDE_DIRECTORIES(
     ${${CAPI_LIB}_INCLUDE_DIRS}
     ../dali/dali-test-suite-utils
-    ../dali-unmanaged/dali-test-suite-utils
     ../../..
 )
 
diff --git a/automated-tests/src/dali-unmanaged/CMakeLists.txt b/automated-tests/src/dali-unmanaged/CMakeLists.txt
deleted file mode 100644 (file)
index e83d442..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-SET(PKG_NAME "dali-unmanaged")
-
-SET(EXEC_NAME "tct-${PKG_NAME}-core")
-SET(RPM_NAME "core-${PKG_NAME}-tests")
-
-SET(CAPI_LIB "dali-unmanaged")
-
-SET(TC_SOURCES
-  utc-Dali-Constrainable.cpp
-  utc-Dali-Context.cpp
-  utc-Dali-CustomActor.cpp
-  utc-Dali-DistanceField.cpp
-  utc-Dali-DynamicsBody.cpp
-  utc-Dali-DynamicsBodyConfig.cpp
-  utc-Dali-DynamicsJoint.cpp
-  utc-Dali-DynamicsShape.cpp
-  utc-Dali-DynamicsWorld.cpp
-  utc-Dali-DynamicsWorldConfig.cpp
-  utc-Dali-EncodedBufferImage.cpp
-  utc-Dali-HitTestAlgorithm.cpp
-  utc-Dali-LightActor.cpp
-  utc-Dali-LocklessBuffer.cpp
-  utc-Dali-MeshActor.cpp
-  utc-Dali-MeshData.cpp
-  utc-Dali-Model.cpp
-  utc-Dali-MouseWheelEvent.cpp
-  utc-Dali-NinePatchImages.cpp
-  utc-Dali-ObjectRegistry.cpp
-  utc-Dali-Random.cpp
-  utc-Dali-RenderTask.cpp
-  utc-Dali-ShaderEffect.cpp
-  utc-Dali-Scripting.cpp
-  utc-Dali-Spline.cpp
-  utc-Dali-TypeRegistry.cpp
-  utc-Dali-Utf8.cpp
-  utc-Dali-Vector.cpp
-)
-
-LIST(APPEND TC_SOURCES
-        dali-test-suite-utils/mesh-builder.cpp
-        dali-test-suite-utils/test-dynamics.cpp
-        dali-test-suite-utils/test-platform-abstraction.cpp
-        ../dali/dali-test-suite-utils/test-harness.cpp
-        ../dali/dali-test-suite-utils/dali-test-suite-utils.cpp
-        ../dali/dali-test-suite-utils/test-application.cpp
-        ../dali/dali-test-suite-utils/test-gesture-manager.cpp
-        ../dali/dali-test-suite-utils/test-gl-abstraction.cpp
-        ../dali/dali-test-suite-utils/test-gl-sync-abstraction.cpp
-        ../dali/dali-test-suite-utils/test-native-image.cpp
-        ../dali/dali-test-suite-utils/test-render-controller.cpp
-        ../dali/dali-test-suite-utils/test-trace-call-stack.cpp
-)
-
-PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
-    dali-core
-)
-
-SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -DDEBUG_ENABLED -Wall -Werror=return-type")
-
-FOREACH(directory ${${CAPI_LIB}_LIBRARY_DIRS})
-    SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -L${directory}")
-ENDFOREACH(directory ${CAPI_LIB_LIBRARY_DIRS})
-
-INCLUDE_DIRECTORIES(
-    ${${CAPI_LIB}_INCLUDE_DIRS}
-    dali-test-suite-utils
-    ../dali/dali-test-suite-utils
-)
-
-ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
-TARGET_LINK_LIBRARIES(${EXEC_NAME}
-    ${${CAPI_LIB}_LIBRARIES}
-)
-
-INSTALL(PROGRAMS ${EXEC_NAME}
-    DESTINATION ${BIN_DIR}/${EXEC_NAME}
-)
diff --git a/automated-tests/src/dali-unmanaged/dali-test-suite-utils/test-platform-abstraction.cpp b/automated-tests/src/dali-unmanaged/dali-test-suite-utils/test-platform-abstraction.cpp
deleted file mode 100644 (file)
index d5f24ab..0000000
+++ /dev/null
@@ -1,639 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test-platform-abstraction.h"
-#include "dali-test-suite-utils.h"
-#include <dali/integration-api/bitmap.h>
-
-namespace Dali
-{
-
-/**
- * Constructor
- */
-TestPlatformAbstraction::TestPlatformAbstraction()
-: mRequest(0),
-  mDynamicsFactory(NULL)
-{
-  Initialize();
-}
-
-/**
- * Destructor
- */
-TestPlatformAbstraction::~TestPlatformAbstraction()
-{
-  delete mDynamicsFactory;
-}
-
-/**
- * @copydoc PlatformAbstraction::GetTimeMicroseconds()
- */
-void TestPlatformAbstraction::GetTimeMicroseconds(unsigned int &seconds, unsigned int &microSeconds)
-{
-  seconds = mSeconds;
-  microSeconds = mMicroSeconds;
-  mTrace.PushCall("GetTimeMicroseconds", "");
-}
-
-/**
- * @copydoc PlatformAbstraction::Suspend()
- */
-void TestPlatformAbstraction::Suspend()
-{
-  mTrace.PushCall("Suspend", "");
-}
-
-/**
- * @copydoc PlatformAbstraction::Resume()
- */
-void TestPlatformAbstraction::Resume()
-{
-  mTrace.PushCall("Resume", "");
-}
-
-void TestPlatformAbstraction::GetClosestImageSize( const std::string& filename,
-                                                   const ImageAttributes& attributes,
-                                                   Vector2& closestSize)
-{
-  closestSize = mClosestSize;
-  mTrace.PushCall("GetClosestImageSize", "");
-}
-
-void TestPlatformAbstraction::GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
-                                                   const ImageAttributes& attributes,
-                                                   Vector2& closestSize)
-{
-  closestSize = mClosestSize;
-  mTrace.PushCall("GetClosestImageSize", "");
-}
-
-
-/**
- * @copydoc PlatformAbstraction::LoadResource()
- */
-void TestPlatformAbstraction::LoadResource(const Integration::ResourceRequest& request)
-{
-  mTrace.PushCall("LoadResource", "");
-  if(mRequest != NULL)
-  {
-    delete mRequest;
-    tet_infoline ("Warning: multiple resource requests not handled by Test Suite. You may see unexpected errors");
-  }
-  mRequest = new Integration::ResourceRequest(request);
-}
-
-Integration::ResourcePointer TestPlatformAbstraction::LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath)
-{
-  mTrace.PushCall("LoadResourceSynchronously", "");
-  return mResources.loadedResource;
-}
-
-/**
- * @copydoc PlatformAbstraction::SaveResource()
- */
-void TestPlatformAbstraction::SaveResource(const Integration::ResourceRequest& request)
-{
-  mTrace.PushCall("SaveResource", "");
-  if(mRequest != NULL)
-  {
-    delete mRequest;
-    tet_infoline ("Warning: multiple resource requests not handled by Test Suite. You may see unexpected errors");
-  }
-  mRequest = new Integration::ResourceRequest(request);
-}
-
-/**
- * @copydoc PlatformAbstraction::CancelLoad()
- */
-void TestPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId)
-{
-  mTrace.PushCall("CancelLoad", "");
-}
-
-/**
- * @copydoc PlatformAbstraction::GetResources()
- */
-void TestPlatformAbstraction::GetResources(Integration::ResourceCache& cache)
-{
-  mTrace.PushCall("GetResources", "");
-
-  if(mResources.loaded)
-  {
-    cache.LoadResponse( mResources.loadedId, mResources.loadedType, mResources.loadedResource, Integration::RESOURCE_COMPLETELY_LOADED );
-  }
-  if(mResources.loadFailed)
-  {
-    cache.LoadFailed( mResources.loadFailedId, mResources.loadFailure );
-  }
-  if(mResources.saved)
-  {
-    cache.SaveComplete( mResources.savedId, mResources.savedType );
-  }
-  if(mResources.saveFailed)
-  {
-    cache.SaveFailed( mResources.saveFailedId, mResources.saveFailure );
-  }
-}
-
-/**
- * @copydoc PlatformAbstraction::IsLoading()
- */
-bool TestPlatformAbstraction::IsLoading()
-{
-  mTrace.PushCall("IsLoading", "");
-  return mIsLoadingResult;
-}
-
-/**
- * @copydoc PlatformAbstraction::GetDefaultFontFamily()
- */
-const std::string& TestPlatformAbstraction::GetDefaultFontFamily() const
-{
-  mTrace.PushCall("GetDefaultFontFamily", "");
-  return mGetDefaultFontFamilyResult;
-}
-
-/**
- * @copydoc PlatformAbstraction::GetDefaultFontSize()
- */
-float TestPlatformAbstraction::GetDefaultFontSize() const
-{
-  mTrace.PushCall("GetDefaultFontSize", "");
-  return mGetDefaultFontSizeResult;
-}
-
-PixelSize TestPlatformAbstraction::GetFontLineHeightFromCapsHeight(const std::string& fontFamily, const std::string& fontStyle, CapsHeight capsHeight) const
-{
-  mTrace.PushCall("GetFontLineHeightFromCapsHeight", "");
-  // LineHeight will be bigger than CapsHeight, so return capsHeight + 1
-  return PixelSize(capsHeight + 1);
-}
-
-/**
- * @copydoc PlatformAbstraction::GetGlyphData()
- */
-
-Integration::GlyphSet* TestPlatformAbstraction::GetGlyphData ( const Integration::TextResourceType& textRequest,
-                                                               const std::string& fontFamily,
-                                                               bool getBitmap) const
-{
-  if( getBitmap )
-  {
-    mTrace.PushCall("GetGlyphData", "getBitmap:true");
-  }
-  else
-  {
-    mTrace.PushCall("GetGlyphData", "getBitmap:false");
-  }
-
-  // It creates fake metrics for the received characters.
-
-  Integration::GlyphSet* set = new Dali::Integration::GlyphSet();
-  Integration::BitmapPtr bitmapData;
-
-  std::set<uint32_t> characters;
-
-  for( Integration::TextResourceType::CharacterList::const_iterator it = textRequest.mCharacterList.begin(), endIt = textRequest.mCharacterList.end(); it != endIt; ++it )
-  {
-    if( characters.find( it->character ) == characters.end() )
-    {
-      characters.insert( it->character );
-      Integration::GlyphMetrics character = {it->character, Integration::GlyphMetrics::LOW_QUALITY,  10.0f,  10.0f, 9.0f, 1.0f, 10.0f, it->xPosition, it->yPosition };
-
-      if( getBitmap )
-      {
-        bitmapData = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD);
-        bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64);
-        PixelBuffer* pixelBuffer = bitmapData->GetBuffer();
-        memset( pixelBuffer, it->character, 64*64 );
-      }
-
-      set->AddCharacter(bitmapData, character);
-    }
-  }
-
-  set->mLineHeight = 10.0f;
-  set->mAscender = 9.0f;
-  set->mUnitsPerEM = 2048.0f/64.0f;
-  set->SetAtlasResourceId( textRequest.mTextureAtlasId );
-  set->mFontHash = textRequest.mFontHash;
-
-  return set;
-}
-
-/**
- * @copydoc PlatformAbstraction::GetCachedGlyphData()
- */
-
-Integration::GlyphSet* TestPlatformAbstraction::GetCachedGlyphData( const Integration::TextResourceType& textRequest,
-                                                                    const std::string& fontFamily ) const
-{
-  mTrace.PushCall("GetCachedGlyphData", "");
-
-  // It creates fake metrics and bitmap for received numeric characters '0' through '9'.
-  Integration::GlyphSet* set = new Dali::Integration::GlyphSet();
-  Integration::BitmapPtr bitmapData;
-
-  std::set<uint32_t> characters;
-
-  for( Integration::TextResourceType::CharacterList::const_iterator it = textRequest.mCharacterList.begin(), endIt = textRequest.mCharacterList.end(); it != endIt; ++it )
-  {
-    if( it->character >= '0' && it->character <= '9' && characters.find( it->character ) == characters.end() )
-    {
-      characters.insert( it->character );
-      Integration::GlyphMetrics character = {it->character, Integration::GlyphMetrics::HIGH_QUALITY,  10.0f,  10.0f, 9.0f, 1.0f, 10.0f, it->xPosition, it->yPosition };
-
-      bitmapData = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD);
-      bitmapData->GetPackedPixelsProfile()->ReserveBuffer(Pixel::A8, 64, 64);
-      PixelBuffer* pixelBuffer = bitmapData->GetBuffer();
-      memset( pixelBuffer, it->character, 64*64 );
-      set->AddCharacter(bitmapData, character);
-    }
-  }
-
-  set->mLineHeight = 10.0f;
-  set->mAscender = 9.0f;
-  set->mUnitsPerEM = 2048.0f/64.0f;
-  set->SetAtlasResourceId( textRequest.mTextureAtlasId );
-  set->mFontHash = textRequest.mFontHash;
-
-  return set;
-}
-
-
-/**
- * @copydoc PlatformAbstraction::GetGlobalMetrics()
- */
-void TestPlatformAbstraction::GetGlobalMetrics( const std::string& fontFamily,
-                                                const std::string& fontStyle,
-                                                Integration::GlobalMetrics& globalMetrics ) const
-{
-  globalMetrics.lineHeight = 10.0f;
-  globalMetrics.ascender = 9.0f;
-  globalMetrics.unitsPerEM = 2048.0f/64.0f;
-  globalMetrics.underlineThickness = 2.f;
-  globalMetrics.underlinePosition = 1.f;
-}
-
-/**
- * @copydoc PlatformAbstraction::GetFontPath()
- */
-std::string TestPlatformAbstraction::GetFontPath(const std::string& family, bool bold, bool italic) const
-{
-  mTrace.PushCall("GetFontPath", "");
-  return mGetFontPathResult;
-
-  // Do nothing with arguments
-}
-
-/**
- * @copydoc PlatformAbstraction::SetDpi()
- */
-void TestPlatformAbstraction::SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical)
-{
-  mTrace.PushCall("SetDpi", "");
-}
-
-/**
- * @copydoc PlatformAbstraction::GetFontFamilyForChars()
- */
-const std::string& TestPlatformAbstraction::GetFontFamilyForChars(const Integration::TextArray& charsRequested) const
-{
-  mTrace.PushCall("GetFontFamilyForChars", "");
-  return mGetDefaultFontFamilyResult;
-}
-
-/**
- * @copydoc PlatformAbstraction::AllGlyphsSupported()
- */
-bool TestPlatformAbstraction::AllGlyphsSupported(const std::string& name, const std::string& fontStyle, const Integration::TextArray& text) const
-{
-  mTrace.PushCall("AllGlyphsSupported", "");
-  return true;
-}
-
-/**
- * @copydoc PlatformAbstraction::ValidateFontFamilyName()
- */
-bool TestPlatformAbstraction::ValidateFontFamilyName(const std::string& fontFamily, const std::string& fontStyle, bool& isDefaultSystemFont, std::string& closestMatch, std::string& closestStyleMatch) const
-{
-  mTrace.PushCall("ValidateFontFamilyName", "");
-  return true;
-}
-
-/**
- * @copydoc PlatformAbstraction::GetFontList()
- */
-void TestPlatformAbstraction::GetFontList( PlatformAbstraction::FontListMode mode, std::vector<std::string>& fontList ) const
-{
-  mFontListMode = mode;
-  mTrace.PushCall("ValidateGetFontList", "");
-}
-
-/**
- * @copydoc PlatformAbstraction::LoadFile()
- */
-bool TestPlatformAbstraction::LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
-{
-  mTrace.PushCall("LoadFile", "");
-  if( mLoadFileResult.loadResult )
-  {
-    buffer = mLoadFileResult.buffer;
-  }
-
-  return mLoadFileResult.loadResult;
-}
-
-/**
- * @copydoc PlatformAbstraction::SaveFile()
- */
-bool TestPlatformAbstraction::SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const
-{
-  mTrace.PushCall("SaveFile", "");
-  return false;
-}
-
-void TestPlatformAbstraction::JoinLoaderThreads()
-{
-  mTrace.PushCall("JoinLoaderThreads", "");
-}
-
-void TestPlatformAbstraction::UpdateDefaultsFromDevice()
-{
-  mTrace.PushCall("UpdateDefaultsFromDevice", "");
-  mGetDefaultFontFamilyResult+=1.0f;
-}
-
-Integration::DynamicsFactory* TestPlatformAbstraction::GetDynamicsFactory()
-{
-  mTrace.PushCall("GetDynamicsFactory", "");
-  if( mDynamicsFactory == NULL )
-  {
-    mDynamicsFactory = new TestDynamicsFactory( mTrace );
-  }
-  return mDynamicsFactory;
-}
-
-bool TestPlatformAbstraction::ReadGlobalMetricsFromCache( const std::string& fontFamily,
-                                                          const std::string& fontStyle,
-                                                          Integration::GlobalMetrics& globalMetrics )
-{
-  mTrace.PushCall("ReadGlobalMetricsFromCacheFile", "");
-  globalMetrics = mReadGlobalMetrics; // Want to copy contents...
-  return mReadGlobalMetricsResult; // Default false (will be set to true on subsequent write)
-}
-
-void TestPlatformAbstraction::WriteGlobalMetricsToCache( const std::string& fontFamily,
-                                                         const std::string& fontStyle,
-                                                         const Integration::GlobalMetrics& globalMetrics )
-{
-  // Copy so next read uses written values. TODO: Could add method
-  // to turn this behaviour off for more extensive testing.
-  mReadGlobalMetrics = globalMetrics;
-  mReadGlobalMetricsResult = true;
-
-  mTrace.PushCall("WriteGlobalMetricsToCacheFile", "");
-}
-
-bool TestPlatformAbstraction::ReadMetricsFromCache( const std::string& fontFamily,
-                                                    const std::string& fontStyle,
-                                                    std::vector<Integration::GlyphMetrics>& glyphMetricsContainer )
-{
-  mTrace.PushCall("ReadMetricsFromCacheFile", "");
-  glyphMetricsContainer = mReadMetrics;
-  return mReadMetricsResult; // Default false (will be set to true on subsequent write)
-}
-
-void TestPlatformAbstraction::WriteMetricsToCache( const std::string& fontFamily,
-                                                   const std::string& fontStyle,
-                                                   const Integration::GlyphSet& glyphSet )
-{
-  // Copy so next read uses written values. TODO: Could add method
-  // to turn this behaviour off for more extensive testing.
-  const Integration::GlyphSet::CharacterList& charList =  glyphSet.GetCharacterList();
-  mReadMetrics.clear();
-  for(std::size_t i=0, end=charList.size(); i<end; ++i)
-  {
-    mReadMetrics.push_back(charList[i].second);
-  }
-  mReadMetricsResult = true;
-
-  mTrace.PushCall("WriteMetricsToCacheFile", "");
-}
-
-void TestPlatformAbstraction::GetFileNamesFromDirectory( const std::string& directoryName,
-                                                         std::vector<std::string>& fileNames )
-{
-  fileNames.push_back( std::string( "u1f004.png" ) );
-  fileNames.push_back( std::string( "u1f0cf.png" ) );
-  fileNames.push_back( std::string( "u1f170.png" ) );
-  fileNames.push_back( std::string( "u1f601.png" ) );
-}
-
-Integration::BitmapPtr TestPlatformAbstraction::GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character ) const
-{
-  Integration::BitmapPtr image = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD );
-  image->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 1, 1 );
-
-  mTrace.PushCall("GetGlyphImage", "");
-
-  return image;
-}
-
-/** Call this every test */
-void TestPlatformAbstraction::Initialize()
-{
-  mTrace.Reset();
-  mTrace.Enable(true);
-  memset(&mResources, 0, sizeof(Resources));
-  memset(&mReadGlobalMetrics, 0, sizeof(Integration::GlobalMetrics));
-  mSeconds=0;
-  mMicroSeconds=0;
-  mIsLoadingResult=false;
-  mGetDefaultFontFamilyResult = "HelveticaNeue";
-  mGetDefaultFontSizeResult=12.0f;
-  mGetFontPathResult="helvetica-12";
-  mReadMetricsResult=false;
-  mReadGlobalMetricsResult=false;
-
-  if(mRequest)
-  {
-    delete mRequest;
-    mRequest = 0;
-  }
-}
-
-
-bool TestPlatformAbstraction::WasCalled(TestFuncEnum func)
-{
-  switch(func)
-  {
-    case GetTimeMicrosecondsFunc:             return mTrace.FindMethod("GetTimeMicroseconds");
-    case SuspendFunc:                         return mTrace.FindMethod("Suspend");
-    case ResumeFunc:                          return mTrace.FindMethod("Resume");
-    case LoadResourceFunc:                    return mTrace.FindMethod("LoadResource");
-    case SaveResourceFunc:                    return mTrace.FindMethod("SaveResource");
-    case LoadFileFunc:                        return mTrace.FindMethod("LoadFile");
-    case SaveFileFunc:                        return mTrace.FindMethod("SaveFile");
-    case CancelLoadFunc:                      return mTrace.FindMethod("CancelLoad");
-    case GetResourcesFunc:                    return mTrace.FindMethod("GetResources");
-    case IsLoadingFunc:                       return mTrace.FindMethod("IsLoading");
-    case GetDefaultFontFamilyFunc:            return mTrace.FindMethod("GetDefaultFontFamily");
-    case GetDefaultFontSizeFunc:              return mTrace.FindMethod("GetDefaultFontSize");
-    case GetFontLineHeightFromCapsHeightFunc: return mTrace.FindMethod("GetFontLineHeightFromCapsHeight");
-    case GetGlyphDataFunc:                    return mTrace.FindMethod("GetGlyphData");
-    case GetCachedGlyphDataFunc:              return mTrace.FindMethod("GetCachedGlyphData");
-    case GetFontPathFunc:                     return mTrace.FindMethod("GetFontPath");
-    case SetDpiFunc:                          return mTrace.FindMethod("SetDpi");
-    case JoinLoaderThreadsFunc:               return mTrace.FindMethod("JoinLoaderThreads");
-    case GetFontFamilyForCharsFunc:           return mTrace.FindMethod("GetFontFamilyForChars");
-    case AllGlyphsSupportedFunc:              return mTrace.FindMethod("AllGlyphsSupported");
-    case ValidateFontFamilyNameFunc:          return mTrace.FindMethod("ValidateFontFamilyName");
-    case UpdateDefaultsFromDeviceFunc:        return mTrace.FindMethod("UpdateDefaultsFromDevice");
-    case GetDynamicsFactoryFunc:              return mTrace.FindMethod("GetDynamicsFactory");
-    case ValidateGetFontListFunc:             return mTrace.FindMethod("ValidateGetFontList");
-    case ReadGlobalMetricsFromCacheFileFunc:  return mTrace.FindMethod("ReadGlobalMetricsFromCacheFile");
-    case WriteGlobalMetricsToCacheFileFunc:   return mTrace.FindMethod("WriteGlobalMetricsToCacheFile");
-    case ReadMetricsFromCacheFileFunc:        return mTrace.FindMethod("ReadMetricsFromCacheFile");
-    case WriteMetricsToCacheFileFunc:         return mTrace.FindMethod("WriteMetricsToCacheFile");
-  }
-  return false;
-}
-
-void TestPlatformAbstraction::SetGetTimeMicrosecondsResult(size_t sec, size_t usec)
-{
-  mSeconds = sec;
-  mMicroSeconds = usec;
-}
-
-void TestPlatformAbstraction::IncrementGetTimeResult(size_t milliseconds)
-{
-  mMicroSeconds += milliseconds * 1000u;
-  unsigned int additionalSeconds = mMicroSeconds / 1000000u;
-
-  mSeconds += additionalSeconds;
-  mMicroSeconds -= additionalSeconds * 1000000u;
-}
-
-void TestPlatformAbstraction::SetIsLoadingResult(bool result)
-{
-  mIsLoadingResult = result;
-}
-
-void TestPlatformAbstraction::SetGetDefaultFontFamilyResult(std::string result)
-{
-  mGetDefaultFontFamilyResult = result;
-}
-
-void TestPlatformAbstraction::SetGetDefaultFontSizeResult(float result)
-{
-  mGetDefaultFontSizeResult = result;
-}
-
-void TestPlatformAbstraction::SetGetFontPathResult(std::string& result)
-{
-  mGetFontPathResult = result;
-}
-
-void TestPlatformAbstraction::ClearReadyResources()
-{
-  memset(&mResources, 0, sizeof(Resources));
-}
-
-void TestPlatformAbstraction::SetResourceLoaded(Integration::ResourceId  loadedId,
-                                                Integration::ResourceTypeId  loadedType,
-                                                Integration::ResourcePointer loadedResource)
-{
-  mResources.loaded = true;
-  mResources.loadedId = loadedId;
-  mResources.loadedType = loadedType;
-  mResources.loadedResource = loadedResource;
-}
-
-void TestPlatformAbstraction::SetResourceLoadFailed(Integration::ResourceId  id,
-                                                    Integration::ResourceFailure failure)
-{
-  mResources.loadFailed = true;
-  mResources.loadFailedId = id;
-  mResources.loadFailure = failure;
-}
-
-void TestPlatformAbstraction::SetResourceSaved(Integration::ResourceId      savedId,
-                                               Integration::ResourceTypeId  savedType)
-{
-  mResources.saved = true;
-  mResources.savedId = savedId;
-  mResources.savedType = savedType;
-}
-
-void TestPlatformAbstraction::SetResourceSaveFailed(Integration::ResourceId  id,
-                                                    Integration::ResourceFailure failure)
-{
-  mResources.saveFailed = true;
-  mResources.saveFailedId = id;
-  mResources.saveFailure = failure;
-}
-
-Integration::ResourceRequest* TestPlatformAbstraction::GetRequest()
-{
-  return mRequest;
-}
-
-void TestPlatformAbstraction::DiscardRequest()
-{
-  delete mRequest;
-  mRequest = NULL;
-}
-
-void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
-{
-  mClosestSize = size;
-}
-
-void TestPlatformAbstraction::SetLoadFileResult( bool result, std::vector< unsigned char >& buffer )
-{
-  mLoadFileResult.loadResult = result;
-  if( result )
-  {
-    mLoadFileResult.buffer = buffer;
-  }
-}
-
-void TestPlatformAbstraction::SetSaveFileResult( bool result )
-{
-  mSaveFileResult = result;
-}
-
-Integration::PlatformAbstraction::FontListMode TestPlatformAbstraction::GetLastFontListMode( )
-{
-  return mFontListMode;
-}
-
-void TestPlatformAbstraction::SetReadGlobalMetricsResult( bool success, Integration::GlobalMetrics& globalMetrics )
-{
-  mReadGlobalMetricsResult = success;
-  mReadGlobalMetrics = globalMetrics;
-}
-
-void TestPlatformAbstraction::SetReadMetricsResult( bool success, std::vector<Integration::GlyphMetrics>& glyphMetricsContainer )
-{
-  mReadMetricsResult = success;
-  mReadMetrics = glyphMetricsContainer; // copy
-}
-
-} // namespace Dali
diff --git a/automated-tests/src/dali-unmanaged/dali-test-suite-utils/test-platform-abstraction.h b/automated-tests/src/dali-unmanaged/dali-test-suite-utils/test-platform-abstraction.h
deleted file mode 100644 (file)
index e8614ec..0000000
+++ /dev/null
@@ -1,350 +0,0 @@
-#ifndef __DALI_TEST_PLATFORM_ABSTRACTION_H__
-#define __DALI_TEST_PLATFORM_ABSTRACTION_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <stdint.h>
-#include <cstring>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/set-wrapper.h>
-#include <dali/integration-api/platform-abstraction.h>
-
-#include <dali/integration-api/glyph-set.h>
-#include "test-trace-call-stack.h"
-#include "test-dynamics.h"
-
-namespace Dali
-{
-
-/**
- * Concrete implementation of the platform abstraction class.
- */
-class DALI_IMPORT_API TestPlatformAbstraction : public Dali::Integration::PlatformAbstraction
-{
-
-public:
-
-  struct Resources
-  {
-    bool                         loaded;
-    Integration::ResourceId      loadedId;
-    Integration::ResourceTypeId  loadedType;
-    Integration::ResourcePointer loadedResource;
-
-    bool                         loadFailed;
-    Integration::ResourceId      loadFailedId;
-    Integration::ResourceFailure loadFailure;
-
-    bool                         saved;
-    Integration::ResourceId      savedId;
-    Integration::ResourceTypeId  savedType;
-
-    bool                         saveFailed;
-    Integration::ResourceId      saveFailedId;
-    Integration::ResourceFailure saveFailure;
-  };
-
-  struct LoadFileResult
-  {
-    inline LoadFileResult()
-    : loadResult(false)
-    {
-
-    }
-
-    bool loadResult;
-    std::vector< unsigned char> buffer;
-  };
-
-  /**
-   * Constructor
-   */
-  TestPlatformAbstraction();
-
-  /**
-   * Destructor
-   */
-  virtual ~TestPlatformAbstraction();
-
-  /**
-   * @copydoc PlatformAbstraction::GetTimeMicroseconds()
-   */
-  virtual void GetTimeMicroseconds(unsigned int &seconds, unsigned int &microSeconds);
-
-  /**
-   * @copydoc PlatformAbstraction::Suspend()
-   */
-  virtual void Suspend();
-
-  /**
-   * @copydoc PlatformAbstraction::Resume()
-   */
-  virtual void Resume();
-
-  virtual void GetClosestImageSize( const std::string& filename,
-                                    const ImageAttributes& attributes,
-                                    Vector2& closestSize);
-
-  virtual void GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
-                                    const ImageAttributes& attributes,
-                                    Vector2& closestSize);
-
-  /**
-   * @copydoc PlatformAbstraction::LoadResource()
-   */
-  virtual void LoadResource(const Integration::ResourceRequest& request);
-
-  virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath);
-
-  /**
-   * @copydoc PlatformAbstraction::SaveResource()
-   */
-  virtual void SaveResource(const Integration::ResourceRequest& request);
-
-  /**
-   * @copydoc PlatformAbstraction::CancelLoad()
-   */
-  virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
-
-  /**
-   * @copydoc PlatformAbstraction::GetResources()
-   */
-  virtual void GetResources(Integration::ResourceCache& cache);
-
-  /**
-   * @copydoc PlatformAbstraction::IsLoading()
-   */
-  virtual bool IsLoading();
-
-  /**
-   * @copydoc PlatformAbstraction::GetDefaultFontFamily()
-   */
-  virtual const std::string& GetDefaultFontFamily() const;
-
-  /**
-   * @copydoc PlatformAbstraction::GetDefaultFontSize()
-   */
-  virtual float GetDefaultFontSize() const;
-
-  /**
-   * @copydoc PlatformAbstraction::GetFontLineHeightFromCapsHeight()
-   */
-  virtual PixelSize GetFontLineHeightFromCapsHeight(const std::string& fontFamily, const std::string& fontStyle, CapsHeight capsHeight) const;
-
-  /**
-   * @copydoc PlatformAbstraction::GetGlyphData()
-   */
-  virtual Integration::GlyphSet* GetGlyphData ( const Integration::TextResourceType& textRequest,
-                                                const std::string& fontFamily,
-                                                bool getBitmap) const;
-
-  /**
-   * @copydoc PlatformAbstraction::GetCachedGlyphData()
-   */
-  virtual Integration::GlyphSet* GetCachedGlyphData( const Integration::TextResourceType& textRequest,
-                                                     const std::string& fontFamily ) const;
-
-
-  /**
-   * @copydoc PlatformAbstraction::GetGlobalMetrics()
-   */
-  virtual void GetGlobalMetrics( const std::string& fontFamily,
-                                 const std::string& fontStyle,
-                                 Integration::GlobalMetrics& globalMetrics ) const;
-
-  /**
-   * @copydoc PlatformAbstraction::GetFontPath()
-   */
-  virtual std::string GetFontPath(const std::string& family, bool bold, bool italic) const;
-
-  /**
-   * @copydoc PlatformAbstraction::SetDpi()
-   */
-  virtual void SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical);
-
-  /**
-   * @copydoc PlatformAbstraction::GetFontFamilyForChars()
-   */
-  virtual const std::string& GetFontFamilyForChars(const Integration::TextArray& charsRequested) const;
-
-  /**
-   * @copydoc PlatformAbstraction::AllGlyphsSupported()
-   */
-  virtual bool AllGlyphsSupported(const std::string& name, const std::string& fontStyle, const Integration::TextArray& text) const;
-
-  /**
-   * @copydoc PlatformAbstraction::ValidateFontFamilyName()
-   */
-  virtual bool ValidateFontFamilyName(const std::string& fontFamily, const std::string& fontStyle, bool& isDefaultSystemFont, std::string& closestMatch, std::string& closestStyleMatch) const;
-
-  /**
-   * @copydoc PlatformAbstraction::GetFontList()
-   */
-  virtual void GetFontList( PlatformAbstraction::FontListMode mode, std::vector<std::string>& fontList ) const;
-
-  /**
-   * @copydoc PlatformAbstraction::LoadFile()
-   */
-  virtual bool LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
-
-  /**
-   * @copydoc PlatformAbstraction::SaveFile()
-   */
-  virtual bool SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const;
-
-  virtual void JoinLoaderThreads();
-
-  virtual void UpdateDefaultsFromDevice();
-
-  virtual Integration::DynamicsFactory* GetDynamicsFactory();
-
-  virtual bool ReadGlobalMetricsFromCache( const std::string& fontFamily,
-                                           const std::string& fontStyle,
-                                           Integration::GlobalMetrics& globalMetrics );
-
-  virtual void WriteGlobalMetricsToCache( const std::string& fontFamily,
-                                          const std::string& fontStyle,
-                                          const Integration::GlobalMetrics& globalMetrics );
-
-  virtual bool ReadMetricsFromCache( const std::string& fontFamily,
-                                     const std::string& fontStyle,
-                                     std::vector<Integration::GlyphMetrics>& glyphMetricsContainer );
-  virtual void WriteMetricsToCache( const std::string& fontFamily,
-                                    const std::string& fontStyle,
-                                    const Integration::GlyphSet& glyphSet );
-
-  virtual void GetFileNamesFromDirectory( const std::string& directoryName,
-                                          std::vector<std::string>& fileNames );
-
-  virtual Integration::BitmapPtr GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character ) const;
-
-public: // TEST FUNCTIONS
-
-  // Enumeration of Platform Abstraction methods
-  typedef enum
-  {
-    GetTimeMicrosecondsFunc,
-    SuspendFunc,
-    ResumeFunc,
-    LoadResourceFunc,
-    SaveResourceFunc,
-    SaveFileFunc,
-    LoadFileFunc,
-    CancelLoadFunc,
-    GetResourcesFunc,
-    IsLoadingFunc,
-    GetDefaultFontFamilyFunc,
-    GetDefaultFontSizeFunc,
-    GetFontLineHeightFromCapsHeightFunc,
-    GetGlyphDataFunc,
-    GetCachedGlyphDataFunc,
-    SetDpiFunc,
-    GetFontPathFunc,
-    JoinLoaderThreadsFunc,
-    GetFontFamilyForCharsFunc,
-    AllGlyphsSupportedFunc,
-    ValidateFontFamilyNameFunc,
-    UpdateDefaultsFromDeviceFunc,
-    GetDynamicsFactoryFunc,
-    ValidateGetFontListFunc,
-    ReadGlobalMetricsFromCacheFileFunc,
-    WriteGlobalMetricsToCacheFileFunc,
-    ReadMetricsFromCacheFileFunc,
-    WriteMetricsToCacheFileFunc,
-  } TestFuncEnum;
-
-  /** Call this every test */
-  void Initialize();
-
-  inline void EnableTrace(bool enable) { mTrace.Enable(enable); }
-  inline void ResetTrace() { mTrace.Reset(); }
-  inline TraceCallStack& GetTrace() { return mTrace; }
-
-  bool WasCalled(TestFuncEnum func);
-
-  void SetGetTimeMicrosecondsResult(size_t sec, size_t usec);
-
-  void IncrementGetTimeResult(size_t milliseconds);
-
-  void SetIsLoadingResult(bool result);
-
-  void SetGetDefaultFontFamilyResult(std::string result);
-
-  void SetGetDefaultFontSizeResult(float result);
-
-  void SetGetFontPathResult(std::string& result);
-
-  void ClearReadyResources();
-
-  void SetResourceLoaded(Integration::ResourceId  loadedId,
-                         Integration::ResourceTypeId  loadedType,
-                         Integration::ResourcePointer loadedResource);
-
-  void SetResourceLoadFailed(Integration::ResourceId  id,
-                             Integration::ResourceFailure failure);
-
-  void SetResourceSaved(Integration::ResourceId      savedId,
-                        Integration::ResourceTypeId  savedType);
-
-  void SetResourceSaveFailed(Integration::ResourceId  id,
-                             Integration::ResourceFailure failure);
-
-  Integration::ResourceRequest* GetRequest();
-
-  void DiscardRequest();
-
-  void SetClosestImageSize(const Vector2& size);
-
-  void SetLoadFileResult( bool result, std::vector< unsigned char >& buffer );
-
-  void SetSaveFileResult( bool result );
-
-  PlatformAbstraction::FontListMode GetLastFontListMode( );
-
-  void SetReadGlobalMetricsResult( bool success, Integration::GlobalMetrics& globalMetrics );
-
-  void SetReadMetricsResult( bool success, std::vector<Integration::GlyphMetrics>& glyphMetricsContainer );
-
-private:
-  mutable TraceCallStack        mTrace;
-  size_t                        mSeconds;
-  size_t                        mMicroSeconds;
-  bool                          mIsLoadingResult;
-  std::string                   mGetDefaultFontFamilyResult;
-  float                         mGetDefaultFontSizeResult;
-  std::string                   mGetFontPathResult;
-  Resources                     mResources;
-  Integration::ResourceRequest* mRequest;
-  Vector2                       mSize;
-  Vector2                       mClosestSize;
-  bool                          mReadGlobalMetricsResult;
-  bool                          mReadMetricsResult;
-  Integration::GlobalMetrics mReadGlobalMetrics;
-  std::vector<Integration::GlyphMetrics> mReadMetrics;
-
-  LoadFileResult                mLoadFileResult;
-  bool                          mSaveFileResult;
-  mutable FontListMode          mFontListMode;
-  TestDynamicsFactory*          mDynamicsFactory;
-};
-
-} // Dali
-
-#endif /* __DALI_TET_PLATFORM_ABSTRACTION_H__ */
diff --git a/automated-tests/src/dali-unmanaged/tct-dali-unmanaged-core.cpp b/automated-tests/src/dali-unmanaged/tct-dali-unmanaged-core.cpp
deleted file mode 100644 (file)
index 4a0275f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <string.h>
-#include <getopt.h>
-#include <stdlib.h>
-#include <test-harness.h>
-#include "tct-dali-unmanaged-core.h"
-
-int main(int argc, char * const argv[])
-{
-  int result = TestHarness::EXIT_STATUS_BAD_ARGUMENT;
-
-  const char* optString = "r";
-  bool optRerunFailed(false);
-
-  int nextOpt = 0;
-  do
-  {
-    nextOpt = getopt( argc, argv, optString );
-    switch(nextOpt)
-    {
-      case 'r':
-        optRerunFailed = true;
-        break;
-      case '?':
-        TestHarness::Usage(argv[0]);
-        exit(TestHarness::EXIT_STATUS_BAD_ARGUMENT);
-        break;
-    }
-  } while( nextOpt != -1 );
-
-  if( optind == argc ) // no testcase name in argument list
-  {
-    result = TestHarness::RunAllInParallel(argv[0], tc_array, optRerunFailed);
-  }
-  else
-  {
-    // optind is index of next argument - interpret as testcase name
-    result = TestHarness::FindAndRunTestCase(tc_array, argv[optind]);
-  }
-  return result;
-}
diff --git a/automated-tests/src/dali-unmanaged/utc-Dali-AnimatableMesh.cpp b/automated-tests/src/dali-unmanaged/utc-Dali-AnimatableMesh.cpp
deleted file mode 100644 (file)
index f4b656f..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <iostream>
-#include <stdlib.h>
-
-#include <dali/public-api/dali-core.h>
-#include <dali-test-suite-utils.h>
-
-using namespace Dali;
-
-int UtcDaliAnimatableMeshDownCast02(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::AnimatableMesh::DownCast()");
-
-  MeshData meshData;
-  CreateMeshData(meshData);
-  Mesh mesh = Mesh::New(meshData);
-  BaseHandle* bh = &mesh;
-
-  AnimatableMesh mesh2 = AnimatableMesh::DownCast(*bh);
-  DALI_TEST_CHECK( ! mesh2 );
-  END_TEST;
-}
diff --git a/automated-tests/src/dali-unmanaged/utc-Dali-CustomActor.cpp b/automated-tests/src/dali-unmanaged/utc-Dali-CustomActor.cpp
deleted file mode 100644 (file)
index c7e8d64..0000000
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <iostream>
-
-#include <stdlib.h>
-#include <dali/public-api/dali-core.h>
-
-#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/hover-event-integ.h>
-#include <dali/integration-api/events/mouse-wheel-event-integ.h>
-#include <dali/integration-api/events/key-event-integ.h>
-
-#include <dali-test-suite-utils.h>
-
-using namespace Dali;
-
-namespace
-{
-std::vector< std::string > MasterCallStack;
-}
-
-// TypeRegistry needs custom actor Implementations to have the same name (namespaces are ignored so we use one here)
-namespace Impl
-{
-
-struct TestCustomActor : public CustomActorImpl
-{
-  /**
-   * Constructor
-   */
-  TestCustomActor()
-  : CustomActorImpl( true ), // requires touch
-    mDaliProperty( Property::INVALID_INDEX ),
-    mSizeSet( Vector3::ZERO ),
-    mTargetSize( Vector3::ZERO )
-  {
-    SetRequiresMouseWheelEvents(true);
-  }
-
-  /**
-   * Destructor
-   */
-  virtual ~TestCustomActor()
-  {
-  }
-
-  void Initialize( const char* name = NULL )
-  {
-    mDaliProperty = Self().RegisterProperty( "Dali", std::string("no"), Property::READ_WRITE);
-
-    OnInitialize( name );
-  }
-
-  virtual void OnInitialize( const char* name ) {}
-
-  /**
-   * Resets the call stack
-   */
-  void ResetCallStack()
-  {
-    mSizeSet = Vector3();
-    mTargetSize = Vector3();
-    mMethodsCalled.clear();
-  }
-
-  void AddToCallStacks( const char* method )
-  {
-    mMethodsCalled.push_back( method );
-
-    // Combine Actor name with method string
-    std::string nameAndMethod( Self().GetName() );
-    if ( 0 == nameAndMethod.size() )
-    {
-      nameAndMethod = "Unknown: ";
-    }
-    else
-    {
-      nameAndMethod += ": ";
-    }
-    nameAndMethod += method;
-
-    MasterCallStack.push_back( nameAndMethod );
-  }
-
-  // From CustomActorImpl
-  virtual void OnStageConnection()
-  {
-    AddToCallStacks("OnStageConnection");
-  }
-  virtual void OnStageDisconnection()
-  {
-    AddToCallStacks("OnStageDisconnection");
-  }
-  virtual void OnChildAdd(Actor& child)
-  {
-    AddToCallStacks("OnChildAdd");
-  }
-  virtual void OnChildRemove(Actor& child)
-  {
-    AddToCallStacks("OnChildRemove");
-  }
-  virtual void OnPropertySet( Property::Index index, Property::Value propertyValue )
-  {
-    AddToCallStacks("OnPropertySet");
-  }
-  virtual void OnSizeSet(const Vector3& targetSize)
-  {
-    mSizeSet = targetSize;
-    AddToCallStacks("OnSizeSet");
-  }
-  virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
-  {
-    mTargetSize = targetSize;
-    AddToCallStacks("OnSizeAnimation");
-  }
-  virtual bool OnTouchEvent(const TouchEvent& event)
-  {
-    AddToCallStacks("OnTouchEvent");
-    return true;
-  }
-  virtual bool OnHoverEvent(const HoverEvent& event)
-  {
-    AddToCallStacks("OnHoverEvent");
-    return true;
-  }
-  virtual bool OnMouseWheelEvent(const MouseWheelEvent& event)
-  {
-    AddToCallStacks("OnMouseWheelEvent");
-    return true;
-  }
-  virtual bool OnKeyEvent(const KeyEvent& event)
-  {
-    AddToCallStacks("OnKeyEvent");
-    return true;
-  }
-  virtual void OnKeyInputFocusGained()
-  {
-    AddToCallStacks("OnKeyInputFocusGained");
-  }
-  virtual void OnKeyInputFocusLost()
-  {
-    AddToCallStacks("OnKeyInputFocusLost");
-  }
-  virtual Actor GetChildByAlias(const std::string& actorAlias)
-  {
-    AddToCallStacks("GetChildByAlias");
-
-    if ("found" == actorAlias)
-    {
-      return Actor::New();
-    }
-    else
-    {
-      return Actor();
-    }
-  }
-
-  virtual Vector3 GetNaturalSize()
-  {
-    return Vector3( 0.0f, 0.0f, 0.0f );
-  }
-
-  void SetDaliProperty(std::string s)
-  {
-    Self().SetProperty(mDaliProperty, s) ;
-  }
-
-  Property::Index mDaliProperty;
-  std::vector< std::string > mMethodsCalled;
-  Vector3 mSizeSet;
-  Vector3 mTargetSize;
-};
-} // Namespace Impl
-
-
-namespace
-{
-/**
- * Test custom actor handle
- */
-class TestCustomActor : public CustomActor
-{
-public:
-
-  static TestCustomActor New()
-  {
-    Impl::TestCustomActor* impl = new Impl::TestCustomActor;
-    TestCustomActor custom( *impl ); // takes ownership
-
-    impl->Initialize();
-
-    return custom;
-  }
-
-  virtual ~TestCustomActor()
-  {
-  }
-
-  Impl::TestCustomActor& GetImpl()
-  {
-    return static_cast<Impl::TestCustomActor&>(GetImplementation());
-  }
-
-  std::vector< std::string >& GetMethodsCalled()
-  {
-    return GetImpl().mMethodsCalled;
-  }
-
-  void ResetCallStack()
-  {
-    GetImpl().ResetCallStack();
-  }
-
-  void SetDaliProperty(std::string s)
-  {
-    GetImpl().SetDaliProperty(s);
-  }
-
-  Vector3 GetSize()
-  {
-    return GetImpl().mSizeSet;
-  }
-
-  Vector3 GetTargetSize()
-  {
-    return GetImpl().mTargetSize;
-  }
-
-private:
-
-  TestCustomActor( Impl::TestCustomActor& impl ) : CustomActor( impl )
-  {
-  }
-};
-
-
-
-using namespace Dali;
-
-BaseHandle CreateActor()
-{
-  return TestCustomActor::New();
-}
-
-Dali::TypeRegistration mType( typeid(TestCustomActor), typeid(Dali::CustomActor), CreateActor );
-
-}
-
-
-int UtcDaliCustomActorDoAction(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::CustomActor::DoAction()");
-
-  TestCustomActor custom = TestCustomActor::New();
-
-  BaseHandle customActorObject = custom;
-
-  DALI_TEST_CHECK(customActorObject);
-
-  std::vector<Property::Value> attributes;
-
-  // Check that an invalid command is not performed
-  DALI_TEST_CHECK(customActorObject.DoAction("invalidCommand", attributes) == false);
-
-  // Check that the custom actor is visible
-  custom.SetVisible(true);
-  DALI_TEST_CHECK(custom.IsVisible() == true);
-
-  // Check the custom actor performed an action to hide itself
-  DALI_TEST_CHECK(customActorObject.DoAction("hide", attributes) == true);
-
-  // flush the queue and render once
-  application.SendNotification();
-  application.Render();
-
-  // Check that the custom actor is now invisible
-  DALI_TEST_CHECK(custom.IsVisible() == false);
-
-  // Check the custom actor performed an action to show itself
-  DALI_TEST_CHECK(customActorObject.DoAction("show", attributes) == true);
-
-  // flush the queue and render once
-  application.SendNotification();
-  application.Render();
-
-  // Check that the custom actor is now visible
-  DALI_TEST_CHECK(custom.IsVisible() == true);
-  END_TEST;
-}
diff --git a/automated-tests/src/dali-unmanaged/utc-Dali-MeshActor.cpp b/automated-tests/src/dali-unmanaged/utc-Dali-MeshActor.cpp
deleted file mode 100644 (file)
index 54faee1..0000000
+++ /dev/null
@@ -1,841 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <iostream>
-
-#include <stdlib.h>
-#include <dali/public-api/dali-core.h>
-#include <dali-test-suite-utils.h>
-
-using namespace Dali;
-
-#include <mesh-builder.h>
-
-
-namespace
-{
-
-static Mesh NewMesh()
-{
-  MeshData meshData;
-  MeshData::VertexContainer    vertices;
-  MeshData::FaceIndices        faces;
-  BoneContainer                bones;
-  ConstructVertices(vertices, 60);
-  ConstructFaces(vertices, faces);
-  Material customMaterial = ConstructMaterial();
-  meshData.SetData(vertices, faces, bones, customMaterial);
-  Mesh mesh = Mesh::New(meshData);
-  return mesh;
-}
-
-} // anon mesh
-
-
-int UtcDaliMeshActorNew02(void)
-{
-  TestApplication application;
-  TestPlatformAbstraction& platform = application.GetPlatform();
-
-  tet_infoline("Testing Dali::MeshActor::New()");
-
-  std::string modelName("AModel");
-  Dali::ModelData modelData = Dali::ModelData::New(modelName);
-  Dali::Entity rootEntity = Dali::Entity::New("root");
-  modelData.SetRootEntity(rootEntity);
-  rootEntity.SetType(Dali::Entity::OBJECT);
-
-  Model model = Model::New("Fake model");
-
-  // Run Core - will query using TestPlatformAbstraction::GetResources().
-  application.SendNotification();
-  application.Render();
-
-  Integration::ResourceRequest* request = platform.GetRequest();
-  if(request)
-  {
-    platform.SetResourceLoaded(request->GetId(), request->GetType()->id, Integration::ResourcePointer(&(modelData.GetBaseObject())));
-  }
-
-  application.Render();
-  application.SendNotification();
-
-  Actor actor = ModelActorFactory::BuildActorTree(model, ""); // model should be loaded
-
-  DALI_TEST_CHECK(model.GetLoadingState() == ResourceLoadingSucceeded);
-  DALI_TEST_CHECK(actor);
-  DALI_TEST_CHECK(actor.GetName().compare("root") == 0);
-  END_TEST;
-}
-
-
-int UtcDaliMeshActorCreateNoMeshData(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::Mesh::New() - Create with no mesh data");
-
-  try
-  {
-    MeshData meshData;
-    Mesh mesh = Mesh::New(meshData);
-    MeshActor actor1 = MeshActor::New(mesh);
-  }
-  catch(Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "object", TEST_LOCATION);
-  }
-  END_TEST;
-}
-
-
-int UtcDaliMeshActorCreateSetData01(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshData::SetData() - Create with no verts");
-  try
-  {
-    MeshData meshData;
-    MeshData::VertexContainer vertices;
-    MeshData::FaceIndices     faces;
-    BoneContainer             bones;
-    Material                  customMaterial;
-    meshData.SetData(vertices, faces, bones, customMaterial);
-    Mesh mesh = Mesh::New(meshData);
-    MeshActor actor1 = MeshActor::New(mesh);
-  }
-  catch(Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "!vertices.empty()", TEST_LOCATION );
-  }
-  END_TEST;
-}
-
-int UtcDaliMeshActorCreateSetData02(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshData::SetData - Create with no faces");
-  try
-  {
-    MeshData meshData;
-    MeshData::VertexContainer    vertices;
-    MeshData::FaceIndices        faces;
-    BoneContainer                bones;
-    Material                     customMaterial;
-    ConstructVertices(vertices, 60);
-    meshData.SetData(vertices, faces, bones, customMaterial);
-    Mesh mesh = Mesh::New(meshData);
-    MeshActor actor1 = MeshActor::New(mesh);
-  }
-  catch(Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "!faceIndices.empty", TEST_LOCATION );
-  }
-  END_TEST;
-}
-
-int UtcDaliMeshActorCreateSetData03(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshData::SetData - Create with no mats");
-  try
-  {
-    MeshData meshData;
-    MeshData::VertexContainer    vertices;
-    MeshData::FaceIndices        faces;
-    BoneContainer                bones;
-    Material                     customMaterial;
-    ConstructVertices(vertices, 60);
-    ConstructFaces(vertices, faces);
-    meshData.SetData(vertices, faces, bones, customMaterial);
-    Mesh mesh = Mesh::New(meshData);
-    MeshActor actor1 = MeshActor::New(mesh);
-  }
-  catch(Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "material", TEST_LOCATION );
-  }
-  END_TEST;
-}
-
-int UtcDaliMeshActorCreateSetData04(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::SetData()");
-
-  MeshData meshData;
-  MeshData::VertexContainer    vertices;
-  MeshData::FaceIndices        faces;
-  BoneContainer                bones;
-  ConstructVertices(vertices, 60);
-  ConstructFaces(vertices, faces);
-  Material customMaterial = ConstructMaterial();
-  meshData.SetData(vertices, faces, bones, customMaterial);
-
-  Mesh mesh = Mesh::New(meshData);
-  MeshActor actor1 = MeshActor::New(mesh);
-  DALI_TEST_CHECK(actor1);
-  END_TEST;
-}
-
-
-int UtcDaliMeshActorDownCast(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::DownCast()");
-
-  MeshData meshData;
-  MeshData::VertexContainer    vertices;
-  MeshData::FaceIndices        faces;
-  BoneContainer                bones;
-  ConstructVertices(vertices, 60);
-  ConstructFaces(vertices, faces);
-  Material customMaterial = ConstructMaterial();
-  meshData.SetData(vertices, faces, bones, customMaterial);
-  Mesh mesh = Mesh::New(meshData);
-
-  MeshActor actor1 = MeshActor::New(mesh);
-  Actor anActor = Actor::New();
-  anActor.Add(actor1);
-
-  Actor child = anActor.GetChildAt(0);
-  MeshActor meshActor = MeshActor::DownCast(child);
-
-  DALI_TEST_CHECK(meshActor);
-  END_TEST;
-}
-
-int UtcDaliMeshActorDownCast2(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::DownCast()");
-
-  Actor actor1 = Actor::New();
-  Actor anActor = Actor::New();
-  anActor.Add(actor1);
-
-  Actor child = anActor.GetChildAt(0);
-  MeshActor meshActor = MeshActor::DownCast(child);
-  DALI_TEST_CHECK(!meshActor);
-
-  Actor unInitialzedActor;
-  meshActor = DownCast< MeshActor >( unInitialzedActor );
-  DALI_TEST_CHECK(!meshActor);
-  END_TEST;
-}
-
-int UtcDaliMeshActorSetMaterial01(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
-
-  Mesh mesh = NewMesh();
-
-  MeshActor actor = MeshActor::New(mesh);
-  std::string name = "AMeshActor";
-  Stage::GetCurrent().Add(actor);
-  actor.SetName(name);
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  Material customMaterial = Material::New("CustomMaterial");
-  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
-
-  MeshActor::SetMaterial(actor, name, customMaterial);
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  DALI_TEST_CHECK( actor.GetMaterial() == customMaterial );
-  END_TEST;
-}
-
-int UtcDaliMeshActorSetMaterial01b(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
-
-  Mesh mesh = NewMesh();
-
-  Actor rootActor = Actor::New();
-  MeshActor meshActor = MeshActor::New(mesh);
-  rootActor.Add(meshActor);
-
-  std::string name = "AMeshActor";
-  meshActor.SetName(name);
-
-  Stage::GetCurrent().Add(rootActor);
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  Material customMaterial = Material::New("CustomMaterial");
-  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
-
-  MeshActor::SetMaterial(rootActor, name, customMaterial);
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  DALI_TEST_CHECK(meshActor.GetMaterial() == customMaterial );
-  END_TEST;
-}
-
-
-int UtcDaliMeshActorSetMaterial02(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
-
-  Mesh mesh = NewMesh();
-  MeshActor actor = MeshActor::New(mesh);
-
-  std::string name = "AMeshActor";
-  actor.SetName(name);
-  Stage::GetCurrent().Add(actor);
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  Material baseMat = actor.GetMaterial();
-  Material customMaterial = Material::New("CustomMaterial");
-  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
-
-  MeshActor::SetMaterial(actor, "NoName", customMaterial);
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  DALI_TEST_CHECK( actor.GetMaterial() == baseMat );
-  DALI_TEST_CHECK( actor.GetMaterial() != customMaterial );
-  END_TEST;
-}
-
-int UtcDaliMeshActorSetMaterial02b(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
-
-  Mesh mesh = NewMesh();
-
-  MeshActor actor = MeshActor::New(mesh);
-  Stage::GetCurrent().Add(actor);
-
-  std::string name = "AMeshActor";
-  actor.SetName(name);
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  Material baseMat = actor.GetMaterial();
-  Material customMaterial = Material::New("CustomMaterial");
-  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
-
-  MeshActor::SetMaterial(actor, "NoName", customMaterial);
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  DALI_TEST_CHECK( actor.GetMaterial() == baseMat );
-  DALI_TEST_CHECK( actor.GetMaterial() != customMaterial );
-  END_TEST;
-}
-
-
-int UtcDaliMeshActorSetMaterial03(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
-
-  Mesh mesh = NewMesh();
-
-  MeshActor actor = MeshActor::New(mesh);
-  std::string name = "AMeshActor";
-  actor.SetName(name);
-  Stage::GetCurrent().Add(actor);
-
-  Material customMaterial = Material::New("CustomMaterial");
-  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
-
-  actor.SetMaterial(customMaterial);
-  application.SendNotification();
-  application.Render(0);
-  application.Render(16);
-  application.SendNotification();
-
-  DALI_TEST_CHECK(actor.GetMaterial() == customMaterial );
-  END_TEST;
-}
-
-int UtcDaliMeshActorSetMaterial03b(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
-
-  Mesh mesh = NewMesh();
-
-  MeshActor actor = MeshActor::New(mesh);
-  std::string name = "AMeshActor";
-  actor.SetName(name);
-  Stage::GetCurrent().Add(actor);
-
-  Material customMaterial = Material::New("CustomMaterial");
-  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
-
-  actor.SetMaterial(customMaterial);
-  application.SendNotification();
-  application.Render(0);
-  application.Render(16);
-  application.SendNotification();
-  DALI_TEST_CHECK(actor.GetMaterial() == customMaterial );
-  END_TEST;
-}
-
-
-
-int UtcDaliMeshActorGetMaterial01(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
-
-  MeshData meshData;
-  MeshData::VertexContainer vertices;
-  MeshData::FaceIndices faces;
-  BoneContainer bones;
-  ConstructVertices(vertices, 60);
-  ConstructFaces(vertices, faces);
-  Material material = ConstructMaterial();
-  meshData.SetData(vertices, faces, bones, material);
-  Mesh mesh = Mesh::New(meshData);
-
-  MeshActor actor = MeshActor::New(mesh);
-  std::string name = "AMeshActor";
-  actor.SetName(name);
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  Material gotMaterial = actor.GetMaterial();
-
-  DALI_TEST_EQUALS( material.GetOpacity(), gotMaterial.GetOpacity(), TEST_LOCATION );
-  DALI_TEST_EQUALS( material.GetAmbientColor(), gotMaterial.GetAmbientColor(), TEST_LOCATION );
-  DALI_TEST_EQUALS( material.GetDiffuseColor(), gotMaterial.GetDiffuseColor(), TEST_LOCATION );
-  DALI_TEST_EQUALS( material.GetSpecularColor(), gotMaterial.GetSpecularColor(), TEST_LOCATION );
-  END_TEST;
-}
-
-
-int UtcDaliMeshActorGetMaterial02(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
-
-  MeshData meshData;
-  MeshData::VertexContainer vertices;
-  MeshData::FaceIndices faces;
-  BoneContainer bones;
-  ConstructVertices(vertices, 60);
-  ConstructFaces(vertices, faces);
-  Material material = ConstructMaterial();
-  meshData.SetData(vertices, faces, bones, material);
-  Mesh mesh = Mesh::New(meshData);
-
-  MeshActor actor = MeshActor::New(mesh);
-  std::string name = "AMeshActor";
-  actor.SetName(name);
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  Material gotMaterial = actor.GetMaterial();
-
-  DALI_TEST_EQUALS( material.GetOpacity(), gotMaterial.GetOpacity(), TEST_LOCATION );
-  DALI_TEST_EQUALS( material.GetAmbientColor(), gotMaterial.GetAmbientColor(), TEST_LOCATION );
-  DALI_TEST_EQUALS( material.GetDiffuseColor(), gotMaterial.GetDiffuseColor(), TEST_LOCATION );
-  DALI_TEST_EQUALS( material.GetSpecularColor(), gotMaterial.GetSpecularColor(), TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliMeshActorSetLighting01(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::GetLighting()");
-
-  Mesh mesh = NewMesh();
-
-  MeshActor actor = MeshActor::New(mesh);
-  Stage::GetCurrent().Add(actor);
-
-  // Mesh actors should be lit by default
-  DALI_TEST_EQUALS(actor.IsAffectedByLighting(), true, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliMeshActorSetLighting02(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::SetLighting()");
-
-  Mesh mesh = NewMesh();
-  MeshActor actor = MeshActor::New(mesh);
-  Stage::GetCurrent().Add(actor);
-
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  Light light = Light::New("KeyLight");
-  light.SetFallOff(Vector2(10000.0f, 10000.0f));
-  LightActor keyLightActor = LightActor::New();
-  keyLightActor.SetParentOrigin(ParentOrigin::CENTER);
-  keyLightActor.SetPosition(200.0f, 500.0f, 300.0f);
-  keyLightActor.SetName(light.GetName());
-
-  Stage::GetCurrent().Add(keyLightActor);
-  keyLightActor.SetLight(light);
-  keyLightActor.SetActive(true);
-
-  actor.SetAffectedByLighting(true);
-  DALI_TEST_EQUALS(actor.IsAffectedByLighting(), true, TEST_LOCATION);
-
-  // Test rendering to ensure that the correct shader setup is used in renderer
-  // (check in debugger or via coverage)
-  application.Render(1);
-  application.SendNotification();
-  application.Render(1);
-  application.SendNotification();
-  application.Render(1);
-  application.SendNotification();
-  application.Render(1);
-  application.SendNotification();
-  application.Render(1);
-
-  actor.SetAffectedByLighting(false);
-  DALI_TEST_EQUALS(actor.IsAffectedByLighting(), false, TEST_LOCATION);
-
-  // Test rendering to ensure that the correct shader setup is used in renderer
-  // (check in debugger or via coverage)
-  application.Render(1);
-  application.SendNotification();
-  application.Render(1);
-  application.SendNotification();
-  application.Render(1);
-  application.SendNotification();
-  application.Render(1);
-  application.SendNotification();
-  application.Render(1);
-  END_TEST;
-}
-
-namespace
-{
-
-Material ConstructMaterial(float opacity, float diffuseOpacity)
-{
-  Material customMaterial = Material::New("CustomMaterial");
-  customMaterial.SetOpacity(opacity);
-  customMaterial.SetDiffuseColor(Vector4(0.8f, 0.0f, 0.4f, diffuseOpacity));
-  customMaterial.SetAmbientColor(Vector4(0.2f, 1.0f, 0.6f, 1.0f));
-  customMaterial.SetSpecularColor(Vector4(0.5f, 0.6f, 0.7f, 1.0f));
-  return customMaterial;
-}
-
-static void TestBlending( TestApplication& application, Material material, float actorOpacity, BlendingMode::Type blendingMode, bool expectedBlend )
-{
-  MeshData meshData;
-  MeshData::VertexContainer vertices;
-  MeshData::FaceIndices faces;
-  BoneContainer bones;
-  ConstructVertices(vertices, 60);
-  ConstructFaces(vertices, faces);
-  meshData.SetData(vertices, faces, bones, material);
-  Mesh mesh = Mesh::New(meshData);
-
-  application.SendNotification();
-  application.Render(0);
-  application.Render();
-  application.SendNotification();
-
-  MeshActor actor = MeshActor::New(mesh);
-  Stage::GetCurrent().Add(actor);
-
-  actor.SetAffectedByLighting(false);
-  actor.SetBlendMode(blendingMode);
-  actor.SetOpacity(actorOpacity);
-
-  TraceCallStack& cullFaceTrace = application.GetGlAbstraction().GetCullFaceTrace();
-  cullFaceTrace.Enable(true);
-  application.SendNotification();
-  application.Render();
-  DALI_TEST_EQUALS( BlendEnabled( cullFaceTrace ), expectedBlend, TEST_LOCATION );
-}
-} //anonymous namespace
-
-
-int UtcDaliMeshActorBlend01(void)
-{
-  // Set Material with translucent color, actor color opaque, Set Use image alpha to true
-  // Expect blending
-
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::Blend01()");
-
-  TestBlending( application, ConstructMaterial(0.5f, 0.5f), 1.0f, BlendingMode::AUTO, true );
-  END_TEST;
-}
-
-
-int UtcDaliMeshActorBlend02(void)
-{
-  // Set material to translucent, set use image alpha to false, set actor opacity to 1.0f
-  // Expect no blending
-
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::Blend02()");
-  TestBlending( application, ConstructMaterial(0.5f, 0.5f), 1.0f, BlendingMode::OFF, false );
-  END_TEST;
-}
-
-int UtcDaliMeshActorBlend03(void)
-{
-  // Set material to opaque, set use image alpha to true, set actor opacity to 1.0f
-  // Expect no blending
-
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::Blend03()");
-  TestBlending( application, ConstructMaterial(1.0f, 1.0f), 1.0f, BlendingMode::AUTO, false );
-  END_TEST;
-}
-
-
-int UtcDaliMeshActorBlend04(void)
-{
-  // Set material to have image with alpha, set use image alpha to true, set actor opacity to 1.0f
-  // Expect blending
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::Blend04()");
-
-  Material material = ConstructMaterial(1.0f, 1.0f);
-  BitmapImage image = BitmapImage::New( 100, 50, Pixel::RGBA8888 );
-  material.SetDiffuseTexture( image );
-  application.SendNotification();
-  application.Render(0);
-
-  TestBlending( application, material, 1.0f, BlendingMode::AUTO, true );
-  END_TEST;
-}
-
-int UtcDaliMeshActorBlend05(void)
-{
-  // Set material to have image with alpha, set use image alpha to false, set actor opacity to 1.0f
-  // Expect no blending
-
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::Blend05()");
-
-  Material material = ConstructMaterial(1.0f, 1.0f);
-  BitmapImage image = BitmapImage::New( 100, 50, Pixel::RGBA8888 );
-  material.SetDiffuseTexture( image );
-  application.SendNotification();
-  application.Render(0);
-
-  TestBlending( application, material, 1.0f, BlendingMode::ON, true );
-  END_TEST;
-}
-
-
-int UtcDaliMeshActorBlend06(void)
-{
-  // Set material to have image without alpha, set use image alpha to true, set actor opacity to 1.0f
-  // Expect no blending
-
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::Blend()");
-
-  Material material = ConstructMaterial(1.0f, 1.0f);
-  BitmapImage image = BitmapImage::New( 100, 50, Pixel::RGB888 );
-  material.SetDiffuseTexture( image );
-  application.SendNotification();
-  application.Render(0);
-
-  TestBlending( application, material, 1.0f, BlendingMode::AUTO, false );
-  END_TEST;
-}
-
-int UtcDaliMeshActorBlend07(void)
-{
-  // Set material to have framebuffer with alpha, set use image alpha to true, set actor opacity to 1.0f
-  // Expect blending
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::Blend07()");
-  application.Render(0);
-
-  Material material = ConstructMaterial(1.0f, 1.0f);
-  FrameBufferImage image = FrameBufferImage::New( 100, 50, Pixel::RGBA8888 );
-  RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
-  RenderTask task = taskList.GetTask( 0u );
-  task.SetTargetFrameBuffer( image ); // To ensure frame buffer is connected
-  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
-  application.SendNotification();
-  application.Render();
-
-  material.SetDiffuseTexture( image ); // (to render from)
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  TestBlending( application, material, 1.0f, BlendingMode::AUTO, true );
-  END_TEST;
-}
-
-int UtcDaliMeshActorBlend08(void)
-{
-  // Set material to have image with alpha, set use image alpha to false, set actor opacity to 0.5f
-  // Expect blending
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::Blend08()");
-
-  Material material = ConstructMaterial(1.0f, 1.0f);
-  BitmapImage image = BitmapImage::New( 100, 50, Pixel::RGBA8888 );
-  material.SetDiffuseTexture( image );
-  application.SendNotification();
-  application.Render(0);
-
-  TestBlending( application, material, 0.5f, BlendingMode::AUTO, true );
-  END_TEST;
-}
-
-int UtcDaliMeshActorBlend09(void)
-{
-  // Set material to have image with no alpha, set material opacity to 0.5, set use image alpha to true, set actor opacity to 1.0f
-  // Expect blending
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::Blend08()");
-
-  Material material = ConstructMaterial(0.5f, 1.0f);
-  BitmapImage image = BitmapImage::New( 100, 50, Pixel::RGB888 );
-  material.SetDiffuseTexture( image );
-  application.SendNotification();
-  application.Render(0);
-
-  TestBlending( application, material, 1.0f, BlendingMode::AUTO, true );
-  END_TEST;
-}
-
-int UtcDaliMeshActorBoneUpdate01(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::MeshActor::BoneUpdate01()");
-
-  // Set up a mesh with bones.
-  // animate bones
-  // ensure bone actor's world matrix is updated
-
-  Actor trunk = Actor::New();
-  trunk.SetName("trunk");
-  trunk.SetPosition(Vector3(100.0f, 200.0f, 300.0f));
-  trunk.SetRotation(Quaternion(M_PI*0.3f, Vector3::XAXIS));
-  Actor branch = Actor::New();
-  branch.SetName("branch");
-  branch.SetPosition(Vector3(10.0f, 100.0f, 0.0f));
-  branch.SetRotation(Quaternion(M_PI*0.2f, Vector3::YAXIS));
-
-  Actor twig = ImageActor::New(CreateBitmapImage());
-  twig.SetName("twig");
-  branch.SetPosition(Vector3(20.0f, 30.0f, 40.0f));
-
-  Actor bug = Actor::New(); // Not a bone
-  bug.SetName("bug");
-  bug.SetPosition(Vector3(10.0f, 10.0f, 10.0f));
-
-  Stage::GetCurrent().Add(trunk);
-  trunk.Add(branch);
-  branch.Add(twig);
-  twig.Add(bug);
-
-  MeshData meshData;
-  CreateMeshData(meshData); // Created with named bones (as above)
-  Mesh mesh = Mesh::New(meshData);
-  MeshActor meshActor = MeshActor::New(mesh);
-  Stage::GetCurrent().Add(meshActor);
-
-  meshActor.BindBonesToMesh(Stage::GetCurrent().GetRootLayer());
-
-  application.SendNotification();
-  application.Render(0);
-  application.Render();
-  application.SendNotification();
-
-  // How to test?
-  // Need to see what bone actor's node has set as world matrix.
-
-  Animation anim = Animation::New(1.0f);
-  anim.RotateBy(trunk, Radian(M_PI*0.5f), Vector3::ZAXIS);
-  anim.Play();
-  application.SendNotification();
-  application.Render(500);
-  application.SendNotification();
-  application.Render(500);
-  application.SendNotification();
-  application.Render(10);
-
-  // All bones have moved.
-  // Check that their world matrix has been updated: ( Isn't IDENTITY )
-  DALI_TEST_CHECK( ! application.GetGlAbstraction().CheckUniformValue("uModelMatrix", Matrix::IDENTITY ) );
-
-  Matrix worldMatrix;
-  GLuint programId, uniformId;
-  DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformIds("uModelMatrix", programId, uniformId) );
-  DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue( programId, uniformId, worldMatrix) );
-
-  // But also check that property is calculated as needed:
-  Matrix calcWorldMatrix = twig.GetCurrentWorldMatrix();
-  DALI_TEST_CHECK( Matrix::IDENTITY != calcWorldMatrix );
-  DALI_TEST_CHECK( worldMatrix == calcWorldMatrix );
-  END_TEST;
-
-}
-
-int UtcDaliMeshActorIndices(void)
-{
-  TestApplication application;
-  Actor basicActor = Actor::New();
-  Mesh mesh = NewMesh();
-  MeshActor meshActor = MeshActor::New(mesh);
-
-  Property::IndexContainer indices;
-  meshActor.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( indices.size() == basicActor.GetPropertyCount() ); // Mesh Actor does not have any properties
-  DALI_TEST_EQUALS( indices.size(), meshActor.GetPropertyCount(), TEST_LOCATION );
-  END_TEST;
-}
diff --git a/automated-tests/src/dali-unmanaged/utc-Dali-RenderTask.cpp b/automated-tests/src/dali-unmanaged/utc-Dali-RenderTask.cpp
deleted file mode 100644 (file)
index 30da463..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <iostream>
-
-#include <stdlib.h>
-#include <dali/public-api/dali-core.h>
-#include <dali-test-suite-utils.h>
-
-using namespace Dali;
-
-namespace
-{
-// The functor to be used in the hit-test algorithm to check whether the actor is hittable.
-bool IsActorHittableFunction(Actor actor, Dali::HitTestAlgorithm::TraverseType type)
-{
-  bool hittable = false;
-
-  switch (type)
-  {
-    case Dali::HitTestAlgorithm::CHECK_ACTOR:
-    {
-      // Check whether the actor is visible and not fully transparent.
-      if( actor.IsVisible()
-       && actor.GetCurrentWorldColor().a > 0.01f) // not FULLY_TRANSPARENT
-      {
-
-          hittable = true;
-      }
-      break;
-    }
-    case Dali::HitTestAlgorithm::DESCEND_ACTOR_TREE:
-    {
-      if( actor.IsVisible() ) // Actor is visible, if not visible then none of its children are visible.
-      {
-        hittable = true;
-      }
-      break;
-    }
-    default:
-    {
-      break;
-    }
-  }
-
-  return hittable;
-};
-
-} // anonymous namespace
-
-
-int UtcDaliRenderTaskSetScreenToFrameBufferMappingActor(void)
-{
-  TestApplication application;
-  tet_infoline("Testing RenderTask::SetScreenToFrameBufferMappingActor ");
-
-  Stage stage = Stage::GetCurrent();
-  Size stageSize = stage.GetSize();
-  Actor mappingActor = Actor::New();
-  Vector2 scale( 0.6f, 0.75f);
-  Vector2 offset( stageSize.x*0.1f, stageSize.y*0.15f);
-  mappingActor.SetSize( stageSize * scale );
-  mappingActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  mappingActor.SetPosition( offset.x, offset.y );
-  stage.Add( mappingActor );
-
-  Actor offscreenActor = Actor::New();
-  offscreenActor.SetSize( stageSize );
-  offscreenActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  stage.Add( offscreenActor );
-
-  RenderTaskList taskList = stage.GetRenderTaskList();
-  RenderTask renderTask = taskList.CreateTask();
-  FrameBufferImage frameBufferImage =  FrameBufferImage::New(stageSize.width*scale.x, stageSize.height*scale.y, Pixel::A8, Image::Never);
-  renderTask.SetSourceActor( offscreenActor );
-  renderTask.SetExclusive( true );
-  renderTask.SetInputEnabled( true );
-  renderTask.SetTargetFrameBuffer( frameBufferImage );
-  renderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
-  renderTask.SetScreenToFrameBufferMappingActor( mappingActor );
-  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  Vector2 screenCoordinates( stageSize.x * 0.05f, stageSize.y * 0.05f );
-  Dali::HitTestAlgorithm::Results results;
-  DALI_TEST_CHECK( !results.actor );
-  DALI_TEST_EQUALS( Vector2::ZERO, results.actorCoordinates, 0.1f, TEST_LOCATION );
-  // miss expected, results not changed
-  DALI_TEST_CHECK( false == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
-  DALI_TEST_CHECK( !results.actor );
-  DALI_TEST_EQUALS( Vector2::ZERO, results.actorCoordinates, 0.1f, TEST_LOCATION );
-
-  screenCoordinates.x = stageSize.x * 0.265f;
-  screenCoordinates.y = stageSize.y * 0.33f;
-  results.actor = Actor();
-  results.actorCoordinates = Vector2::ZERO;
-  // hit expected, results changed
-  DALI_TEST_CHECK( true == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
-  DALI_TEST_CHECK( results.actor  == offscreenActor );
-  DALI_TEST_EQUALS( (screenCoordinates-offset)/scale , results.actorCoordinates, 0.1f, TEST_LOCATION );
-
-  screenCoordinates.x = stageSize.x * 0.435f;
-  screenCoordinates.y = stageSize.y * 0.52f;
-  // hit expected, results changed
-  DALI_TEST_CHECK( true == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
-  DALI_TEST_CHECK( results.actor  == offscreenActor );
-  const Vector2 expectedCoordinates = (screenCoordinates-offset)/scale;
-  DALI_TEST_EQUALS( expectedCoordinates , results.actorCoordinates, 0.1f, TEST_LOCATION );
-
-  screenCoordinates.x = stageSize.x * 0.65f;
-  screenCoordinates.y = stageSize.y * 0.95f;
-  // miss expected, results not changed
-  DALI_TEST_CHECK( false == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
-  DALI_TEST_CHECK( results.actor  == offscreenActor );
-  DALI_TEST_EQUALS( expectedCoordinates , results.actorCoordinates, 0.1f, TEST_LOCATION );
-  END_TEST;
-}
diff --git a/automated-tests/src/dali-unmanaged/utc-Dali-ShaderEffect.cpp b/automated-tests/src/dali-unmanaged/utc-Dali-ShaderEffect.cpp
deleted file mode 100644 (file)
index 252ec9d..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <iostream>
-
-#include <stdlib.h>
-#include <dali/public-api/dali-core.h>
-#include <dali-test-suite-utils.h>
-
-using namespace Dali;
-
-namespace
-{
-
-static const char* VertexSource = "VertexSource: this can be whatever you want it to be, but don't make it exact the same as default shader\n";
-
-static const char* FragmentSource = "FragmentSource: this can be whatever you want it to be, but don't make it exact the same as default shader\n";
-
-const int GETSOURCE_BUFFER_SIZE = 0x10000;
-
-static const char* TestImageFilename = "icon_wrt.png";
-
-Integration::Bitmap* CreateBitmap( unsigned int imageHeight, unsigned int imageWidth, unsigned int initialColor )
-{
-  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::RETAIN );
-  Integration::PixelBuffer* pixbuffer = bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888,  imageWidth,imageHeight,imageWidth,imageHeight );
-  unsigned int bytesPerPixel = GetBytesPerPixel(  Pixel::RGBA8888 );
-
-  memset( pixbuffer,  initialColor , imageHeight*imageWidth*bytesPerPixel);
-
-  return bitmap;
-}
-
-} // Anonymous namespace
-
-
-int UtcDaliShaderEffectFromProperties01(void)
-{
-  TestApplication application;
-  tet_infoline("UtcDaliShaderEffectFromProperties01()");
-
-  std::string fragmentShaderPrefix = "#define TEST_FS 1\n#extension GL_OES_standard_derivatives : enable";
-  std::string vertexShaderPrefix = "#define TEST_VS 1";
-  std::string vertexShader(VertexSource);
-  std::string fragmentShader(FragmentSource);
-
-  // Call render to compile default shaders.
-  application.SendNotification();
-  application.Render();
-
-  GLuint lastShaderCompiledBefore = application.GetGlAbstraction().GetLastShaderCompiled();
-
-  // create from type registry
-
-  TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "ShaderEffect" );
-  DALI_TEST_CHECK( typeInfo );
-  ShaderEffect effect = ShaderEffect::DownCast( typeInfo.CreateInstance() );
-  DALI_TEST_CHECK( effect );
-
-  Property::Value programMap = Property::Value(Property::MAP);
-
-  programMap.SetValue("vertex", vertexShader);
-  programMap.SetValue("fragment", fragmentShader);
-
-  programMap.SetValue("vertex-prefix", vertexShaderPrefix);
-  programMap.SetValue("fragment-prefix", fragmentShaderPrefix);
-
-  programMap.SetValue("geometry-type", "GEOMETRY_TYPE_IMAGE");
-
-  effect.SetProperty(effect.GetPropertyIndex("program"), programMap);
-
-  Property::Value imageMap = Property::Value(Property::MAP);
-  imageMap.SetValue("filename", Property::Value(TestImageFilename));
-  effect.SetProperty(effect.GetPropertyIndex("image"), imageMap);
-
-  // do a update & render to get the image request
-  application.SendNotification();
-  application.Render();
-
-  Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
-  // create the image
-  Integration::Bitmap* bitmap = CreateBitmap( 10, 10, 0xFF );
-  Integration::ResourcePointer resourcePtr(bitmap);
-  TestPlatformAbstraction& platform = application.GetPlatform();
-  platform.SetResourceLoaded(request->GetId(), request->GetType()->id, resourcePtr);
-
-  BitmapImage image(CreateBitmapImage());
-  ImageActor actor = ImageActor::New( image );
-  actor.SetSize( 100.0f, 100.0f );
-  actor.SetName("TestImageFilenameActor");
-  actor.SetShaderEffect(effect);
-  Stage::GetCurrent().Add(actor);
-
-  application.SendNotification();
-  application.Render();
-  GLuint lastShaderCompiledAfter = application.GetGlAbstraction().GetLastShaderCompiled();
-
-  // we should have compiled 2 shaders.
-  DALI_TEST_EQUALS(lastShaderCompiledAfter, lastShaderCompiledBefore + 2, TEST_LOCATION );
-
-  std::string actualVertexShader = application.GetGlAbstraction().GetShaderSource( lastShaderCompiledBefore + 1 );
-  DALI_TEST_EQUALS( vertexShaderPrefix, actualVertexShader.substr( 0, vertexShaderPrefix.length() ), TEST_LOCATION );
-  DALI_TEST_EQUALS( vertexShader, actualVertexShader.substr( actualVertexShader.length() - vertexShader.length() ), TEST_LOCATION );
-
-  std::string actualFragmentShader = application.GetGlAbstraction().GetShaderSource( lastShaderCompiledBefore + 2 );
-  DALI_TEST_EQUALS( fragmentShaderPrefix, actualFragmentShader.substr( 0, fragmentShaderPrefix.length() ), TEST_LOCATION );
-  DALI_TEST_EQUALS( fragmentShader, actualFragmentShader.substr( actualFragmentShader.length() - fragmentShader.length() ), TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliShaderEffectFromProperties02(void)
-{
-  try
-  {
-    TestApplication application;
-    tet_infoline("UtcDaliShaderEffectFromProperties02()");
-
-    // Call render to compile default shaders.
-    application.SendNotification();
-    application.Render();
-    application.Render();
-    application.Render();
-
-    // create from type registry (currently only way to get ShaderEffect with no shader setup in constructor
-    TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "ShaderEffect" );
-    DALI_TEST_CHECK( typeInfo );
-    ShaderEffect effect = ShaderEffect::DownCast( typeInfo.CreateInstance() );
-    DALI_TEST_CHECK( effect );
-
-    Property::Value programMap = Property::Value(Property::MAP);
-
-    programMap.SetValue("vertex",   std::string(VertexSource));
-    programMap.SetValue("fragment", std::string(FragmentSource));
-
-    // programMap.SetValue("geometry-type", "GEOMETRY_TYPE_IMAGE");
-    // dont set by value
-    programMap.SetValue("geometry-type", GeometryType( GEOMETRY_TYPE_IMAGE ));
-
-    effect.SetProperty(effect.GetPropertyIndex("program"), programMap);
-
-    tet_result( TET_FAIL );
-  }
-  catch(Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-  }
-  END_TEST;
-}
-
-int UtcDaliShaderEffectFromProperties03(void)
-{
-  try
-  {
-    TestApplication application;
-    tet_infoline("UtcDaliShaderEffectFromProperties03()");
-
-    // Call render to compile default shaders.
-    application.SendNotification();
-    application.Render();
-    application.Render();
-    application.Render();
-
-    // create from type registry (currently only way to get ShaderEffect with no shader setup in constructor
-    TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "ShaderEffect" );
-    DALI_TEST_CHECK( typeInfo );
-    ShaderEffect effect = ShaderEffect::DownCast( typeInfo.CreateInstance() );
-    DALI_TEST_CHECK( effect );
-
-    // dont set unknown
-    effect.SetProperty( effect.GetPropertyIndex("geometry-hints"), "HINT_2" );
-
-    tet_result( TET_FAIL );
-  }
-  catch(Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-  }
-  END_TEST;
-}
index 53ca799..5266f3f 100644 (file)
@@ -18,21 +18,34 @@ SET(TC_SOURCES
         utc-Dali-BitmapImage.cpp
         utc-Dali-CameraActor.cpp
         utc-Dali-Character.cpp
+        utc-Dali-Constrainable.cpp
         utc-Dali-Constraint.cpp
+        utc-Dali-Context.cpp
         utc-Dali-CustomActor.cpp
         utc-Dali-Degree.cpp
+        utc-Dali-DistanceField.cpp
+        utc-Dali-DynamicsBody.cpp
+        utc-Dali-DynamicsBodyConfig.cpp
+        utc-Dali-DynamicsJoint.cpp
+        utc-Dali-DynamicsShape.cpp
+        utc-Dali-DynamicsWorld.cpp
+        utc-Dali-DynamicsWorldConfig.cpp
+        utc-Dali-EncodedBufferImage.cpp
         utc-Dali-Font.cpp
         utc-Dali-FontParameters.cpp
         utc-Dali-FrameBufferImage.cpp
         utc-Dali-Gesture.cpp
         utc-Dali-GestureDetector.cpp
         utc-Dali-Handle.cpp
+        utc-Dali-HitTestAlgorithm.cpp
         utc-Dali-HoverProcessing.cpp
         utc-Dali-Image.cpp
         utc-Dali-ImageActor.cpp
         utc-Dali-ImageAttributes.cpp
         utc-Dali-KeyEvent.cpp
         utc-Dali-Layer.cpp
+        utc-Dali-LightActor.cpp
+        utc-Dali-LocklessBuffer.cpp
         utc-Dali-LongPressGesture.cpp
         utc-Dali-LongPressGestureDetector.cpp
         utc-Dali-Material.cpp
@@ -40,6 +53,11 @@ SET(TC_SOURCES
         utc-Dali-Matrix.cpp
         utc-Dali-Matrix3.cpp
         utc-Dali-MeshActor.cpp
+        utc-Dali-MeshData.cpp
+        utc-Dali-Model.cpp
+        utc-Dali-MouseWheelEvent.cpp
+        utc-Dali-NinePatchImages.cpp
+        utc-Dali-ObjectRegistry.cpp
         utc-Dali-PanGesture.cpp
         utc-Dali-PanGestureDetector.cpp
         utc-Dali-Path.cpp
@@ -50,13 +68,16 @@ SET(TC_SOURCES
         utc-Dali-PropertyNotification.cpp
         utc-Dali-Quaternion.cpp
         utc-Dali-Radian.cpp
+        utc-Dali-Random.cpp
         utc-Dali-Rect.cpp
         utc-Dali-RenderTask.cpp
         utc-Dali-RenderTaskList.cpp
         utc-Dali-RenderableActor.cpp
         utc-Dali-ShaderEffect.cpp
+        utc-Dali-Scripting.cpp
         utc-Dali-SignalTemplatesFunctors.cpp
         utc-Dali-SignalTemplates.cpp
+        utc-Dali-Spline.cpp
         utc-Dali-Stage.cpp
         utc-Dali-TapGesture.cpp
         utc-Dali-TapGestureDetector.cpp
@@ -65,15 +86,20 @@ SET(TC_SOURCES
         utc-Dali-TextStyle.cpp
         utc-Dali-TouchEventCombiner.cpp
         utc-Dali-TouchProcessing.cpp
+        utc-Dali-TypeRegistry.cpp
+        utc-Dali-Utf8.cpp
+        utc-Dali-Vector.cpp
         utc-Dali-Vector2.cpp
         utc-Dali-Vector3.cpp
         utc-Dali-Vector4.cpp
 )
 
 LIST(APPEND TC_SOURCES
+        dali-test-suite-utils/mesh-builder.cpp
         dali-test-suite-utils/test-harness.cpp
         dali-test-suite-utils/dali-test-suite-utils.cpp
         dali-test-suite-utils/test-application.cpp
+        dali-test-suite-utils/test-dynamics.cpp
         dali-test-suite-utils/test-gesture-manager.cpp
         dali-test-suite-utils/test-gl-abstraction.cpp
         dali-test-suite-utils/test-gl-sync-abstraction.cpp
index 779fd2a..bec0333 100644 (file)
@@ -26,7 +26,8 @@ namespace Dali
  * Constructor
  */
 TestPlatformAbstraction::TestPlatformAbstraction()
-: mRequest(0)
+: mRequest(0),
+  mDynamicsFactory(NULL)
 {
   Initialize();
 }
@@ -36,6 +37,7 @@ TestPlatformAbstraction::TestPlatformAbstraction()
  */
 TestPlatformAbstraction::~TestPlatformAbstraction()
 {
+  delete mDynamicsFactory;
 }
 
 /**
@@ -349,7 +351,7 @@ bool TestPlatformAbstraction::ValidateFontFamilyName(const std::string& fontFami
 /**
  * @copydoc PlatformAbstraction::GetFontList()
  */
-void TestPlatformAbstraction::GetFontList( PlatformAbstraction::FontListMode mode, std::vector<std::string>& fonstList ) const
+void TestPlatformAbstraction::GetFontList( PlatformAbstraction::FontListMode mode, std::vector<std::string>& fontList ) const
 {
   mFontListMode = mode;
   mTrace.PushCall("ValidateGetFontList", "");
@@ -392,7 +394,11 @@ void TestPlatformAbstraction::UpdateDefaultsFromDevice()
 Integration::DynamicsFactory* TestPlatformAbstraction::GetDynamicsFactory()
 {
   mTrace.PushCall("GetDynamicsFactory", "");
-  return NULL;
+  if( mDynamicsFactory == NULL )
+  {
+    mDynamicsFactory = new TestDynamicsFactory( mTrace );
+  }
+  return mDynamicsFactory;
 }
 
 bool TestPlatformAbstraction::ReadGlobalMetricsFromCache( const std::string& fontFamily,
@@ -442,7 +448,6 @@ void TestPlatformAbstraction::WriteMetricsToCache( const std::string& fontFamily
   mTrace.PushCall("WriteMetricsToCacheFile", "");
 }
 
-
 void TestPlatformAbstraction::GetFileNamesFromDirectory( const std::string& directoryName,
                                                          std::vector<std::string>& fileNames )
 {
@@ -452,7 +457,6 @@ void TestPlatformAbstraction::GetFileNamesFromDirectory( const std::string& dire
   fileNames.push_back( std::string( "u1f601.png" ) );
 }
 
-
 Integration::BitmapPtr TestPlatformAbstraction::GetGlyphImage( const std::string& fontFamily, const std::string& fontStyle, float fontSize, uint32_t character ) const
 {
   Integration::BitmapPtr image = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD );
@@ -463,7 +467,6 @@ Integration::BitmapPtr TestPlatformAbstraction::GetGlyphImage( const std::string
   return image;
 }
 
-
 /** Call this every test */
 void TestPlatformAbstraction::Initialize()
 {
@@ -645,5 +648,4 @@ void TestPlatformAbstraction::SetReadMetricsResult( bool success, std::vector<In
   mReadMetrics = glyphMetricsContainer; // copy
 }
 
-
 } // namespace Dali
index f3f22ac..3a94578 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <dali/integration-api/glyph-set.h>
 #include "test-trace-call-stack.h"
-
+#include "test-dynamics.h"
 
 namespace Dali
 {
@@ -111,9 +111,6 @@ public:
    */
   virtual void LoadResource(const Integration::ResourceRequest& request);
 
-  /**
-   * @copydoc PlatformAbstraction::LoadResourceSynchronously()
-   */
   virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
 
   /**
@@ -149,7 +146,7 @@ public:
   /**
    * @copydoc PlatformAbstraction::GetFontLineHeightFromCapsHeight()
    */
-  virtual Dali::PixelSize GetFontLineHeightFromCapsHeight(const std::string& fontFamily, const std::string& fontStyle, CapsHeight capsHeight) const;
+  virtual PixelSize GetFontLineHeightFromCapsHeight(const std::string& fontFamily, const std::string& fontStyle, CapsHeight capsHeight) const;
 
   /**
    * @copydoc PlatformAbstraction::GetGlyphData()
@@ -233,7 +230,6 @@ public:
                                     const std::string& fontStyle,
                                     const Integration::GlyphSet& glyphSet );
 
-
   virtual void GetFileNamesFromDirectory( const std::string& directoryName,
                                           std::vector<std::string>& fileNames );
 
@@ -325,6 +321,7 @@ public: // TEST FUNCTIONS
   void SetReadGlobalMetricsResult( bool success, Integration::GlobalMetrics& globalMetrics );
 
   void SetReadMetricsResult( bool success, std::vector<Integration::GlyphMetrics>& glyphMetricsContainer );
+
 private:
   mutable TraceCallStack        mTrace;
   size_t                        mSeconds;
@@ -345,6 +342,7 @@ private:
   LoadFileResult                mLoadFileResult;
   bool                          mSaveFileResult;
   mutable FontListMode          mFontListMode;
+  TestDynamicsFactory*          mDynamicsFactory;
 };
 
 } // Dali
index 653f5c5..530913a 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
 #include <dali-test-suite-utils.h>
+#include <mesh-builder.h>
 
 using namespace Dali;
 
@@ -231,6 +232,21 @@ int UtcDaliAnimatableMeshDownCast01(void)
   END_TEST;
 }
 
+int UtcDaliAnimatableMeshDownCast02(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::AnimatableMesh::DownCast()");
+
+  MeshData meshData;
+  CreateMeshData(meshData);
+  Mesh mesh = Mesh::New(meshData);
+  BaseHandle* bh = &mesh;
+
+  AnimatableMesh mesh2 = AnimatableMesh::DownCast(*bh);
+  DALI_TEST_CHECK( ! mesh2 );
+  END_TEST;
+}
+
 int UtcDaliAnimatableMeshGetPropertyIndex01(void)
 {
   TestApplication application;
 
 using namespace Dali;
 
-void utc_dali_unmanaged_startup(void)
+void utc_dali_constrainable_startup(void)
 {
   test_return_value = TET_UNDEF;
 }
 
-void utc_dali_unmanaged_cleanup(void)
+void utc_dali_constrainable_cleanup(void)
 {
   test_return_value = TET_PASS;
 }
index aa10dd3..1d2cde3 100644 (file)
@@ -643,11 +643,16 @@ private:
 };
 
 
+
+using namespace Dali;
+
 BaseHandle CreateActor()
 {
   return TestCustomActor::New();
 }
 
+Dali::TypeRegistration mType( typeid(TestCustomActor), typeid(Dali::CustomActor), CreateActor );
+
 } // anon namespace
 
 
@@ -1633,3 +1638,45 @@ int UtcDaliCustomActorGetImplementation(void)
   DALI_TEST_CHECK( true );
   END_TEST;
 }
+
+int UtcDaliCustomActorDoAction(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::CustomActor::DoAction()");
+
+  TestCustomActor custom = TestCustomActor::New();
+
+  BaseHandle customActorObject = custom;
+
+  DALI_TEST_CHECK(customActorObject);
+
+  std::vector<Property::Value> attributes;
+
+  // Check that an invalid command is not performed
+  DALI_TEST_CHECK(customActorObject.DoAction("invalidCommand", attributes) == false);
+
+  // Check that the custom actor is visible
+  custom.SetVisible(true);
+  DALI_TEST_CHECK(custom.IsVisible() == true);
+
+  // Check the custom actor performed an action to hide itself
+  DALI_TEST_CHECK(customActorObject.DoAction("hide", attributes) == true);
+
+  // flush the queue and render once
+  application.SendNotification();
+  application.Render();
+
+  // Check that the custom actor is now invisible
+  DALI_TEST_CHECK(custom.IsVisible() == false);
+
+  // Check the custom actor performed an action to show itself
+  DALI_TEST_CHECK(customActorObject.DoAction("show", attributes) == true);
+
+  // flush the queue and render once
+  application.SendNotification();
+  application.Render();
+
+  // Check that the custom actor is now visible
+  DALI_TEST_CHECK(custom.IsVisible() == true);
+  END_TEST;
+}
index 5c5a996..eb72b1b 100644 (file)
@@ -23,6 +23,7 @@
 
 using namespace Dali;
 
+#include <mesh-builder.h>
 
 void mesh_actor_test_startup(void)
 {
@@ -37,7 +38,21 @@ void mesh_actor_test_cleanup(void)
 namespace
 {
 
-static AnimatableMesh NewMesh()
+static Mesh NewMesh()
+{
+  MeshData meshData;
+  MeshData::VertexContainer    vertices;
+  MeshData::FaceIndices        faces;
+  BoneContainer                bones;
+  ConstructVertices(vertices, 60);
+  ConstructFaces(vertices, faces);
+  Material customMaterial = ConstructMaterial();
+  meshData.SetData(vertices, faces, bones, customMaterial);
+  Mesh mesh = Mesh::New(meshData);
+  return mesh;
+}
+
+static AnimatableMesh NewAnimatableMesh()
 {
   AnimatableMesh::Faces faces;
   faces.push_back(0);
@@ -70,7 +85,7 @@ int UtcDaliMeshActorNew01(void)
   TestApplication application;
   tet_infoline("Testing Dali::MeshActor::New()");
 
-  AnimatableMesh mesh = NewMesh();
+  AnimatableMesh mesh = NewAnimatableMesh();
   MeshActor actor = MeshActor::New(mesh);
   application.SendNotification();
   application.Render();
@@ -81,6 +96,42 @@ int UtcDaliMeshActorNew01(void)
   END_TEST;
 }
 
+int UtcDaliMeshActorNew02(void)
+{
+  TestApplication application;
+  TestPlatformAbstraction& platform = application.GetPlatform();
+
+  tet_infoline("Testing Dali::MeshActor::New()");
+
+  std::string modelName("AModel");
+  Dali::ModelData modelData = Dali::ModelData::New(modelName);
+  Dali::Entity rootEntity = Dali::Entity::New("root");
+  modelData.SetRootEntity(rootEntity);
+  rootEntity.SetType(Dali::Entity::OBJECT);
+
+  Model model = Model::New("Fake model");
+
+  // Run Core - will query using TestPlatformAbstraction::GetResources().
+  application.SendNotification();
+  application.Render();
+
+  Integration::ResourceRequest* request = platform.GetRequest();
+  if(request)
+  {
+    platform.SetResourceLoaded(request->GetId(), request->GetType()->id, Integration::ResourcePointer(&(modelData.GetBaseObject())));
+  }
+
+  application.Render();
+  application.SendNotification();
+
+  Actor actor = ModelActorFactory::BuildActorTree(model, ""); // model should be loaded
+
+  DALI_TEST_CHECK(model.GetLoadingState() == ResourceLoadingSucceeded);
+  DALI_TEST_CHECK(actor);
+  DALI_TEST_CHECK(actor.GetName().compare("root") == 0);
+  END_TEST;
+}
+
 int UtcDaliMeshActorNew03(void)
 {
   TestApplication application;
@@ -99,11 +150,768 @@ int UtcDaliMeshActorNew03(void)
   END_TEST;
 }
 
+int UtcDaliMeshActorCreateNoMeshData(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::Mesh::New() - Create with no mesh data");
+
+  try
+  {
+    MeshData meshData;
+    Mesh mesh = Mesh::New(meshData);
+    MeshActor actor1 = MeshActor::New(mesh);
+  }
+  catch(Dali::DaliException& e)
+  {
+    DALI_TEST_PRINT_ASSERT( e );
+    DALI_TEST_ASSERT(e, "object", TEST_LOCATION);
+  }
+  END_TEST;
+}
+
+
+int UtcDaliMeshActorCreateSetData01(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshData::SetData() - Create with no verts");
+  try
+  {
+    MeshData meshData;
+    MeshData::VertexContainer vertices;
+    MeshData::FaceIndices     faces;
+    BoneContainer             bones;
+    Material                  customMaterial;
+    meshData.SetData(vertices, faces, bones, customMaterial);
+    Mesh mesh = Mesh::New(meshData);
+    MeshActor actor1 = MeshActor::New(mesh);
+  }
+  catch(Dali::DaliException& e)
+  {
+    DALI_TEST_PRINT_ASSERT( e );
+    DALI_TEST_ASSERT(e, "!vertices.empty()", TEST_LOCATION );
+  }
+  END_TEST;
+}
+
+int UtcDaliMeshActorCreateSetData02(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshData::SetData - Create with no faces");
+  try
+  {
+    MeshData meshData;
+    MeshData::VertexContainer    vertices;
+    MeshData::FaceIndices        faces;
+    BoneContainer                bones;
+    Material                     customMaterial;
+    ConstructVertices(vertices, 60);
+    meshData.SetData(vertices, faces, bones, customMaterial);
+    Mesh mesh = Mesh::New(meshData);
+    MeshActor actor1 = MeshActor::New(mesh);
+  }
+  catch(Dali::DaliException& e)
+  {
+    DALI_TEST_PRINT_ASSERT( e );
+    DALI_TEST_ASSERT(e, "!faceIndices.empty", TEST_LOCATION );
+  }
+  END_TEST;
+}
+
+int UtcDaliMeshActorCreateSetData03(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshData::SetData - Create with no mats");
+  try
+  {
+    MeshData meshData;
+    MeshData::VertexContainer    vertices;
+    MeshData::FaceIndices        faces;
+    BoneContainer                bones;
+    Material                     customMaterial;
+    ConstructVertices(vertices, 60);
+    ConstructFaces(vertices, faces);
+    meshData.SetData(vertices, faces, bones, customMaterial);
+    Mesh mesh = Mesh::New(meshData);
+    MeshActor actor1 = MeshActor::New(mesh);
+  }
+  catch(Dali::DaliException& e)
+  {
+    DALI_TEST_PRINT_ASSERT( e );
+    DALI_TEST_ASSERT(e, "material", TEST_LOCATION );
+  }
+  END_TEST;
+}
+
+int UtcDaliMeshActorCreateSetData04(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::SetData()");
+
+  MeshData meshData;
+  MeshData::VertexContainer    vertices;
+  MeshData::FaceIndices        faces;
+  BoneContainer                bones;
+  ConstructVertices(vertices, 60);
+  ConstructFaces(vertices, faces);
+  Material customMaterial = ConstructMaterial();
+  meshData.SetData(vertices, faces, bones, customMaterial);
+
+  Mesh mesh = Mesh::New(meshData);
+  MeshActor actor1 = MeshActor::New(mesh);
+  DALI_TEST_CHECK(actor1);
+  END_TEST;
+}
+
+
+int UtcDaliMeshActorDownCast(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::DownCast()");
+
+  MeshData meshData;
+  MeshData::VertexContainer    vertices;
+  MeshData::FaceIndices        faces;
+  BoneContainer                bones;
+  ConstructVertices(vertices, 60);
+  ConstructFaces(vertices, faces);
+  Material customMaterial = ConstructMaterial();
+  meshData.SetData(vertices, faces, bones, customMaterial);
+  Mesh mesh = Mesh::New(meshData);
+
+  MeshActor actor1 = MeshActor::New(mesh);
+  Actor anActor = Actor::New();
+  anActor.Add(actor1);
+
+  Actor child = anActor.GetChildAt(0);
+  MeshActor meshActor = MeshActor::DownCast(child);
+
+  DALI_TEST_CHECK(meshActor);
+  END_TEST;
+}
+
+int UtcDaliMeshActorDownCast2(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::DownCast()");
+
+  Actor actor1 = Actor::New();
+  Actor anActor = Actor::New();
+  anActor.Add(actor1);
+
+  Actor child = anActor.GetChildAt(0);
+  MeshActor meshActor = MeshActor::DownCast(child);
+  DALI_TEST_CHECK(!meshActor);
+
+  Actor unInitialzedActor;
+  meshActor = DownCast< MeshActor >( unInitialzedActor );
+  DALI_TEST_CHECK(!meshActor);
+  END_TEST;
+}
+
+int UtcDaliMeshActorSetMaterial01(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
+
+  Mesh mesh = NewMesh();
+
+  MeshActor actor = MeshActor::New(mesh);
+  std::string name = "AMeshActor";
+  Stage::GetCurrent().Add(actor);
+  actor.SetName(name);
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  Material customMaterial = Material::New("CustomMaterial");
+  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+
+  MeshActor::SetMaterial(actor, name, customMaterial);
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  DALI_TEST_CHECK( actor.GetMaterial() == customMaterial );
+  END_TEST;
+}
+
+int UtcDaliMeshActorSetMaterial01b(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
+
+  Mesh mesh = NewMesh();
+
+  Actor rootActor = Actor::New();
+  MeshActor meshActor = MeshActor::New(mesh);
+  rootActor.Add(meshActor);
+
+  std::string name = "AMeshActor";
+  meshActor.SetName(name);
+
+  Stage::GetCurrent().Add(rootActor);
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  Material customMaterial = Material::New("CustomMaterial");
+  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+
+  MeshActor::SetMaterial(rootActor, name, customMaterial);
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  DALI_TEST_CHECK(meshActor.GetMaterial() == customMaterial );
+  END_TEST;
+}
+
+
+int UtcDaliMeshActorSetMaterial02(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
+
+  Mesh mesh = NewMesh();
+  MeshActor actor = MeshActor::New(mesh);
+
+  std::string name = "AMeshActor";
+  actor.SetName(name);
+  Stage::GetCurrent().Add(actor);
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  Material baseMat = actor.GetMaterial();
+  Material customMaterial = Material::New("CustomMaterial");
+  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+
+  MeshActor::SetMaterial(actor, "NoName", customMaterial);
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  DALI_TEST_CHECK( actor.GetMaterial() == baseMat );
+  DALI_TEST_CHECK( actor.GetMaterial() != customMaterial );
+  END_TEST;
+}
+
+int UtcDaliMeshActorSetMaterial02b(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
+
+  Mesh mesh = NewMesh();
+
+  MeshActor actor = MeshActor::New(mesh);
+  Stage::GetCurrent().Add(actor);
+
+  std::string name = "AMeshActor";
+  actor.SetName(name);
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  Material baseMat = actor.GetMaterial();
+  Material customMaterial = Material::New("CustomMaterial");
+  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+
+  MeshActor::SetMaterial(actor, "NoName", customMaterial);
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  DALI_TEST_CHECK( actor.GetMaterial() == baseMat );
+  DALI_TEST_CHECK( actor.GetMaterial() != customMaterial );
+  END_TEST;
+}
+
+
+int UtcDaliMeshActorSetMaterial03(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
+
+  Mesh mesh = NewMesh();
+
+  MeshActor actor = MeshActor::New(mesh);
+  std::string name = "AMeshActor";
+  actor.SetName(name);
+  Stage::GetCurrent().Add(actor);
+
+  Material customMaterial = Material::New("CustomMaterial");
+  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+
+  actor.SetMaterial(customMaterial);
+  application.SendNotification();
+  application.Render(0);
+  application.Render(16);
+  application.SendNotification();
+
+  DALI_TEST_CHECK(actor.GetMaterial() == customMaterial );
+  END_TEST;
+}
+
+int UtcDaliMeshActorSetMaterial03b(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
+
+  Mesh mesh = NewMesh();
+
+  MeshActor actor = MeshActor::New(mesh);
+  std::string name = "AMeshActor";
+  actor.SetName(name);
+  Stage::GetCurrent().Add(actor);
+
+  Material customMaterial = Material::New("CustomMaterial");
+  customMaterial.SetDiffuseColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+
+  actor.SetMaterial(customMaterial);
+  application.SendNotification();
+  application.Render(0);
+  application.Render(16);
+  application.SendNotification();
+  DALI_TEST_CHECK(actor.GetMaterial() == customMaterial );
+  END_TEST;
+}
+
+
+
+int UtcDaliMeshActorGetMaterial01(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
+
+  MeshData meshData;
+  MeshData::VertexContainer vertices;
+  MeshData::FaceIndices faces;
+  BoneContainer bones;
+  ConstructVertices(vertices, 60);
+  ConstructFaces(vertices, faces);
+  Material material = ConstructMaterial();
+  meshData.SetData(vertices, faces, bones, material);
+  Mesh mesh = Mesh::New(meshData);
+
+  MeshActor actor = MeshActor::New(mesh);
+  std::string name = "AMeshActor";
+  actor.SetName(name);
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  Material gotMaterial = actor.GetMaterial();
+
+  DALI_TEST_EQUALS( material.GetOpacity(), gotMaterial.GetOpacity(), TEST_LOCATION );
+  DALI_TEST_EQUALS( material.GetAmbientColor(), gotMaterial.GetAmbientColor(), TEST_LOCATION );
+  DALI_TEST_EQUALS( material.GetDiffuseColor(), gotMaterial.GetDiffuseColor(), TEST_LOCATION );
+  DALI_TEST_EQUALS( material.GetSpecularColor(), gotMaterial.GetSpecularColor(), TEST_LOCATION );
+  END_TEST;
+}
+
+
+int UtcDaliMeshActorGetMaterial02(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::SetMaterial()");
+
+  MeshData meshData;
+  MeshData::VertexContainer vertices;
+  MeshData::FaceIndices faces;
+  BoneContainer bones;
+  ConstructVertices(vertices, 60);
+  ConstructFaces(vertices, faces);
+  Material material = ConstructMaterial();
+  meshData.SetData(vertices, faces, bones, material);
+  Mesh mesh = Mesh::New(meshData);
+
+  MeshActor actor = MeshActor::New(mesh);
+  std::string name = "AMeshActor";
+  actor.SetName(name);
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  Material gotMaterial = actor.GetMaterial();
+
+  DALI_TEST_EQUALS( material.GetOpacity(), gotMaterial.GetOpacity(), TEST_LOCATION );
+  DALI_TEST_EQUALS( material.GetAmbientColor(), gotMaterial.GetAmbientColor(), TEST_LOCATION );
+  DALI_TEST_EQUALS( material.GetDiffuseColor(), gotMaterial.GetDiffuseColor(), TEST_LOCATION );
+  DALI_TEST_EQUALS( material.GetSpecularColor(), gotMaterial.GetSpecularColor(), TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliMeshActorSetLighting01(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::GetLighting()");
+
+  Mesh mesh = NewMesh();
+
+  MeshActor actor = MeshActor::New(mesh);
+  Stage::GetCurrent().Add(actor);
+
+  // Mesh actors should be lit by default
+  DALI_TEST_EQUALS(actor.IsAffectedByLighting(), true, TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliMeshActorSetLighting02(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::SetLighting()");
+
+  Mesh mesh = NewMesh();
+  MeshActor actor = MeshActor::New(mesh);
+  Stage::GetCurrent().Add(actor);
+
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  Light light = Light::New("KeyLight");
+  light.SetFallOff(Vector2(10000.0f, 10000.0f));
+  LightActor keyLightActor = LightActor::New();
+  keyLightActor.SetParentOrigin(ParentOrigin::CENTER);
+  keyLightActor.SetPosition(200.0f, 500.0f, 300.0f);
+  keyLightActor.SetName(light.GetName());
+
+  Stage::GetCurrent().Add(keyLightActor);
+  keyLightActor.SetLight(light);
+  keyLightActor.SetActive(true);
+
+  actor.SetAffectedByLighting(true);
+  DALI_TEST_EQUALS(actor.IsAffectedByLighting(), true, TEST_LOCATION);
+
+  // Test rendering to ensure that the correct shader setup is used in renderer
+  // (check in debugger or via coverage)
+  application.Render(1);
+  application.SendNotification();
+  application.Render(1);
+  application.SendNotification();
+  application.Render(1);
+  application.SendNotification();
+  application.Render(1);
+  application.SendNotification();
+  application.Render(1);
+
+  actor.SetAffectedByLighting(false);
+  DALI_TEST_EQUALS(actor.IsAffectedByLighting(), false, TEST_LOCATION);
+
+  // Test rendering to ensure that the correct shader setup is used in renderer
+  // (check in debugger or via coverage)
+  application.Render(1);
+  application.SendNotification();
+  application.Render(1);
+  application.SendNotification();
+  application.Render(1);
+  application.SendNotification();
+  application.Render(1);
+  application.SendNotification();
+  application.Render(1);
+  END_TEST;
+}
+
+namespace
+{
+
+Material ConstructMaterial(float opacity, float diffuseOpacity)
+{
+  Material customMaterial = Material::New("CustomMaterial");
+  customMaterial.SetOpacity(opacity);
+  customMaterial.SetDiffuseColor(Vector4(0.8f, 0.0f, 0.4f, diffuseOpacity));
+  customMaterial.SetAmbientColor(Vector4(0.2f, 1.0f, 0.6f, 1.0f));
+  customMaterial.SetSpecularColor(Vector4(0.5f, 0.6f, 0.7f, 1.0f));
+  return customMaterial;
+}
+
+static void TestBlending( TestApplication& application, Material material, float actorOpacity, BlendingMode::Type blendingMode, bool expectedBlend )
+{
+  MeshData meshData;
+  MeshData::VertexContainer vertices;
+  MeshData::FaceIndices faces;
+  BoneContainer bones;
+  ConstructVertices(vertices, 60);
+  ConstructFaces(vertices, faces);
+  meshData.SetData(vertices, faces, bones, material);
+  Mesh mesh = Mesh::New(meshData);
+
+  application.SendNotification();
+  application.Render(0);
+  application.Render();
+  application.SendNotification();
+
+  MeshActor actor = MeshActor::New(mesh);
+  Stage::GetCurrent().Add(actor);
+
+  actor.SetAffectedByLighting(false);
+  actor.SetBlendMode(blendingMode);
+  actor.SetOpacity(actorOpacity);
+
+  TraceCallStack& cullFaceTrace = application.GetGlAbstraction().GetCullFaceTrace();
+  cullFaceTrace.Enable(true);
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( BlendEnabled( cullFaceTrace ), expectedBlend, TEST_LOCATION );
+}
+} //anonymous namespace
+
+
+int UtcDaliMeshActorBlend01(void)
+{
+  // Set Material with translucent color, actor color opaque, Set Use image alpha to true
+  // Expect blending
+
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::Blend01()");
+
+  TestBlending( application, ConstructMaterial(0.5f, 0.5f), 1.0f, BlendingMode::AUTO, true );
+  END_TEST;
+}
+
+
+int UtcDaliMeshActorBlend02(void)
+{
+  // Set material to translucent, set use image alpha to false, set actor opacity to 1.0f
+  // Expect no blending
+
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::Blend02()");
+  TestBlending( application, ConstructMaterial(0.5f, 0.5f), 1.0f, BlendingMode::OFF, false );
+  END_TEST;
+}
+
+int UtcDaliMeshActorBlend03(void)
+{
+  // Set material to opaque, set use image alpha to true, set actor opacity to 1.0f
+  // Expect no blending
+
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::Blend03()");
+  TestBlending( application, ConstructMaterial(1.0f, 1.0f), 1.0f, BlendingMode::AUTO, false );
+  END_TEST;
+}
+
+
+int UtcDaliMeshActorBlend04(void)
+{
+  // Set material to have image with alpha, set use image alpha to true, set actor opacity to 1.0f
+  // Expect blending
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::Blend04()");
+
+  Material material = ConstructMaterial(1.0f, 1.0f);
+  BitmapImage image = BitmapImage::New( 100, 50, Pixel::RGBA8888 );
+  material.SetDiffuseTexture( image );
+  application.SendNotification();
+  application.Render(0);
+
+  TestBlending( application, material, 1.0f, BlendingMode::AUTO, true );
+  END_TEST;
+}
+
+int UtcDaliMeshActorBlend05(void)
+{
+  // Set material to have image with alpha, set use image alpha to false, set actor opacity to 1.0f
+  // Expect no blending
+
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::Blend05()");
+
+  Material material = ConstructMaterial(1.0f, 1.0f);
+  BitmapImage image = BitmapImage::New( 100, 50, Pixel::RGBA8888 );
+  material.SetDiffuseTexture( image );
+  application.SendNotification();
+  application.Render(0);
+
+  TestBlending( application, material, 1.0f, BlendingMode::ON, true );
+  END_TEST;
+}
+
+
+int UtcDaliMeshActorBlend06(void)
+{
+  // Set material to have image without alpha, set use image alpha to true, set actor opacity to 1.0f
+  // Expect no blending
+
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::Blend()");
+
+  Material material = ConstructMaterial(1.0f, 1.0f);
+  BitmapImage image = BitmapImage::New( 100, 50, Pixel::RGB888 );
+  material.SetDiffuseTexture( image );
+  application.SendNotification();
+  application.Render(0);
+
+  TestBlending( application, material, 1.0f, BlendingMode::AUTO, false );
+  END_TEST;
+}
+
+int UtcDaliMeshActorBlend07(void)
+{
+  // Set material to have framebuffer with alpha, set use image alpha to true, set actor opacity to 1.0f
+  // Expect blending
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::Blend07()");
+  application.Render(0);
+
+  Material material = ConstructMaterial(1.0f, 1.0f);
+  FrameBufferImage image = FrameBufferImage::New( 100, 50, Pixel::RGBA8888 );
+  RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+  RenderTask task = taskList.GetTask( 0u );
+  task.SetTargetFrameBuffer( image ); // To ensure frame buffer is connected
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  application.SendNotification();
+  application.Render();
+
+  material.SetDiffuseTexture( image ); // (to render from)
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  TestBlending( application, material, 1.0f, BlendingMode::AUTO, true );
+  END_TEST;
+}
+
+int UtcDaliMeshActorBlend08(void)
+{
+  // Set material to have image with alpha, set use image alpha to false, set actor opacity to 0.5f
+  // Expect blending
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::Blend08()");
+
+  Material material = ConstructMaterial(1.0f, 1.0f);
+  BitmapImage image = BitmapImage::New( 100, 50, Pixel::RGBA8888 );
+  material.SetDiffuseTexture( image );
+  application.SendNotification();
+  application.Render(0);
+
+  TestBlending( application, material, 0.5f, BlendingMode::AUTO, true );
+  END_TEST;
+}
+
+int UtcDaliMeshActorBlend09(void)
+{
+  // Set material to have image with no alpha, set material opacity to 0.5, set use image alpha to true, set actor opacity to 1.0f
+  // Expect blending
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::Blend08()");
+
+  Material material = ConstructMaterial(0.5f, 1.0f);
+  BitmapImage image = BitmapImage::New( 100, 50, Pixel::RGB888 );
+  material.SetDiffuseTexture( image );
+  application.SendNotification();
+  application.Render(0);
+
+  TestBlending( application, material, 1.0f, BlendingMode::AUTO, true );
+  END_TEST;
+}
+
+int UtcDaliMeshActorBoneUpdate01(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::MeshActor::BoneUpdate01()");
+
+  // Set up a mesh with bones.
+  // animate bones
+  // ensure bone actor's world matrix is updated
+
+  Actor trunk = Actor::New();
+  trunk.SetName("trunk");
+  trunk.SetPosition(Vector3(100.0f, 200.0f, 300.0f));
+  trunk.SetRotation(Quaternion(M_PI*0.3f, Vector3::XAXIS));
+  Actor branch = Actor::New();
+  branch.SetName("branch");
+  branch.SetPosition(Vector3(10.0f, 100.0f, 0.0f));
+  branch.SetRotation(Quaternion(M_PI*0.2f, Vector3::YAXIS));
+
+  Actor twig = ImageActor::New(CreateBitmapImage());
+  twig.SetName("twig");
+  branch.SetPosition(Vector3(20.0f, 30.0f, 40.0f));
+
+  Actor bug = Actor::New(); // Not a bone
+  bug.SetName("bug");
+  bug.SetPosition(Vector3(10.0f, 10.0f, 10.0f));
+
+  Stage::GetCurrent().Add(trunk);
+  trunk.Add(branch);
+  branch.Add(twig);
+  twig.Add(bug);
+
+  MeshData meshData;
+  CreateMeshData(meshData); // Created with named bones (as above)
+  Mesh mesh = Mesh::New(meshData);
+  MeshActor meshActor = MeshActor::New(mesh);
+  Stage::GetCurrent().Add(meshActor);
+
+  meshActor.BindBonesToMesh(Stage::GetCurrent().GetRootLayer());
+
+  application.SendNotification();
+  application.Render(0);
+  application.Render();
+  application.SendNotification();
+
+  // How to test?
+  // Need to see what bone actor's node has set as world matrix.
+
+  Animation anim = Animation::New(1.0f);
+  anim.RotateBy(trunk, Radian(M_PI*0.5f), Vector3::ZAXIS);
+  anim.Play();
+  application.SendNotification();
+  application.Render(500);
+  application.SendNotification();
+  application.Render(500);
+  application.SendNotification();
+  application.Render(10);
+
+  // All bones have moved.
+  // Check that their world matrix has been updated: ( Isn't IDENTITY )
+  DALI_TEST_CHECK( ! application.GetGlAbstraction().CheckUniformValue("uModelMatrix", Matrix::IDENTITY ) );
+
+  Matrix worldMatrix;
+  GLuint programId, uniformId;
+  DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformIds("uModelMatrix", programId, uniformId) );
+  DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue( programId, uniformId, worldMatrix) );
+
+  // But also check that property is calculated as needed:
+  Matrix calcWorldMatrix = twig.GetCurrentWorldMatrix();
+  DALI_TEST_CHECK( Matrix::IDENTITY != calcWorldMatrix );
+  DALI_TEST_CHECK( worldMatrix == calcWorldMatrix );
+  END_TEST;
+
+}
+
 int UtcDaliMeshActorIndices(void)
 {
   TestApplication application;
   Actor basicActor = Actor::New();
-  AnimatableMesh mesh = NewMesh();
+  Mesh mesh = NewMesh();
+  MeshActor meshActor = MeshActor::New(mesh);
+
+  Property::IndexContainer indices;
+  meshActor.GetPropertyIndices( indices );
+  DALI_TEST_CHECK( indices.size() == basicActor.GetPropertyCount() ); // Mesh Actor does not have any properties
+  DALI_TEST_EQUALS( indices.size(), meshActor.GetPropertyCount(), TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliAnimatableMeshActorIndices(void)
+{
+  TestApplication application;
+  Actor basicActor = Actor::New();
+  AnimatableMesh mesh = NewAnimatableMesh();
   MeshActor meshActor = MeshActor::New(mesh);
 
   Property::IndexContainer indices;
index 74c41e8..9619b50 100644 (file)
@@ -311,6 +311,41 @@ bool UpdateRender(TestApplication& application, TraceCallStack& callStack, bool
   return result;
 }
 
+// The functor to be used in the hit-test algorithm to check whether the actor is hittable.
+bool IsActorHittableFunction(Actor actor, Dali::HitTestAlgorithm::TraverseType type)
+{
+  bool hittable = false;
+
+  switch (type)
+  {
+    case Dali::HitTestAlgorithm::CHECK_ACTOR:
+    {
+      // Check whether the actor is visible and not fully transparent.
+      if( actor.IsVisible()
+       && actor.GetCurrentWorldColor().a > 0.01f) // not FULLY_TRANSPARENT
+      {
+
+          hittable = true;
+      }
+      break;
+    }
+    case Dali::HitTestAlgorithm::DESCEND_ACTOR_TREE:
+    {
+      if( actor.IsVisible() ) // Actor is visible, if not visible then none of its children are visible.
+      {
+        hittable = true;
+      }
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  return hittable;
+}
+
 } // unnamed namespace
 
 
@@ -2401,3 +2436,75 @@ int UtcDaliRenderTaskProperties(void)
   DALI_TEST_EQUALS( indices.size(), task.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
+
+int UtcDaliRenderTaskSetScreenToFrameBufferMappingActor(void)
+{
+  TestApplication application;
+  tet_infoline("Testing RenderTask::SetScreenToFrameBufferMappingActor ");
+
+  Stage stage = Stage::GetCurrent();
+  Size stageSize = stage.GetSize();
+  Actor mappingActor = Actor::New();
+  Vector2 scale( 0.6f, 0.75f);
+  Vector2 offset( stageSize.x*0.1f, stageSize.y*0.15f);
+  mappingActor.SetSize( stageSize * scale );
+  mappingActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  mappingActor.SetPosition( offset.x, offset.y );
+  stage.Add( mappingActor );
+
+  Actor offscreenActor = Actor::New();
+  offscreenActor.SetSize( stageSize );
+  offscreenActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  stage.Add( offscreenActor );
+
+  RenderTaskList taskList = stage.GetRenderTaskList();
+  RenderTask renderTask = taskList.CreateTask();
+  FrameBufferImage frameBufferImage =  FrameBufferImage::New(stageSize.width*scale.x, stageSize.height*scale.y, Pixel::A8, Image::Never);
+  renderTask.SetSourceActor( offscreenActor );
+  renderTask.SetExclusive( true );
+  renderTask.SetInputEnabled( true );
+  renderTask.SetTargetFrameBuffer( frameBufferImage );
+  renderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
+  renderTask.SetScreenToFrameBufferMappingActor( mappingActor );
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+  application.Render();
+  application.SendNotification();
+
+  Vector2 screenCoordinates( stageSize.x * 0.05f, stageSize.y * 0.05f );
+  Dali::HitTestAlgorithm::Results results;
+  DALI_TEST_CHECK( !results.actor );
+  DALI_TEST_EQUALS( Vector2::ZERO, results.actorCoordinates, 0.1f, TEST_LOCATION );
+  // miss expected, results not changed
+  DALI_TEST_CHECK( false == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
+  DALI_TEST_CHECK( !results.actor );
+  DALI_TEST_EQUALS( Vector2::ZERO, results.actorCoordinates, 0.1f, TEST_LOCATION );
+
+  screenCoordinates.x = stageSize.x * 0.265f;
+  screenCoordinates.y = stageSize.y * 0.33f;
+  results.actor = Actor();
+  results.actorCoordinates = Vector2::ZERO;
+  // hit expected, results changed
+  DALI_TEST_CHECK( true == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
+  DALI_TEST_CHECK( results.actor  == offscreenActor );
+  DALI_TEST_EQUALS( (screenCoordinates-offset)/scale , results.actorCoordinates, 0.1f, TEST_LOCATION );
+
+  screenCoordinates.x = stageSize.x * 0.435f;
+  screenCoordinates.y = stageSize.y * 0.52f;
+  // hit expected, results changed
+  DALI_TEST_CHECK( true == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
+  DALI_TEST_CHECK( results.actor  == offscreenActor );
+  const Vector2 expectedCoordinates = (screenCoordinates-offset)/scale;
+  DALI_TEST_EQUALS( expectedCoordinates , results.actorCoordinates, 0.1f, TEST_LOCATION );
+
+  screenCoordinates.x = stageSize.x * 0.65f;
+  screenCoordinates.y = stageSize.y * 0.95f;
+  // miss expected, results not changed
+  DALI_TEST_CHECK( false == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
+  DALI_TEST_CHECK( results.actor  == offscreenActor );
+  DALI_TEST_EQUALS( expectedCoordinates , results.actorCoordinates, 0.1f, TEST_LOCATION );
+  END_TEST;
+}
index 184b6be..d82897a 100644 (file)
@@ -117,6 +117,19 @@ private:
   bool& mDeleted;
 };
 
+static const char* TestImageFilename = "icon_wrt.png";
+
+Integration::Bitmap* CreateBitmap( unsigned int imageHeight, unsigned int imageWidth, unsigned int initialColor )
+{
+  Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::RETAIN );
+  Integration::PixelBuffer* pixbuffer = bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888,  imageWidth,imageHeight,imageWidth,imageHeight );
+  unsigned int bytesPerPixel = GetBytesPerPixel(  Pixel::RGBA8888 );
+
+  memset( pixbuffer,  initialColor , imageHeight*imageWidth*bytesPerPixel);
+
+  return bitmap;
+}
+
 } // anon namespace
 
 
@@ -1042,3 +1055,147 @@ int UtcDaliShaderBinaries(void)
   END_TEST;
 }
 
+int UtcDaliShaderEffectFromProperties01(void)
+{
+  TestApplication application;
+  tet_infoline("UtcDaliShaderEffectFromProperties01()");
+
+  std::string fragmentShaderPrefix = "#define TEST_FS 1\n#extension GL_OES_standard_derivatives : enable";
+  std::string vertexShaderPrefix = "#define TEST_VS 1";
+  std::string vertexShader(VertexSource);
+  std::string fragmentShader(FragmentSource);
+
+  // Call render to compile default shaders.
+  application.SendNotification();
+  application.Render();
+
+  GLuint lastShaderCompiledBefore = application.GetGlAbstraction().GetLastShaderCompiled();
+
+  // create from type registry
+
+  TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "ShaderEffect" );
+  DALI_TEST_CHECK( typeInfo );
+  ShaderEffect effect = ShaderEffect::DownCast( typeInfo.CreateInstance() );
+  DALI_TEST_CHECK( effect );
+
+  Property::Value programMap = Property::Value(Property::MAP);
+
+  programMap.SetValue("vertex", vertexShader);
+  programMap.SetValue("fragment", fragmentShader);
+
+  programMap.SetValue("vertex-prefix", vertexShaderPrefix);
+  programMap.SetValue("fragment-prefix", fragmentShaderPrefix);
+
+  programMap.SetValue("geometry-type", "GEOMETRY_TYPE_IMAGE");
+
+  effect.SetProperty(effect.GetPropertyIndex("program"), programMap);
+
+  Property::Value imageMap = Property::Value(Property::MAP);
+  imageMap.SetValue("filename", Property::Value(TestImageFilename));
+  effect.SetProperty(effect.GetPropertyIndex("image"), imageMap);
+
+  // do a update & render to get the image request
+  application.SendNotification();
+  application.Render();
+
+  Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
+  // create the image
+  Integration::Bitmap* bitmap = CreateBitmap( 10, 10, 0xFF );
+  Integration::ResourcePointer resourcePtr(bitmap);
+  TestPlatformAbstraction& platform = application.GetPlatform();
+  platform.SetResourceLoaded(request->GetId(), request->GetType()->id, resourcePtr);
+
+  BitmapImage image(CreateBitmapImage());
+  ImageActor actor = ImageActor::New( image );
+  actor.SetSize( 100.0f, 100.0f );
+  actor.SetName("TestImageFilenameActor");
+  actor.SetShaderEffect(effect);
+  Stage::GetCurrent().Add(actor);
+
+  application.SendNotification();
+  application.Render();
+  GLuint lastShaderCompiledAfter = application.GetGlAbstraction().GetLastShaderCompiled();
+
+  // we should have compiled 2 shaders.
+  DALI_TEST_EQUALS(lastShaderCompiledAfter, lastShaderCompiledBefore + 2, TEST_LOCATION );
+
+  std::string actualVertexShader = application.GetGlAbstraction().GetShaderSource( lastShaderCompiledBefore + 1 );
+  DALI_TEST_EQUALS( vertexShaderPrefix, actualVertexShader.substr( 0, vertexShaderPrefix.length() ), TEST_LOCATION );
+  DALI_TEST_EQUALS( vertexShader, actualVertexShader.substr( actualVertexShader.length() - vertexShader.length() ), TEST_LOCATION );
+
+  std::string actualFragmentShader = application.GetGlAbstraction().GetShaderSource( lastShaderCompiledBefore + 2 );
+  DALI_TEST_EQUALS( fragmentShaderPrefix, actualFragmentShader.substr( 0, fragmentShaderPrefix.length() ), TEST_LOCATION );
+  DALI_TEST_EQUALS( fragmentShader, actualFragmentShader.substr( actualFragmentShader.length() - fragmentShader.length() ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliShaderEffectFromProperties02(void)
+{
+  try
+  {
+    TestApplication application;
+    tet_infoline("UtcDaliShaderEffectFromProperties02()");
+
+    // Call render to compile default shaders.
+    application.SendNotification();
+    application.Render();
+    application.Render();
+    application.Render();
+
+    // create from type registry (currently only way to get ShaderEffect with no shader setup in constructor
+    TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "ShaderEffect" );
+    DALI_TEST_CHECK( typeInfo );
+    ShaderEffect effect = ShaderEffect::DownCast( typeInfo.CreateInstance() );
+    DALI_TEST_CHECK( effect );
+
+    Property::Value programMap = Property::Value(Property::MAP);
+
+    programMap.SetValue("vertex",   std::string(VertexSource));
+    programMap.SetValue("fragment", std::string(FragmentSource));
+
+    // programMap.SetValue("geometry-type", "GEOMETRY_TYPE_IMAGE");
+    // dont set by value
+    programMap.SetValue("geometry-type", GeometryType( GEOMETRY_TYPE_IMAGE ));
+
+    effect.SetProperty(effect.GetPropertyIndex("program"), programMap);
+
+    tet_result( TET_FAIL );
+  }
+  catch(Dali::DaliException& e)
+  {
+    DALI_TEST_PRINT_ASSERT( e );
+  }
+  END_TEST;
+}
+
+int UtcDaliShaderEffectFromProperties03(void)
+{
+  try
+  {
+    TestApplication application;
+    tet_infoline("UtcDaliShaderEffectFromProperties03()");
+
+    // Call render to compile default shaders.
+    application.SendNotification();
+    application.Render();
+    application.Render();
+    application.Render();
+
+    // create from type registry (currently only way to get ShaderEffect with no shader setup in constructor
+    TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "ShaderEffect" );
+    DALI_TEST_CHECK( typeInfo );
+    ShaderEffect effect = ShaderEffect::DownCast( typeInfo.CreateInstance() );
+    DALI_TEST_CHECK( effect );
+
+    // dont set unknown
+    effect.SetProperty( effect.GetPropertyIndex("geometry-hints"), "HINT_2" );
+
+    tet_result( TET_FAIL );
+  }
+  catch(Dali::DaliException& e)
+  {
+    DALI_TEST_PRINT_ASSERT( e );
+  }
+  END_TEST;
+}
@@ -15,6 +15,8 @@
  *
  */
 
+#define ENABLE_VECTOR_ASSERTS
+
 #include <iostream>
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
index f24571b..f7a73e3 100644 (file)
@@ -135,8 +135,8 @@ linker_test_SOURCES = linker-test.cpp  \
     ../../../automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.cpp \
     ../../../automated-tests/src/dali/dali-test-suite-utils/test-gesture-manager.cpp \
     ../../../automated-tests/src/dali/dali-test-suite-utils/test-gl-sync-abstraction.cpp \
-    ../../../automated-tests/src/dali/dali-test-suite-utils/test-trace-call-stack.cpp
-
+    ../../../automated-tests/src/dali/dali-test-suite-utils/test-trace-call-stack.cpp \
+    ../../../automated-tests/src/dali/dali-test-suite-utils/test-dynamics.cpp
 
 linker_test_CXXFLAGS = \
   -Werror -Wall -Wfloat-equal \