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/public-api/dali-core.h>
22 #include <dali-test-suite-utils.h>
26 void utc_dali_render_task_list_startup(void)
28 test_return_value = TET_UNDEF;
31 void utc_dali_render_task_list_cleanup(void)
33 test_return_value = TET_PASS;
36 int UtcDaliRenderTaskListDefaultConstructor(void)
38 TestApplication application;
40 tet_infoline("Testing RenderTaskList::RenderTaskList()");
42 RenderTaskList taskList;
44 DALI_TEST_CHECK( ! taskList );
48 int UtcDaliRenderTaskListDownCast(void)
50 TestApplication application;
52 tet_infoline("Testing RenderTaskList::DownCast()");
54 BaseHandle base = Stage::GetCurrent().GetRenderTaskList();
56 RenderTaskList taskList = RenderTaskList::DownCast( base );
58 DALI_TEST_CHECK( taskList );
60 // Try calling a method
61 DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
65 int UtcDaliRenderTaskListCreateTask(void)
67 TestApplication application;
69 tet_infoline("Testing RenderTaskList::CreateTask()");
71 RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
72 DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
74 taskList.CreateTask();
75 DALI_TEST_CHECK( 2u == taskList.GetTaskCount() );
79 int UtcDaliRenderTaskListRemoveTask(void)
81 TestApplication application;
83 tet_infoline("Testing RenderTaskList::RemoveTask()");
85 RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
86 DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
88 RenderTask newTask = taskList.CreateTask();
89 DALI_TEST_CHECK( 2u == taskList.GetTaskCount() );
91 taskList.RemoveTask( newTask );
92 DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
96 int UtcDaliRenderTaskListGetTaskCount(void)
98 TestApplication application;
100 tet_infoline("Testing RenderTaskList::GetTaskCount()");
102 RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
103 DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
105 taskList.RemoveTask( taskList.GetTask(0u) );
106 DALI_TEST_CHECK( 0u == taskList.GetTaskCount() );
110 int UtcDaliRenderTaskListGetTask(void)
112 TestApplication application;
114 tet_infoline("Testing RenderTaskList::GetTask()");
116 RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
117 RenderTask defaultTask = taskList.GetTask( 0u );
118 DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
119 DALI_TEST_CHECK( defaultTask );
120 DALI_TEST_CHECK( defaultTask == taskList.GetTask( 0u ) );
122 RenderTask newTask = taskList.CreateTask();
123 DALI_TEST_CHECK( 2u == taskList.GetTaskCount() );
125 RenderTask temp = taskList.GetTask( 0u );
126 RenderTask temp2 = taskList.GetTask( 1u );
128 DALI_TEST_CHECK( newTask );
129 DALI_TEST_CHECK( defaultTask != newTask );
130 DALI_TEST_CHECK( taskList.GetTask( 0u ) == defaultTask );
131 DALI_TEST_CHECK( taskList.GetTask( 1u ) == newTask );
132 DALI_TEST_CHECK( taskList.GetTask( 1u ) != defaultTask );
134 taskList.RemoveTask( taskList.GetTask(0u) );
135 DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
136 DALI_TEST_CHECK( taskList.GetTask( 0u ) != defaultTask );
137 DALI_TEST_CHECK( taskList.GetTask( 0u ) == newTask );