2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include <dali/dali.h>
22 #include <dali-test-suite-utils.h>
27 void mesh_actor_test_startup(void)
29 test_return_value = TET_UNDEF;
32 void mesh_actor_test_cleanup(void)
34 test_return_value = TET_PASS;
40 static AnimatableMesh NewMesh()
42 AnimatableMesh::Faces faces;
47 Material customMaterial = Material::New("CustomMaterial");
48 customMaterial.SetOpacity(.76f);
49 customMaterial.SetDiffuseColor(Vector4(0.8f, 0.0f, 0.4f, 1.0f));
50 customMaterial.SetAmbientColor(Vector4(0.2f, 1.0f, 0.6f, 1.0f));
51 customMaterial.SetSpecularColor(Vector4(0.5f, 0.6f, 0.7f, 1.0f));
53 AnimatableMesh mesh = AnimatableMesh::New( 10u, faces, customMaterial );
56 } // anonymous namespace
58 int UtcDaliMeshActorConstructorVoid(void)
60 TestApplication application;
61 tet_infoline("Testing Dali::MeshActor::MeshActor()");
64 DALI_TEST_CHECK(!actor);
68 int UtcDaliMeshActorNew01(void)
70 TestApplication application;
71 tet_infoline("Testing Dali::MeshActor::New()");
73 AnimatableMesh mesh = NewMesh();
74 MeshActor actor = MeshActor::New(mesh);
75 application.SendNotification();
78 application.SendNotification();
80 DALI_TEST_CHECK(actor);
84 int UtcDaliMeshActorNew03(void)
86 TestApplication application;
87 tet_infoline("Testing Dali::Mesh::New() - Create with no mesh");
91 MeshActor actor = MeshActor::New(); // Shouldn't assert
94 catch (Dali::DaliException& e)
102 int UtcDaliMeshActorIndices(void)
104 TestApplication application;
105 Actor basicActor = Actor::New();
106 AnimatableMesh mesh = NewMesh();
107 MeshActor meshActor = MeshActor::New(mesh);
109 Property::IndexContainer indices;
110 meshActor.GetPropertyIndices( indices );
111 DALI_TEST_CHECK( indices.size() == basicActor.GetPropertyCount() ); // Mesh Actor does not have any properties
112 DALI_TEST_EQUALS( indices.size(), meshActor.GetPropertyCount(), TEST_LOCATION );