SET(CAPI_LIB "dali-internal")
SET(TC_SOURCES
+ utc-Dali-Atlas.cpp
+ utc-Dali-AnimatableMesh.cpp
+ utc-Dali-Context.cpp
+ utc-Dali-Constrainer.cpp
+ utc-Dali-DistanceField.cpp
+ utc-Dali-DynamicsBodyConfig.cpp
+ utc-Dali-DynamicsShape.cpp
+ utc-Dali-DynamicsWorld.cpp
+ utc-Dali-DynamicsWorldConfig.cpp
+ utc-Dali-Hash.cpp
+ utc-Dali-HitTestAlgorithm.cpp
+ utc-Dali-Material.cpp
+ utc-Dali-MeshActor.cpp
+ utc-Dali-MeshData.cpp
+ utc-Dali-Mutex.cpp
+ utc-Dali-Scripting.cpp
utc-Dali-Internal-Handles.cpp
utc-Dali-Internal-ImageFactory.cpp
utc-Dali-Internal-Mesh.cpp
)
LIST(APPEND TC_SOURCES
- ../dali/dali-test-suite-utils/mesh-builder.cpp
+ 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
INCLUDE_DIRECTORIES(
../../..
+ .
${${CAPI_LIB}_INCLUDE_DIRS}
../dali/dali-test-suite-utils
)
ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
TARGET_LINK_LIBRARIES(${EXEC_NAME}
${${CAPI_LIB}_LIBRARIES}
+ -lpthread
)
INSTALL(PROGRAMS ${EXEC_NAME}
+++ /dev/null
-/*
- * 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>
-#include <dali/internal/update/animation/scene-graph-constraint-base.h>
-
-using namespace Dali;
-
-using Dali::Internal::SceneGraph::ConstraintBase;
-
-int UtcDaliConstraintNewInput1OffStage(void)
-{
- /**
- * Test that the Constraint is correctly added/removed when an object
- * providing the input property is added/removed from the stage
- */
- TestApplication application;
-
- Actor parent = Actor::New();
- Stage::GetCurrent().Add( parent );
-
- Actor actor = Actor::New();
- parent.Add( actor );
-
- Actor sibling1 = Actor::New();
- sibling1.SetPosition( Vector3(1.0f, 2.0f, 3.0f) );
- parent.Add( sibling1 );
-
- Vector3 startValue( 0.0f, 0.0f, 0.0f );
- DALI_TEST_EQUALS( 0u, ConstraintBase::GetCurrentInstanceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( 0u, ConstraintBase::GetTotalInstanceCount(), TEST_LOCATION );
-
- /**
- * Test that the Constraint is correctly applied on a clean Node
- */
- application.SendNotification();
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
-
- // Apply constraint with a parent input property
-
- Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
- Source( sibling1, Actor::Property::POSITION ),
- EqualToConstraint() );
-
- actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3(1.0f, 2.0f, 3.0f)/*from sibling1*/, TEST_LOCATION );
- DALI_TEST_EQUALS( 1u, ConstraintBase::GetCurrentInstanceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( 1u, ConstraintBase::GetTotalInstanceCount(), TEST_LOCATION );
-
- // Remove sibling1 providing the input property
-
- parent.Remove( sibling1 );
- actor.SetPosition( Vector3(2.0f, 2.0f, 2.0f) ); // This should be effective
-
- application.SendNotification();
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3(2.0f, 2.0f, 2.0f)/*from SetPosition*/, TEST_LOCATION );
- DALI_TEST_EQUALS( 0u/*should have been removed*/, ConstraintBase::GetCurrentInstanceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( 1u, ConstraintBase::GetTotalInstanceCount(), TEST_LOCATION );
-
- // Add sibling1 back again (re-enables constraint)
-
- parent.Add( sibling1 );
- actor.SetPosition( Vector3(3.0f, 3.0f, 3.0f) ); // This should NOT be effective
-
- application.SendNotification();
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3(1.0f, 2.0f, 3.0f)/*from sibling1*/, TEST_LOCATION );
- DALI_TEST_EQUALS( 1u, ConstraintBase::GetCurrentInstanceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( 2u/*recreated once*/, ConstraintBase::GetTotalInstanceCount(), TEST_LOCATION );
-
- END_TEST;
-}
utc-Dali-Actor.cpp
utc-Dali-AlphaFunction.cpp
utc-Dali-AngleAxis.cpp
- utc-Dali-AnimatableMesh.cpp
utc-Dali-Animation.cpp
utc-Dali-Any.cpp
- utc-Dali-Atlas.cpp
utc-Dali-BaseHandle.cpp
utc-Dali-BufferImage.cpp
utc-Dali-CameraActor.cpp
- utc-Dali-Constrainer.cpp
utc-Dali-Constraint.cpp
utc-Dali-ConstraintFunction.cpp
utc-Dali-Constraints.cpp
utc-Dali-ConstraintSource.cpp
- utc-Dali-Context.cpp
utc-Dali-ConnectionTracker.cpp
utc-Dali-CustomActor.cpp
utc-Dali-Degree.cpp
- utc-Dali-DistanceField.cpp
- utc-Dali-DynamicsBodyConfig.cpp
- utc-Dali-DynamicsShape.cpp
- utc-Dali-DynamicsWorld.cpp
- utc-Dali-DynamicsWorldConfig.cpp
utc-Dali-EncodedBufferImage.cpp
utc-Dali-FrameBufferImage.cpp
utc-Dali-Gesture.cpp
utc-Dali-GestureDetector.cpp
utc-Dali-Handle.cpp
- utc-Dali-Hash.cpp
- utc-Dali-HitTestAlgorithm.cpp
utc-Dali-HoverProcessing.cpp
utc-Dali-Image.cpp
utc-Dali-ImageActor.cpp
utc-Dali-LocklessBuffer.cpp
utc-Dali-LongPressGesture.cpp
utc-Dali-LongPressGestureDetector.cpp
- utc-Dali-Material.cpp
utc-Dali-MathUtils.cpp
utc-Dali-Matrix.cpp
utc-Dali-Matrix3.cpp
- utc-Dali-MeshActor.cpp
- utc-Dali-MeshData.cpp
utc-Dali-MouseWheelEvent.cpp
- utc-Dali-Mutex.cpp
utc-Dali-NativeImage.cpp
utc-Dali-NinePatchImages.cpp
utc-Dali-ObjectRegistry.cpp
utc-Dali-RenderableActor.cpp
utc-Dali-ResourceImage.cpp
utc-Dali-ShaderEffect.cpp
- utc-Dali-Scripting.cpp
utc-Dali-SignalTemplatesFunctors.cpp
utc-Dali-SignalTemplates.cpp
utc-Dali-Stage.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
ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
TARGET_LINK_LIBRARIES(${EXEC_NAME}
${${CAPI_LIB}_LIBRARIES}
- -lpthread
)
INSTALL(PROGRAMS ${EXEC_NAME}
#include <string>
// INTERNAL INCLUDES
-#include <dali/devel-api/common/set-wrapper.h>
#include <dali/integration-api/platform-abstraction.h>
#include "test-trace-call-stack.h"
#include <stdlib.h>
#include <dali/public-api/dali-core.h>
#include <dali-test-suite-utils.h>
-#include <test-native-image.h>
using namespace Dali;
#include <stdlib.h>
#include <dali-test-suite-utils.h>
#include <dali/public-api/dali-core.h>
-#include <dali/devel-api/actors/mesh-actor.h>
-#include <dali/devel-api/geometry/mesh.h>
using namespace Dali;
-#include "mesh-builder.h"
-
namespace
{
bool& mSignalVerified;
};
-
-struct TestMeshActorCallback
-{
- TestMeshActorCallback(bool& signalReceived)
- : mSignalVerified(signalReceived)
- {
- }
- void operator()(BaseHandle object)
- {
- tet_infoline("Verifying TestMeshActorCallback()");
- MeshActor actor = MeshActor::DownCast(object);
- if(actor)
- {
- mSignalVerified = true;
- }
- }
- bool& mSignalVerified;
-};
-
struct TestAnimationCallback
{
TestAnimationCallback(bool& signalReceived)
END_TEST;
}
-
-int UtcDaliObjectRegistrySignalMeshActorCreated(void)
-{
- TestApplication application;
- ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
-
- bool verified = false;
- TestMeshActorCallback test(verified);
-
- Dali::RefObject* objectPointer = NULL;
- TestObjectDestroyedCallback test2(verified, objectPointer);
-
- registry.ObjectCreatedSignal().Connect(&application, test);
- registry.ObjectDestroyedSignal().Connect(&application, test2);
-
- Mesh mesh = ConstructMesh(60);
-
- {
- MeshActor actor = MeshActor::New(mesh);
-
- DALI_TEST_CHECK(actor);
- DALI_TEST_CHECK( test.mSignalVerified );
-
- verified = false;
- objectPointer = actor.GetObjectPtr();
- }
- DALI_TEST_CHECK( test.mSignalVerified );
- END_TEST;
-}
-
-
int UtcDaliObjectRegistrySignalAnimationCreated(void)
{
TestApplication application;
#include <stdlib.h>
#include <dali/public-api/dali-core.h>
-#include <dali/devel-api/actors/mesh-actor.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali-test-suite-utils.h>
DALI_TEST_CHECK( CullNone == imageActor.GetCullFace() );
- MeshActor meshActor = MeshActor::New();
+ imageActor.SetCullFace( CullBack );
+
+ DALI_TEST_CHECK( CullBack == imageActor.GetCullFace() );
- DALI_TEST_CHECK( CullBack == meshActor.GetCullFace() );
END_TEST;
}