Dali 3D User Interface Engine
utc-Dali-RenderTaskList.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 
18 #include <iostream>
19 
20 #include <stdlib.h>
22 #include <dali-test-suite-utils.h>
23 
24 using namespace Dali;
25 
27 {
29 }
30 
32 {
34 }
35 
37 {
38  TestApplication application;
39 
40  tet_infoline("Testing RenderTaskList::RenderTaskList()");
41 
42  RenderTaskList taskList;
43 
44  DALI_TEST_CHECK( ! taskList );
45  END_TEST;
46 }
47 
49 {
50  TestApplication application;
51 
52  tet_infoline("Testing RenderTaskList::RenderTaskList(const RenderTaskList& handle)");
53 
54  RenderTaskList taskList1;
55 
56  RenderTaskList taskList2( taskList1 );
57 
58  DALI_TEST_CHECK( ! taskList2 );
59  END_TEST;
60 }
61 
63 {
64  TestApplication application;
65 
66  tet_infoline("Testing RenderTaskList::RenderTaskList(const RenderTaskList& handle)");
67 
68  RenderTaskList taskList1;
69 
70  RenderTaskList taskList2;
71 
72  taskList1 = taskList2;
73 
74  DALI_TEST_CHECK( ! taskList1 );
75  END_TEST;
76 }
77 
78 
80 {
81  TestApplication application;
82 
83  tet_infoline("Testing RenderTaskList::DownCast()");
84 
86 
87  RenderTaskList taskList = RenderTaskList::DownCast( base );
88 
89  DALI_TEST_CHECK( taskList );
90 
91  // Try calling a method
92  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
93  END_TEST;
94 }
95 
97 {
98  TestApplication application;
99 
100  tet_infoline("Testing RenderTaskList::CreateTask()");
101 
103  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
104 
105  taskList.CreateTask();
106  DALI_TEST_CHECK( 2u == taskList.GetTaskCount() );
107  END_TEST;
108 }
109 
111 {
112  TestApplication application;
113 
114  tet_infoline("Testing RenderTaskList::RemoveTask()");
115 
117  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
118 
119  RenderTask newTask = taskList.CreateTask();
120  DALI_TEST_CHECK( 2u == taskList.GetTaskCount() );
121 
122  taskList.RemoveTask( newTask );
123  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
124  END_TEST;
125 }
126 
128 {
129  TestApplication application;
130 
131  tet_infoline("Testing RenderTaskList::GetTaskCount()");
132 
134  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
135 
136  taskList.RemoveTask( taskList.GetTask(0u) );
137  DALI_TEST_CHECK( 0u == taskList.GetTaskCount() );
138  END_TEST;
139 }
140 
142 {
143  TestApplication application;
144 
145  tet_infoline("Testing RenderTaskList::GetTask()");
146 
148  RenderTask defaultTask = taskList.GetTask( 0u );
149  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
150  DALI_TEST_CHECK( defaultTask );
151  DALI_TEST_CHECK( defaultTask == taskList.GetTask( 0u ) );
152 
153  RenderTask newTask = taskList.CreateTask();
154  DALI_TEST_CHECK( 2u == taskList.GetTaskCount() );
155 
156  RenderTask temp = taskList.GetTask( 0u );
157  RenderTask temp2 = taskList.GetTask( 1u );
158 
159  DALI_TEST_CHECK( newTask );
160  DALI_TEST_CHECK( defaultTask != newTask );
161  DALI_TEST_CHECK( taskList.GetTask( 0u ) == defaultTask );
162  DALI_TEST_CHECK( taskList.GetTask( 1u ) == newTask );
163  DALI_TEST_CHECK( taskList.GetTask( 1u ) != defaultTask );
164 
165  taskList.RemoveTask( taskList.GetTask(0u) );
166  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
167  DALI_TEST_CHECK( taskList.GetTask( 0u ) != defaultTask );
168  DALI_TEST_CHECK( taskList.GetTask( 0u ) == newTask );
169  END_TEST;
170 }
Dali Docs Home
Read more about Dali