Enable assert always in Dali::Vector
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Vector.cpp
1 /*
2  * Copyright (c) 2021 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 <dali-test-suite-utils.h>
19 #include <dali/public-api/dali-core.h>
20 #include <stdlib.h>
21
22 #include <iostream>
23
24 using namespace Dali;
25
26 namespace
27 {
28 const Dali::VectorBase::SizeType ZERO(0);
29
30 /// Compare a short with an int
31 void DALI_TEST_EQUALS(short value1, int value2, const char* location)
32 {
33   ::DALI_TEST_EQUALS<short>(value1, static_cast<short>(value2), location);
34 }
35
36 /// Compare a char with an int
37 void DALI_TEST_EQUALS(char value1, int value2, const char* location)
38 {
39   ::DALI_TEST_EQUALS<char>(value1, static_cast<char>(value2), location);
40 }
41
42 } // unnamed namespace
43
44 int UtcDaliEmptyVectorInt(void)
45 {
46   tet_infoline("Testing Dali::Vector<int>");
47
48   Vector<int> intvector;
49
50   DALI_TEST_EQUALS(ZERO, intvector.Count(), TEST_LOCATION);
51   DALI_TEST_EQUALS(ZERO, intvector.Capacity(), TEST_LOCATION);
52
53   intvector.Clear();
54   DALI_TEST_EQUALS(ZERO, intvector.Count(), TEST_LOCATION);
55   DALI_TEST_EQUALS(ZERO, intvector.Capacity(), TEST_LOCATION);
56
57   intvector.Release();
58   DALI_TEST_EQUALS(ZERO, intvector.Count(), TEST_LOCATION);
59   DALI_TEST_EQUALS(ZERO, intvector.Capacity(), TEST_LOCATION);
60   END_TEST;
61 }
62
63 int UtcDaliVectorInt(void)
64 {
65   tet_infoline("Testing Dali::Vector<int>");
66
67   Vector<int> intvector;
68
69   DALI_TEST_EQUALS(ZERO, intvector.Count(), TEST_LOCATION);
70   DALI_TEST_EQUALS(ZERO, intvector.Capacity(), TEST_LOCATION);
71
72   intvector.PushBack(11);
73   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(1), intvector.Count(), TEST_LOCATION);
74   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), intvector.Capacity(), TEST_LOCATION);
75   DALI_TEST_EQUALS(11, intvector[0], TEST_LOCATION);
76
77   intvector.PushBack(99);
78   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), intvector.Count(), TEST_LOCATION);
79   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), intvector.Capacity(), TEST_LOCATION);
80   DALI_TEST_EQUALS(99, intvector[1], TEST_LOCATION);
81
82   intvector.PushBack(34);
83   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), intvector.Count(), TEST_LOCATION);
84   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(6), intvector.Capacity(), TEST_LOCATION);
85   DALI_TEST_EQUALS(11, intvector[0], TEST_LOCATION);
86   DALI_TEST_EQUALS(99, intvector[1], TEST_LOCATION);
87   DALI_TEST_EQUALS(34, intvector[2], TEST_LOCATION);
88
89   intvector.Clear();
90   DALI_TEST_EQUALS(ZERO, intvector.Count(), TEST_LOCATION);
91   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(6), intvector.Capacity(), TEST_LOCATION);
92   intvector.PushBack(123);
93   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(1), intvector.Count(), TEST_LOCATION);
94   DALI_TEST_EQUALS(123, intvector[0], TEST_LOCATION);
95   END_TEST;
96 }
97
98 int UtcDaliVectorIntCopy(void)
99 {
100   tet_infoline("Testing Dali::Vector<int>::Copy");
101
102   Vector<int> intvector;
103   DALI_TEST_EQUALS(ZERO, intvector.Count(), TEST_LOCATION);
104   DALI_TEST_EQUALS(ZERO, intvector.Capacity(), TEST_LOCATION);
105
106   intvector.PushBack(99);
107   intvector.PushBack(11);
108   intvector.PushBack(34);
109
110   // copy construct
111   Vector<int> intvector2(intvector);
112
113   DALI_TEST_EQUALS(intvector2.Count(), intvector.Count(), TEST_LOCATION);
114   DALI_TEST_EQUALS(intvector2.Capacity(), intvector.Capacity(), TEST_LOCATION);
115   DALI_TEST_EQUALS(intvector2[0], intvector[0], TEST_LOCATION);
116   DALI_TEST_EQUALS(intvector2[1], intvector[1], TEST_LOCATION);
117   DALI_TEST_EQUALS(intvector2[2], intvector[2], TEST_LOCATION);
118
119   // assign
120   Vector<int> intvector3;
121   DALI_TEST_EQUALS(ZERO, intvector3.Count(), TEST_LOCATION);
122   DALI_TEST_EQUALS(ZERO, intvector3.Capacity(), TEST_LOCATION);
123   intvector2 = intvector3;
124   DALI_TEST_EQUALS(intvector2.Count(), intvector3.Count(), TEST_LOCATION);
125   DALI_TEST_EQUALS(intvector2.Capacity(), intvector3.Capacity(), TEST_LOCATION);
126
127   // copy empty
128   Vector<int> intvector4;
129   intvector4.Reserve(100);
130   DALI_TEST_EQUALS(ZERO, intvector4.Count(), TEST_LOCATION);
131   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(100), intvector4.Capacity(), TEST_LOCATION);
132   intvector3 = intvector4;
133   DALI_TEST_EQUALS(ZERO, intvector3.Count(), TEST_LOCATION);
134   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(100), intvector3.Capacity(), TEST_LOCATION);
135
136   // self copy
137   intvector4 = intvector4;
138   DALI_TEST_EQUALS(ZERO, intvector4.Count(), TEST_LOCATION);
139   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(100), intvector4.Capacity(), TEST_LOCATION);
140   END_TEST;
141 }
142
143 int UtcDaliVectorIntResize(void)
144 {
145   tet_infoline("Testing Dali::Vector<short>::Resize");
146
147   Vector<short> vector;
148   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
149   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
150
151   vector.Resize(10u);
152   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(10), vector.Count(), TEST_LOCATION);
153   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(10), vector.Capacity(), TEST_LOCATION);
154
155   vector.Resize(4u);
156   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(4), vector.Count(), TEST_LOCATION);
157   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(10), vector.Capacity(), TEST_LOCATION);
158
159   vector.Resize(4u);
160   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(4), vector.Count(), TEST_LOCATION);
161   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(10), vector.Capacity(), TEST_LOCATION);
162
163   vector.Resize(0u);
164   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
165   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(10), vector.Capacity(), TEST_LOCATION);
166
167   vector.Resize(12u, 123);
168   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(12), vector.Count(), TEST_LOCATION);
169   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(12), vector.Capacity(), TEST_LOCATION);
170
171   DALI_TEST_EQUALS(vector[0], 123, TEST_LOCATION);
172   DALI_TEST_EQUALS(vector[1], 123, TEST_LOCATION);
173   DALI_TEST_EQUALS(vector[2], 123, TEST_LOCATION);
174   DALI_TEST_EQUALS(vector[3], 123, TEST_LOCATION);
175   DALI_TEST_EQUALS(vector[4], 123, TEST_LOCATION);
176   DALI_TEST_EQUALS(vector[5], 123, TEST_LOCATION);
177   DALI_TEST_EQUALS(vector[6], 123, TEST_LOCATION);
178   DALI_TEST_EQUALS(vector[7], 123, TEST_LOCATION);
179   DALI_TEST_EQUALS(vector[8], 123, TEST_LOCATION);
180   DALI_TEST_EQUALS(vector[9], 123, TEST_LOCATION);
181   DALI_TEST_EQUALS(vector[10], 123, TEST_LOCATION);
182   DALI_TEST_EQUALS(vector[11], 123, TEST_LOCATION);
183
184   vector.Resize(13u, 321);
185   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(13), vector.Count(), TEST_LOCATION);
186   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(13), vector.Capacity(), TEST_LOCATION);
187
188   DALI_TEST_EQUALS(vector[0], 123, TEST_LOCATION);
189   DALI_TEST_EQUALS(vector[1], 123, TEST_LOCATION);
190   DALI_TEST_EQUALS(vector[2], 123, TEST_LOCATION);
191   DALI_TEST_EQUALS(vector[3], 123, TEST_LOCATION);
192   DALI_TEST_EQUALS(vector[4], 123, TEST_LOCATION);
193   DALI_TEST_EQUALS(vector[5], 123, TEST_LOCATION);
194   DALI_TEST_EQUALS(vector[6], 123, TEST_LOCATION);
195   DALI_TEST_EQUALS(vector[7], 123, TEST_LOCATION);
196   DALI_TEST_EQUALS(vector[8], 123, TEST_LOCATION);
197   DALI_TEST_EQUALS(vector[9], 123, TEST_LOCATION);
198   DALI_TEST_EQUALS(vector[10], 123, TEST_LOCATION);
199   DALI_TEST_EQUALS(vector[11], 123, TEST_LOCATION);
200   DALI_TEST_EQUALS(vector[12], 321, TEST_LOCATION);
201   END_TEST;
202 }
203
204 int UtcDaliVectorIntErase(void)
205 {
206   tet_infoline("Testing Dali::Vector<short>::Erase");
207
208   Vector<char> vector;
209   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
210   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
211   vector.PushBack(1);
212   vector.PushBack(2);
213   vector.PushBack(3);
214   vector.PushBack(4);
215   vector.PushBack(5);
216   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(5), vector.Count(), TEST_LOCATION);
217   DALI_TEST_EQUALS(vector[0], 1, TEST_LOCATION);
218   DALI_TEST_EQUALS(vector[1], 2, TEST_LOCATION);
219   DALI_TEST_EQUALS(vector[2], 3, TEST_LOCATION);
220   DALI_TEST_EQUALS(vector[3], 4, TEST_LOCATION);
221   DALI_TEST_EQUALS(vector[4], 5, TEST_LOCATION);
222
223   vector.Erase(vector.Begin());
224   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(4), vector.Count(), TEST_LOCATION);
225   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
226   DALI_TEST_EQUALS(vector[1], 3, TEST_LOCATION);
227   DALI_TEST_EQUALS(vector[2], 4, TEST_LOCATION);
228   DALI_TEST_EQUALS(vector[3], 5, TEST_LOCATION);
229
230   Vector<char>::Iterator ret = vector.Erase(std::find(vector.Begin(), vector.End(), 4));
231   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), vector.Count(), TEST_LOCATION);
232   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
233   DALI_TEST_EQUALS(vector[1], 3, TEST_LOCATION);
234   DALI_TEST_EQUALS(vector[2], 5, TEST_LOCATION);
235   DALI_TEST_EQUALS(*ret, 5, TEST_LOCATION);
236
237   // try erasing last
238   vector.PushBack(99);
239   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(4), vector.Count(), TEST_LOCATION);
240   DALI_TEST_EQUALS(vector[3], 99, TEST_LOCATION);
241   ret = vector.Erase(vector.End() - 1);
242   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), vector.Count(), TEST_LOCATION);
243   DALI_TEST_EQUALS(ret, vector.End(), TEST_LOCATION);
244
245   try
246   {
247     // illegal erase, one past the end
248     vector.Erase(vector.End());
249     tet_result(TET_FAIL);
250   }
251   catch(Dali::DaliException& e)
252   {
253     DALI_TEST_PRINT_ASSERT(e);
254     DALI_TEST_ASSERT(e, "(iterator < End())", TEST_LOCATION);
255   }
256   catch(...)
257   {
258     tet_printf("Assertion test failed - wrong Exception\n");
259     tet_result(TET_FAIL);
260   }
261
262   try
263   {
264     // illegal erase, one before the begin
265     vector.Erase(vector.Begin() - 1u);
266     tet_result(TET_FAIL);
267   }
268   catch(Dali::DaliException& e)
269   {
270     DALI_TEST_PRINT_ASSERT(e);
271     DALI_TEST_ASSERT(e, "(iterator < End()) && (iterator >= Begin())", TEST_LOCATION);
272   }
273   catch(...)
274   {
275     tet_printf("Assertion test failed - wrong Exception\n");
276     tet_result(TET_FAIL);
277   }
278
279   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), vector.Count(), TEST_LOCATION);
280   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
281   DALI_TEST_EQUALS(vector[1], 3, TEST_LOCATION);
282   DALI_TEST_EQUALS(vector[2], 5, TEST_LOCATION);
283
284   vector.Erase(vector.Begin() + 1);
285   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), vector.Count(), TEST_LOCATION);
286   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
287   DALI_TEST_EQUALS(vector[1], 5, TEST_LOCATION);
288
289   vector.Erase(vector.Begin() + 1);
290   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(1), vector.Count(), TEST_LOCATION);
291   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
292
293   try
294   {
295     // illegal erase, one past the end
296     vector.Erase(vector.Begin() + 1);
297     tet_result(TET_FAIL);
298   }
299   catch(Dali::DaliException& e)
300   {
301     DALI_TEST_PRINT_ASSERT(e);
302     DALI_TEST_ASSERT(e, "(iterator < End())", TEST_LOCATION);
303   }
304   catch(...)
305   {
306     tet_printf("Assertion test failed - wrong Exception\n");
307     tet_result(TET_FAIL);
308   }
309   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(1), vector.Count(), TEST_LOCATION);
310   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
311
312   vector.Erase(vector.Begin());
313   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
314
315   try
316   {
317     // illegal erase, one before the beginning
318     vector.Erase(vector.Begin() - 1);
319     tet_result(TET_FAIL);
320   }
321   catch(Dali::DaliException& e)
322   {
323     DALI_TEST_PRINT_ASSERT(e);
324     DALI_TEST_ASSERT(e, "(iterator < End())", TEST_LOCATION);
325   }
326   catch(...)
327   {
328     tet_printf("Assertion test failed - wrong Exception\n");
329     tet_result(TET_FAIL);
330   }
331
332   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
333   DALI_TEST_EQUALS(vector.Begin(), vector.End(), TEST_LOCATION);
334
335   Vector<char>::Iterator endIter = vector.End();
336   for(Vector<char>::Iterator iter = vector.Begin(); iter != endIter; ++iter)
337   {
338     tet_result(TET_FAIL);
339   }
340
341   vector.PushBack(3);
342   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(1), vector.Count(), TEST_LOCATION);
343
344   vector.Clear();
345   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
346   DALI_TEST_EQUALS(vector.Begin(), vector.End(), TEST_LOCATION);
347
348   endIter = vector.End();
349   for(Vector<char>::Iterator iter = vector.Begin(); iter != endIter; ++iter)
350   {
351     tet_result(TET_FAIL);
352   }
353
354   // test a vector of pointers
355   Vector<int*> ptrVector;
356   DALI_TEST_EQUALS(ZERO, ptrVector.Count(), TEST_LOCATION);
357   DALI_TEST_EQUALS(ptrVector.Begin(), ptrVector.End(), TEST_LOCATION);
358
359   int* pointer = NULL;
360   ptrVector.PushBack(pointer);
361   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(1), ptrVector.Count(), TEST_LOCATION);
362
363   Vector<int*>::Iterator ptriter = std::find(ptrVector.Begin(), ptrVector.End(), pointer);
364   ptriter                        = ptrVector.Erase(ptriter);
365   DALI_TEST_EQUALS(ZERO, ptrVector.Count(), TEST_LOCATION);
366   DALI_TEST_EQUALS(ptrVector.Begin(), ptrVector.End(), TEST_LOCATION);
367   DALI_TEST_EQUALS(ptrVector.Begin(), ptriter, TEST_LOCATION);
368   END_TEST;
369 }
370
371 int UtcDaliVectorDoubleRemove(void)
372 {
373   tet_infoline("Testing Dali::Vector<double>::Remove");
374
375   Vector<double> vector;
376   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
377
378   vector.PushBack(11.1);
379   vector.PushBack(22.2);
380   vector.PushBack(33.3);
381   vector.PushBack(44.4);
382   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(4), vector.Count(), TEST_LOCATION);
383   DALI_TEST_EQUALS(vector[0], 11.1, TEST_LOCATION);
384   DALI_TEST_EQUALS(vector[1], 22.2, TEST_LOCATION);
385   DALI_TEST_EQUALS(vector[2], 33.3, TEST_LOCATION);
386   DALI_TEST_EQUALS(vector[3], 44.4, TEST_LOCATION);
387
388   Vector<double>::Iterator res = std::find(vector.Begin(), vector.End(), 22.2);
389   DALI_TEST_EQUALS(22.2, *res, TEST_LOCATION);
390   vector.Remove(res);
391   res = std::find(vector.Begin(), vector.End(), 22.2);
392   DALI_TEST_EQUALS(vector.End(), res, TEST_LOCATION);
393   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), vector.Count(), TEST_LOCATION);
394   DALI_TEST_EQUALS(vector[0], 11.1, TEST_LOCATION);
395   DALI_TEST_EQUALS(vector[1], 44.4, TEST_LOCATION);
396   DALI_TEST_EQUALS(vector[2], 33.3, TEST_LOCATION);
397
398   vector.Remove(vector.End() - 1);
399   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), vector.Count(), TEST_LOCATION);
400   DALI_TEST_EQUALS(vector[0], 11.1, TEST_LOCATION);
401   DALI_TEST_EQUALS(vector[1], 44.4, TEST_LOCATION);
402
403   vector.Remove(vector.Begin());
404   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(1), vector.Count(), TEST_LOCATION);
405   DALI_TEST_EQUALS(vector[0], 44.4, TEST_LOCATION);
406
407   try
408   {
409     // illegal erase, one past the end
410     vector.Remove(vector.Begin() + 1);
411     tet_result(TET_FAIL);
412   }
413   catch(Dali::DaliException& e)
414   {
415     DALI_TEST_PRINT_ASSERT(e);
416     DALI_TEST_ASSERT(e, "(iterator < End()) && (iterator >= Begin())", TEST_LOCATION);
417   }
418   catch(...)
419   {
420     tet_printf("Assertion test failed - wrong Exception\n");
421     tet_result(TET_FAIL);
422   }
423   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(1), vector.Count(), TEST_LOCATION);
424   DALI_TEST_EQUALS(vector[0], 44.4, TEST_LOCATION);
425
426   vector.Remove(vector.Begin());
427   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
428
429   try
430   {
431     // illegal erase, one before the beginning
432     vector.Remove(vector.Begin() - 1);
433     tet_result(TET_FAIL);
434   }
435   catch(Dali::DaliException& e)
436   {
437     DALI_TEST_PRINT_ASSERT(e);
438     DALI_TEST_ASSERT(e, "(iterator < End()) && (iterator >= Begin())", TEST_LOCATION);
439   }
440   catch(...)
441   {
442     tet_printf("Assertion test failed - wrong Exception\n");
443     tet_result(TET_FAIL);
444   }
445
446   END_TEST;
447 }
448
449 int UtcDaliVectorIntSwap(void)
450 {
451   tet_infoline("Testing Dali::Vector<int>::Swap");
452
453   Vector<int> intvector;
454   DALI_TEST_EQUALS(ZERO, intvector.Count(), TEST_LOCATION);
455   DALI_TEST_EQUALS(ZERO, intvector.Capacity(), TEST_LOCATION);
456
457   intvector.PushBack(11);
458   intvector.PushBack(22);
459   intvector.PushBack(33);
460   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), intvector.Count(), TEST_LOCATION);
461
462   Vector<int> intvector2;
463   DALI_TEST_EQUALS(ZERO, intvector2.Count(), TEST_LOCATION);
464   DALI_TEST_EQUALS(ZERO, intvector2.Capacity(), TEST_LOCATION);
465
466   intvector2.Swap(intvector);
467   DALI_TEST_EQUALS(ZERO, intvector.Count(), TEST_LOCATION);
468   DALI_TEST_EQUALS(ZERO, intvector.Capacity(), TEST_LOCATION);
469   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), intvector2.Count(), TEST_LOCATION);
470   DALI_TEST_EQUALS(11, intvector2[0], TEST_LOCATION);
471   DALI_TEST_EQUALS(22, intvector2[1], TEST_LOCATION);
472   DALI_TEST_EQUALS(33, intvector2[2], TEST_LOCATION);
473
474   intvector.PushBack(99);
475   intvector.PushBack(88);
476   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), intvector.Count(), TEST_LOCATION);
477
478   intvector.Swap(intvector2);
479   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), intvector2.Count(), TEST_LOCATION);
480   DALI_TEST_EQUALS(99, intvector2[0], TEST_LOCATION);
481   DALI_TEST_EQUALS(88, intvector2[1], TEST_LOCATION);
482   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), intvector.Count(), TEST_LOCATION);
483   DALI_TEST_EQUALS(11, intvector[0], TEST_LOCATION);
484   DALI_TEST_EQUALS(22, intvector[1], TEST_LOCATION);
485   DALI_TEST_EQUALS(33, intvector[2], TEST_LOCATION);
486
487   Vector<int> empty;
488   intvector.Swap(empty);
489   DALI_TEST_EQUALS(ZERO, intvector.Count(), TEST_LOCATION);
490   DALI_TEST_EQUALS(ZERO, intvector.Capacity(), TEST_LOCATION);
491   END_TEST;
492 }
493
494 int UtcDaliVectorIterate(void)
495 {
496   tet_infoline("Testing Dali::Vector<float>::Begin");
497
498   Vector<float> floatvector;
499   DALI_TEST_EQUALS(ZERO, floatvector.Count(), TEST_LOCATION);
500   DALI_TEST_EQUALS(ZERO, floatvector.Capacity(), TEST_LOCATION);
501
502   floatvector.PushBack(0.9f);
503   floatvector.PushBack(1.1f);
504   floatvector.PushBack(1.2f);
505   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), floatvector.Count(), TEST_LOCATION);
506
507   Vector<float>::Iterator iter  = floatvector.Begin();
508   int                     index = 0;
509   for(; iter != floatvector.End(); ++iter, ++index)
510   {
511     std::cout << "value " << *iter << std::endl;
512     DALI_TEST_EQUALS(*iter, floatvector[index], TEST_LOCATION);
513   }
514   DALI_TEST_EQUALS(3, index, TEST_LOCATION);
515
516   iter = std::find(floatvector.Begin(), floatvector.End(), 1.1f);
517   DALI_TEST_EQUALS(1.1f, *iter, TEST_LOCATION);
518
519   floatvector.Clear();
520   iter = std::find(floatvector.Begin(), floatvector.End(), 1.1f);
521   DALI_TEST_EQUALS(floatvector.End(), iter, TEST_LOCATION);
522   END_TEST;
523 }
524
525 int UtcDaliVectorPair(void)
526 {
527   tet_infoline("Testing Dali::Vector< std::pair< int, float > >");
528
529   Vector<std::pair<int, float> > pairvector;
530   DALI_TEST_EQUALS(ZERO, pairvector.Count(), TEST_LOCATION);
531   DALI_TEST_EQUALS(ZERO, pairvector.Capacity(), TEST_LOCATION);
532
533   pairvector.PushBack(std::make_pair(5, 0.1f));
534   pairvector.PushBack(std::make_pair(3, 0.2f));
535   pairvector.PushBack(std::make_pair(4, 0.3f));
536   pairvector.PushBack(std::make_pair(1, 0.4f));
537   pairvector.PushBack(std::make_pair(2, 0.5f));
538   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(5), pairvector.Count(), TEST_LOCATION);
539
540   Vector<std::pair<int, float> >::Iterator iter  = pairvector.Begin();
541   int                                      index = 0;
542   for(; iter != pairvector.End(); ++iter, ++index)
543   {
544     std::cout << "pair " << (*iter).first << ":" << (*iter).second << std::endl;
545     DALI_TEST_EQUALS((*iter).first, pairvector[index].first, TEST_LOCATION);
546     DALI_TEST_EQUALS((*iter).second, pairvector[index].second, TEST_LOCATION);
547   }
548   END_TEST;
549 }
550
551 int UtcDaliVectorAsserts(void)
552 {
553   tet_infoline("Testing Dali::Vector< int* > exception handling");
554
555   // empty vector
556   Vector<int*> pointervector;
557   try
558   {
559     int* value       = NULL;
560     pointervector[1] = value;
561     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
562     tet_result(TET_FAIL);
563   }
564   catch(Dali::DaliException& e)
565   {
566     DALI_TEST_PRINT_ASSERT(e);
567     DALI_TEST_ASSERT(e, "VectorBase::mData", TEST_LOCATION);
568   }
569   catch(...)
570   {
571     tet_printf("Assertion test failed - wrong Exception\n");
572     tet_result(TET_FAIL);
573   }
574
575   try
576   {
577     int* value = NULL;
578     value      = pointervector[0];
579     (void)value; // to "use" the value
580     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
581     tet_result(TET_FAIL);
582   }
583   catch(Dali::DaliException& e)
584   {
585     DALI_TEST_PRINT_ASSERT(e);
586     DALI_TEST_ASSERT(e, "VectorBase::mData", TEST_LOCATION);
587   }
588   catch(...)
589   {
590     tet_printf("Assertion test failed - wrong Exception\n");
591     tet_result(TET_FAIL);
592   }
593
594   Vector<int*>::Iterator iter = pointervector.Begin();
595   if(iter != pointervector.End())
596   {
597     tet_result(TET_FAIL);
598   }
599
600   try
601   {
602     pointervector.Erase(pointervector.Begin());
603     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
604     tet_result(TET_FAIL);
605   }
606   catch(Dali::DaliException& e)
607   {
608     DALI_TEST_PRINT_ASSERT(e);
609     DALI_TEST_ASSERT(e, "(iterator < End()) && (iterator >= Begin())", TEST_LOCATION);
610   }
611   catch(...)
612   {
613     tet_printf("Assertion test failed - wrong Exception\n");
614     tet_result(TET_FAIL);
615   }
616
617   iter = pointervector.Begin();
618   if(iter != pointervector.End())
619   {
620     tet_result(TET_FAIL);
621   }
622
623   try
624   {
625     pointervector.Remove(pointervector.Begin());
626     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
627     tet_result(TET_FAIL);
628   }
629   catch(Dali::DaliException& e)
630   {
631     DALI_TEST_PRINT_ASSERT(e);
632     DALI_TEST_ASSERT(e, "(iterator < End()) && (iterator >= Begin())", TEST_LOCATION);
633   }
634   catch(...)
635   {
636     tet_printf("Assertion test failed - wrong Exception\n");
637     tet_result(TET_FAIL);
638   }
639
640   iter = pointervector.Begin();
641   if(iter != pointervector.End())
642   {
643     tet_result(TET_FAIL);
644   }
645
646   // reserve 0 space
647   pointervector.Reserve(0);
648   iter = pointervector.Begin();
649   if(iter != pointervector.End())
650   {
651     tet_result(TET_FAIL);
652   }
653
654   // reserve 1 space
655   pointervector.Reserve(1);
656   iter = pointervector.Begin();
657   if(iter != pointervector.End())
658   {
659     tet_result(TET_FAIL);
660   }
661
662   try
663   {
664     int* value       = NULL;
665     pointervector[1] = value;
666     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
667     tet_result(TET_FAIL);
668   }
669   catch(Dali::DaliException& e)
670   {
671     DALI_TEST_PRINT_ASSERT(e);
672     DALI_TEST_ASSERT(e, "index < VectorBase::Count()", TEST_LOCATION);
673   }
674   catch(...)
675   {
676     tet_printf("Assertion test failed - wrong Exception\n");
677     tet_result(TET_FAIL);
678   }
679
680   try
681   {
682     int* value = pointervector[1];
683     (void)value; // to "use" the value
684     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
685     tet_result(TET_FAIL);
686   }
687   catch(Dali::DaliException& e)
688   {
689     DALI_TEST_PRINT_ASSERT(e);
690     DALI_TEST_ASSERT(e, "index < VectorBase::Count()", TEST_LOCATION);
691   }
692   catch(...)
693   {
694     tet_printf("Assertion test failed - wrong Exception\n");
695     tet_result(TET_FAIL);
696   }
697
698   END_TEST;
699 }
700
701 int UtcDaliVectorAcidTest(void)
702 {
703   tet_infoline("Testing multiple Dali::Vector's");
704
705   // create multiple vectors
706   Vector<std::pair<float, float> > pairvector;
707   DALI_TEST_EQUALS(ZERO, pairvector.Count(), TEST_LOCATION);
708   DALI_TEST_EQUALS(ZERO, pairvector.Capacity(), TEST_LOCATION);
709   Vector<double> doublevector;
710   DALI_TEST_EQUALS(ZERO, doublevector.Count(), TEST_LOCATION);
711   DALI_TEST_EQUALS(ZERO, doublevector.Capacity(), TEST_LOCATION);
712   Vector<int*> intptrvector;
713   DALI_TEST_EQUALS(ZERO, intptrvector.Count(), TEST_LOCATION);
714   DALI_TEST_EQUALS(ZERO, intptrvector.Capacity(), TEST_LOCATION);
715   Vector<Dali::Actor*> actorptrvector;
716   DALI_TEST_EQUALS(ZERO, actorptrvector.Count(), TEST_LOCATION);
717   DALI_TEST_EQUALS(ZERO, actorptrvector.Capacity(), TEST_LOCATION);
718   Vector<long> longvector;
719   DALI_TEST_EQUALS(ZERO, longvector.Count(), TEST_LOCATION);
720   DALI_TEST_EQUALS(ZERO, longvector.Capacity(), TEST_LOCATION);
721   Vector<char> charvector;
722   DALI_TEST_EQUALS(ZERO, charvector.Count(), TEST_LOCATION);
723   DALI_TEST_EQUALS(ZERO, charvector.Capacity(), TEST_LOCATION);
724
725   // add items
726   static unsigned int acidCount = 10000;
727   int*                ptr       = NULL;
728   for(unsigned int i = 0; i < acidCount; ++i)
729   {
730     pairvector.PushBack(std::make_pair(i, i));
731     doublevector.PushBack((double)i);
732     intptrvector.PushBack((int*)ptr);
733     actorptrvector.PushBack((Dali::Actor*)ptr);
734     longvector.PushBack((long)i);
735     charvector.PushBack((char)i);
736   }
737   DALI_TEST_EQUALS(acidCount, pairvector.Count(), TEST_LOCATION);
738   std::size_t pairCapacity = pairvector.Capacity();
739   DALI_TEST_EQUALS(acidCount, doublevector.Count(), TEST_LOCATION);
740   std::size_t doubleCapacity = doublevector.Capacity();
741   DALI_TEST_EQUALS(acidCount, intptrvector.Count(), TEST_LOCATION);
742   std::size_t intptrCapacity = intptrvector.Capacity();
743   DALI_TEST_EQUALS(acidCount, actorptrvector.Count(), TEST_LOCATION);
744   std::size_t actorptrCapacity = actorptrvector.Capacity();
745   DALI_TEST_EQUALS(acidCount, longvector.Count(), TEST_LOCATION);
746   std::size_t longCapacity = longvector.Capacity();
747   DALI_TEST_EQUALS(acidCount, charvector.Count(), TEST_LOCATION);
748   std::size_t charCapacity = charvector.Capacity();
749
750   tet_printf("Dali::Vector< pair > capacity after %d pushbacks is %d", acidCount, pairCapacity);
751   tet_printf("Dali::Vector< double > capacity after %d pushbacks is %d", acidCount, doubleCapacity);
752   tet_printf("Dali::Vector< int* > capacity after %d pushbacks is %d", acidCount, intptrCapacity);
753   tet_printf("Dali::Vector< Actor* > capacity after %d pushbacks is %d", acidCount, actorptrCapacity);
754   tet_printf("Dali::Vector< long > capacity after %d pushbacks is %d", acidCount, longCapacity);
755   tet_printf("Dali::Vector< char > capacity after %d pushbacks is %d", acidCount, charCapacity);
756
757   // erase items
758   for(unsigned int i = 0; i < acidCount; ++i)
759   {
760     pairvector.Erase(pairvector.Begin() + (i % pairvector.Count()));
761     doublevector.Erase(doublevector.Begin() + (i % doublevector.Count()));
762     intptrvector.Erase(intptrvector.Begin() + (i % intptrvector.Count()));
763     actorptrvector.Erase(actorptrvector.Begin() + (i % actorptrvector.Count()));
764     longvector.Erase(longvector.Begin() + (i % longvector.Count()));
765     charvector.Erase(charvector.Begin() + (i % charvector.Count()));
766   }
767   DALI_TEST_EQUALS(ZERO, pairvector.Count(), TEST_LOCATION);
768   DALI_TEST_EQUALS(pairCapacity, pairvector.Capacity(), TEST_LOCATION);
769   DALI_TEST_EQUALS(ZERO, doublevector.Count(), TEST_LOCATION);
770   DALI_TEST_EQUALS(doubleCapacity, doublevector.Capacity(), TEST_LOCATION);
771   DALI_TEST_EQUALS(ZERO, intptrvector.Count(), TEST_LOCATION);
772   DALI_TEST_EQUALS(intptrCapacity, intptrvector.Capacity(), TEST_LOCATION);
773   DALI_TEST_EQUALS(ZERO, actorptrvector.Count(), TEST_LOCATION);
774   DALI_TEST_EQUALS(actorptrCapacity, actorptrvector.Capacity(), TEST_LOCATION);
775   DALI_TEST_EQUALS(ZERO, longvector.Count(), TEST_LOCATION);
776   DALI_TEST_EQUALS(longCapacity, longvector.Capacity(), TEST_LOCATION);
777   DALI_TEST_EQUALS(ZERO, charvector.Count(), TEST_LOCATION);
778   DALI_TEST_EQUALS(charCapacity, charvector.Capacity(), TEST_LOCATION);
779
780   END_TEST;
781 }
782
783 int UtcDaliVectorPushBack(void)
784 {
785   tet_infoline("Testing Dali::Vector< int* >PushBack(Element)");
786
787   Vector<unsigned int> vector;
788   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
789   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
790
791   vector.Reserve(2u);
792   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
793   DALI_TEST_EQUALS(2u, vector.Capacity(), TEST_LOCATION);
794
795   vector.PushBack(0u);
796   vector.PushBack(1u);
797   vector.PushBack(2u);
798
799   DALI_TEST_EQUALS(3u, vector.Count(), TEST_LOCATION);
800   DALI_TEST_EQUALS(6u, vector.Capacity(), TEST_LOCATION);
801
802   vector.PushBack(3u);
803
804   DALI_TEST_EQUALS(4u, vector.Count(), TEST_LOCATION);
805   DALI_TEST_EQUALS(6u, vector.Capacity(), TEST_LOCATION);
806
807   DALI_TEST_EQUALS(0u, vector[0u], TEST_LOCATION);
808   DALI_TEST_EQUALS(1u, vector[1u], TEST_LOCATION);
809   DALI_TEST_EQUALS(2u, vector[2u], TEST_LOCATION);
810   DALI_TEST_EQUALS(3u, vector[3u], TEST_LOCATION);
811
812   END_TEST;
813 }
814
815 int UtcDaliVectorInsert01(void)
816 {
817   tet_infoline("Testing Dali::Vector< int* >Insert(Iterator, Element)");
818
819   // Test order of array inserted-into:
820   Vector<unsigned int> orderedVector;
821   orderedVector.PushBack(9u);
822   for(unsigned int i = 8u; i <= 8u; --i)
823   {
824     orderedVector.Insert(orderedVector.Begin(), i);
825     DALI_TEST_EQUALS(10u - i, orderedVector.Count(), TEST_LOCATION);
826     DALI_TEST_EQUALS(i, orderedVector[0u], TEST_LOCATION);
827   }
828
829   for(unsigned int i = 0u; i < 10u; ++i)
830   {
831     DALI_TEST_EQUALS(i, orderedVector[i], TEST_LOCATION);
832   }
833
834   // Test insertion out of range in non-empty array throws:
835   try
836   {
837     orderedVector.Insert(orderedVector.Begin() + 99u, 99u);
838     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
839     tet_result(TET_FAIL);
840   }
841   catch(Dali::DaliException& e)
842   {
843     DALI_TEST_PRINT_ASSERT(e);
844     DALI_TEST_ASSERT(e, "(at <= End()) && (at >= Begin())", TEST_LOCATION);
845   }
846   catch(...)
847   {
848     tet_printf("Assertion test failed - wrong Exception\n");
849     tet_result(TET_FAIL);
850   }
851
852   try
853   {
854     orderedVector.Insert(orderedVector.Begin() - 1u, 99u);
855     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
856     tet_result(TET_FAIL);
857   }
858   catch(Dali::DaliException& e)
859   {
860     DALI_TEST_PRINT_ASSERT(e);
861     DALI_TEST_ASSERT(e, "(at <= End()) && (at >= Begin())", TEST_LOCATION);
862   }
863   catch(...)
864   {
865     tet_printf("Assertion test failed - wrong Exception\n");
866     tet_result(TET_FAIL);
867   }
868
869   // Test insertion part-way through a largish array retains ordering:
870
871   // Build vector with hole in sequence:
872   Vector<unsigned int> longerVector;
873   const unsigned int   insertionPoint = 131571u;
874   const unsigned int   finalLength    = 262143u;
875   for(unsigned int i = 0u; i < insertionPoint; ++i)
876   {
877     longerVector.PushBack(i);
878   }
879   for(unsigned int i = insertionPoint; i < finalLength; ++i)
880   {
881     longerVector.PushBack(i + 1);
882   }
883
884   // Fill the hole in the sequence:
885   longerVector.Insert(longerVector.Begin() + insertionPoint, insertionPoint);
886
887   // Check the sequence is monotonically increasing by one every time:
888   for(unsigned int i = 0u; i <= finalLength; ++i)
889   {
890     DALI_TEST_EQUALS(i, longerVector[i], TEST_LOCATION);
891   }
892
893   // Insert into an empty vector
894   Vector<unsigned int> vector;
895
896   vector.Insert(vector.End(), orderedVector.Begin(), orderedVector.End());
897   for(unsigned int i = 0u; i < 10u; ++i)
898   {
899     DALI_TEST_EQUALS(i, vector[i], TEST_LOCATION);
900   }
901
902   vector.Clear();
903   vector.Insert(vector.Begin(), orderedVector.Begin(), orderedVector.End());
904   for(unsigned int i = 0u; i < 10u; ++i)
905   {
906     DALI_TEST_EQUALS(i, vector[i], TEST_LOCATION);
907   }
908
909   // Insert nothing.
910   vector.Insert(vector.Begin(), orderedVector.Begin(), orderedVector.Begin());
911   for(unsigned int i = 0u; i < 10u; ++i)
912   {
913     DALI_TEST_EQUALS(i, vector[i], TEST_LOCATION);
914   }
915
916   vector.Insert(vector.Begin() + 5, vector.Begin() + 5, vector.Begin() + 5);
917   for(unsigned int i = 0u; i < 10u; ++i)
918   {
919     DALI_TEST_EQUALS(i, vector[i], TEST_LOCATION);
920   }
921
922   // AutoInsert
923   vector.Clear();
924   vector.PushBack(0u);
925   vector.PushBack(1u);
926   vector.PushBack(2u);
927   vector.PushBack(3u);
928
929   vector.Insert(vector.Begin() + 2, vector.Begin(), vector.End());
930   DALI_TEST_EQUALS(8u, vector.Count(), TEST_LOCATION);
931   DALI_TEST_EQUALS(0u, vector[0u], TEST_LOCATION);
932   DALI_TEST_EQUALS(1u, vector[1u], TEST_LOCATION);
933   DALI_TEST_EQUALS(0u, vector[2u], TEST_LOCATION);
934   DALI_TEST_EQUALS(1u, vector[3u], TEST_LOCATION);
935   DALI_TEST_EQUALS(2u, vector[4u], TEST_LOCATION);
936   DALI_TEST_EQUALS(3u, vector[5u], TEST_LOCATION);
937   DALI_TEST_EQUALS(2u, vector[6u], TEST_LOCATION);
938   DALI_TEST_EQUALS(3u, vector[7u], TEST_LOCATION);
939
940   END_TEST;
941 }
942
943 int UtcDaliVectorInsert02(void)
944 {
945   tet_infoline("Testing Dali::Vector<char>::Insert(Iterator,Iterator,Iterator)");
946
947   Vector<char> vector;
948   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
949   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
950   vector.PushBack(1);
951   vector.PushBack(2);
952   vector.PushBack(3);
953   vector.PushBack(4);
954   vector.PushBack(5);
955
956   Vector<char> vector2;
957   DALI_TEST_EQUALS(ZERO, vector2.Count(), TEST_LOCATION);
958   DALI_TEST_EQUALS(ZERO, vector2.Capacity(), TEST_LOCATION);
959   vector2.PushBack(6);
960   vector2.PushBack(7);
961   vector2.PushBack(8);
962   vector2.PushBack(9);
963   vector2.PushBack(10);
964
965   // Test insert at end
966   vector.Insert(vector.End(), vector2.Begin(), vector2.Begin() + 1u);
967   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(6), vector.Count(), TEST_LOCATION);
968   DALI_TEST_EQUALS(vector[0], 1, TEST_LOCATION);
969   DALI_TEST_EQUALS(vector[1], 2, TEST_LOCATION);
970   DALI_TEST_EQUALS(vector[2], 3, TEST_LOCATION);
971   DALI_TEST_EQUALS(vector[3], 4, TEST_LOCATION);
972   DALI_TEST_EQUALS(vector[4], 5, TEST_LOCATION);
973   DALI_TEST_EQUALS(vector[5], 6, TEST_LOCATION);
974
975   // Test insert at begin
976   vector.Insert(vector.Begin(), vector2.Begin() + 1, vector2.Begin() + 2u);
977   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(7), vector.Count(), TEST_LOCATION);
978   DALI_TEST_EQUALS(vector[0], 7, TEST_LOCATION);
979   DALI_TEST_EQUALS(vector[1], 1, TEST_LOCATION);
980   DALI_TEST_EQUALS(vector[2], 2, TEST_LOCATION);
981   DALI_TEST_EQUALS(vector[3], 3, TEST_LOCATION);
982   DALI_TEST_EQUALS(vector[4], 4, TEST_LOCATION);
983   DALI_TEST_EQUALS(vector[5], 5, TEST_LOCATION);
984   DALI_TEST_EQUALS(vector[6], 6, TEST_LOCATION);
985
986   // Test insert in the middle
987   vector.Insert(vector.Begin() + 3, vector2.Begin() + 3, vector2.End());
988   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(9), vector.Count(), TEST_LOCATION);
989   DALI_TEST_EQUALS(vector[0], 7, TEST_LOCATION);
990   DALI_TEST_EQUALS(vector[1], 1, TEST_LOCATION);
991   DALI_TEST_EQUALS(vector[2], 2, TEST_LOCATION);
992   DALI_TEST_EQUALS(vector[3], 9, TEST_LOCATION);
993   DALI_TEST_EQUALS(vector[4], 10, TEST_LOCATION);
994   DALI_TEST_EQUALS(vector[5], 3, TEST_LOCATION);
995   DALI_TEST_EQUALS(vector[6], 4, TEST_LOCATION);
996   DALI_TEST_EQUALS(vector[7], 5, TEST_LOCATION);
997   DALI_TEST_EQUALS(vector[8], 6, TEST_LOCATION);
998   END_TEST;
999 }
1000
1001 int UtcDaliVectorIntInsertAssert(void)
1002 {
1003   tet_infoline("Testing Dali::Vector<char>::Insert(Iterator,Iterator,Iterator) asserts");
1004
1005   Vector<char> vector;
1006   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
1007   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
1008   vector.PushBack(1);
1009   vector.PushBack(2);
1010
1011   Vector<char> vector2;
1012   DALI_TEST_EQUALS(ZERO, vector2.Count(), TEST_LOCATION);
1013   DALI_TEST_EQUALS(ZERO, vector2.Capacity(), TEST_LOCATION);
1014   vector2.PushBack(6);
1015   vector2.PushBack(7);
1016   vector2.PushBack(8);
1017   vector2.PushBack(9);
1018   vector2.PushBack(10);
1019
1020   try
1021   {
1022     vector.Insert(vector.Begin() + 3u, vector2.Begin(), vector2.End());
1023     tet_result(TET_FAIL);
1024   }
1025   catch(Dali::DaliException& e)
1026   {
1027     DALI_TEST_PRINT_ASSERT(e);
1028     DALI_TEST_ASSERT(e, "(at <= End()) && (at >= Begin())", TEST_LOCATION);
1029   }
1030   catch(...)
1031   {
1032     tet_printf("Assertion test failed - wrong Exception\n");
1033     tet_result(TET_FAIL);
1034   }
1035
1036   try
1037   {
1038     vector.Insert(vector.Begin() - 1u, vector2.Begin(), vector2.End());
1039     tet_result(TET_FAIL);
1040   }
1041   catch(Dali::DaliException& e)
1042   {
1043     DALI_TEST_PRINT_ASSERT(e);
1044     DALI_TEST_ASSERT(e, "(at <= End()) && (at >= Begin())", TEST_LOCATION);
1045   }
1046   catch(...)
1047   {
1048     tet_printf("Assertion test failed - wrong Exception\n");
1049     tet_result(TET_FAIL);
1050   }
1051
1052   try
1053   {
1054     vector.Insert(vector.End(), vector2.End(), vector2.Begin());
1055     tet_result(TET_FAIL);
1056   }
1057   catch(Dali::DaliException& e)
1058   {
1059     DALI_TEST_PRINT_ASSERT(e);
1060     DALI_TEST_ASSERT(e, "(from <= to)", TEST_LOCATION);
1061   }
1062   catch(...)
1063   {
1064     tet_printf("Assertion test failed - wrong Exception\n");
1065     tet_result(TET_FAIL);
1066   }
1067
1068   END_TEST;
1069 }
1070
1071 int UtcDaliVectorIntEraseRange(void)
1072 {
1073   tet_infoline("Testing Dali::Vector<char>::Erase(Iterator,Iterator)");
1074
1075   Vector<char> vector;
1076   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
1077   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
1078
1079   // Try to delete from empty vector.
1080
1081   vector.Erase(vector.Begin(), vector.End());
1082   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
1083   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
1084
1085   vector.PushBack(1);
1086   vector.PushBack(2);
1087   vector.PushBack(3);
1088   vector.PushBack(4);
1089   vector.PushBack(5);
1090   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(5), vector.Count(), TEST_LOCATION);
1091   DALI_TEST_EQUALS(vector[0], 1, TEST_LOCATION);
1092   DALI_TEST_EQUALS(vector[1], 2, TEST_LOCATION);
1093   DALI_TEST_EQUALS(vector[2], 3, TEST_LOCATION);
1094   DALI_TEST_EQUALS(vector[3], 4, TEST_LOCATION);
1095   DALI_TEST_EQUALS(vector[4], 5, TEST_LOCATION);
1096
1097   Vector<char>::Iterator ret;
1098
1099   ret = vector.Erase(vector.Begin() + 1u, vector.Begin() + 2u);
1100   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(4), vector.Count(), TEST_LOCATION);
1101   DALI_TEST_EQUALS(vector[0], 1, TEST_LOCATION);
1102   DALI_TEST_EQUALS(vector[1], 3, TEST_LOCATION);
1103   DALI_TEST_EQUALS(vector[2], 4, TEST_LOCATION);
1104   DALI_TEST_EQUALS(vector[3], 5, TEST_LOCATION);
1105   DALI_TEST_EQUALS(*ret, 3, TEST_LOCATION);
1106
1107   ret = vector.Erase(vector.Begin(), vector.Begin() + 2);
1108   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), vector.Count(), TEST_LOCATION);
1109   DALI_TEST_EQUALS(vector[0], 4, TEST_LOCATION);
1110   DALI_TEST_EQUALS(vector[1], 5, TEST_LOCATION);
1111   DALI_TEST_EQUALS(*ret, 4, TEST_LOCATION);
1112
1113   // try erasing last
1114   vector.PushBack(99);
1115   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), vector.Count(), TEST_LOCATION);
1116   DALI_TEST_EQUALS(vector[2], 99, TEST_LOCATION);
1117   ret = vector.Erase(vector.Begin() + 1u, vector.End());
1118   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(1), vector.Count(), TEST_LOCATION);
1119   DALI_TEST_EQUALS(vector[0], 4, TEST_LOCATION);
1120   DALI_TEST_EQUALS(ret, vector.End(), TEST_LOCATION);
1121
1122   // try erasing all
1123   vector.PushBack(100);
1124   vector.PushBack(101);
1125   vector.PushBack(102);
1126
1127   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(4), vector.Count(), TEST_LOCATION);
1128   DALI_TEST_EQUALS(vector[0], 4, TEST_LOCATION);
1129   DALI_TEST_EQUALS(vector[1], 100, TEST_LOCATION);
1130   DALI_TEST_EQUALS(vector[2], 101, TEST_LOCATION);
1131   DALI_TEST_EQUALS(vector[3], 102, TEST_LOCATION);
1132
1133   ret = vector.Erase(vector.Begin(), vector.End());
1134   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(0), vector.Count(), TEST_LOCATION);
1135   DALI_TEST_EQUALS(ret, vector.End(), TEST_LOCATION);
1136
1137   // try erase from Iterator to the same Iterator.
1138   vector.PushBack(100);
1139   vector.PushBack(101);
1140   vector.PushBack(102);
1141
1142   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), vector.Count(), TEST_LOCATION);
1143   DALI_TEST_EQUALS(vector[0], 100, TEST_LOCATION);
1144   DALI_TEST_EQUALS(vector[1], 101, TEST_LOCATION);
1145   DALI_TEST_EQUALS(vector[2], 102, TEST_LOCATION);
1146
1147   ret = vector.Erase(vector.Begin() + 1, vector.Begin() + 1);
1148
1149   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), vector.Count(), TEST_LOCATION);
1150   DALI_TEST_EQUALS(vector[0], 100, TEST_LOCATION);
1151   DALI_TEST_EQUALS(vector[1], 101, TEST_LOCATION);
1152   DALI_TEST_EQUALS(vector[2], 102, TEST_LOCATION);
1153
1154   DALI_TEST_EQUALS(*ret, 101, TEST_LOCATION);
1155
1156   END_TEST;
1157 }
1158
1159 int UtcDaliVectorIntEraseRangeAssert(void)
1160 {
1161   tet_infoline("Testing Dali::Vector<char>::Erase(Iterator,Iterator) asserts");
1162
1163   Vector<char> vector;
1164   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
1165   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
1166
1167   // Add some elements.
1168   vector.PushBack(1);
1169   vector.PushBack(2);
1170
1171   // first out of bounds
1172   try
1173   {
1174     vector.Erase(vector.Begin() + 3u, vector.Begin() + 4u);
1175     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
1176     tet_result(TET_FAIL);
1177   }
1178   catch(Dali::DaliException& e)
1179   {
1180     DALI_TEST_PRINT_ASSERT(e);
1181     DALI_TEST_ASSERT(e, "(first <= End()) && (first >= Begin())", TEST_LOCATION);
1182   }
1183   catch(...)
1184   {
1185     tet_printf("Assertion test failed - wrong Exception\n");
1186     tet_result(TET_FAIL);
1187   }
1188
1189   try
1190   {
1191     vector.Erase(vector.Begin() - 1u, vector.End());
1192     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
1193     tet_result(TET_FAIL);
1194   }
1195   catch(Dali::DaliException& e)
1196   {
1197     DALI_TEST_PRINT_ASSERT(e);
1198     DALI_TEST_ASSERT(e, "(first <= End()) && (first >= Begin())", TEST_LOCATION);
1199   }
1200   catch(...)
1201   {
1202     tet_printf("Assertion test failed - wrong Exception\n");
1203     tet_result(TET_FAIL);
1204   }
1205
1206   // last out of bounds
1207
1208   try
1209   {
1210     vector.Erase(vector.Begin(), vector.Begin() + 3u);
1211     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
1212     tet_result(TET_FAIL);
1213   }
1214   catch(Dali::DaliException& e)
1215   {
1216     DALI_TEST_PRINT_ASSERT(e);
1217     DALI_TEST_ASSERT(e, "(last <= End()) && (last >= Begin())", TEST_LOCATION);
1218   }
1219   catch(...)
1220   {
1221     tet_printf("Assertion test failed - wrong Exception\n");
1222     tet_result(TET_FAIL);
1223   }
1224
1225   try
1226   {
1227     vector.Erase(vector.Begin(), vector.Begin() - 1u);
1228     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
1229     tet_result(TET_FAIL);
1230   }
1231   catch(Dali::DaliException& e)
1232   {
1233     DALI_TEST_PRINT_ASSERT(e);
1234     DALI_TEST_ASSERT(e, "(last <= End()) && (last >= Begin())", TEST_LOCATION);
1235   }
1236   catch(...)
1237   {
1238     tet_printf("Assertion test failed - wrong Exception\n");
1239     tet_result(TET_FAIL);
1240   }
1241
1242   vector.PushBack(3);
1243
1244   // first > last
1245   try
1246   {
1247     vector.Erase(vector.Begin() + 2u, vector.Begin() + 1u);
1248     tet_printf("Assertion expected, but not occurred at %s\n", TEST_LOCATION);
1249     tet_result(TET_FAIL);
1250   }
1251   catch(Dali::DaliException& e)
1252   {
1253     DALI_TEST_PRINT_ASSERT(e);
1254     DALI_TEST_ASSERT(e, "(first <= last)", TEST_LOCATION);
1255   }
1256   catch(...)
1257   {
1258     tet_printf("Assertion test failed - wrong Exception\n");
1259     tet_result(TET_FAIL);
1260   }
1261
1262   END_TEST;
1263 }
1264
1265 int UtcDaliVectorVector2P(void)
1266 {
1267   tet_infoline("Testing Dali::Vector< Vector2 >");
1268
1269   Vector<Vector2> classvector;
1270   DALI_TEST_EQUALS(ZERO, classvector.Count(), TEST_LOCATION);
1271   DALI_TEST_EQUALS(ZERO, classvector.Capacity(), TEST_LOCATION);
1272
1273   classvector.PushBack(Vector2());
1274
1275   DALI_TEST_EQUALS(1u, classvector.Count(), TEST_LOCATION);
1276   DALI_TEST_GREATER(classvector.Capacity(), ZERO, TEST_LOCATION);
1277
1278   classvector.PushBack(Vector2(0.1f, 0.2f));
1279
1280   DALI_TEST_EQUALS(2u, classvector.Count(), TEST_LOCATION);
1281
1282   DALI_TEST_EQUALS(Vector2(), classvector[0], TEST_LOCATION);
1283   DALI_TEST_EQUALS(Vector2(0.1f, 0.2f), classvector[1], TEST_LOCATION);
1284
1285   tet_result(TET_PASS); // for now
1286   END_TEST;
1287 }
1288
1289 int UtcDaliVectorVector3P(void)
1290 {
1291   tet_infoline("Testing Dali::Vector< Vector3 >");
1292
1293   Vector<Vector3> classvector;
1294   DALI_TEST_EQUALS(ZERO, classvector.Count(), TEST_LOCATION);
1295   DALI_TEST_EQUALS(ZERO, classvector.Capacity(), TEST_LOCATION);
1296
1297   classvector.PushBack(Vector3());
1298
1299   DALI_TEST_EQUALS(1u, classvector.Count(), TEST_LOCATION);
1300   DALI_TEST_GREATER(classvector.Capacity(), ZERO, TEST_LOCATION);
1301
1302   classvector.PushBack(Vector3(0.1f, 0.2f, 0.3f));
1303
1304   DALI_TEST_EQUALS(2u, classvector.Count(), TEST_LOCATION);
1305
1306   DALI_TEST_EQUALS(Vector3(), classvector[0], TEST_LOCATION);
1307   DALI_TEST_EQUALS(Vector3(0.1f, 0.2f, 0.3f), classvector[1], TEST_LOCATION);
1308
1309   tet_result(TET_PASS); // for now
1310   END_TEST;
1311 }
1312
1313 int UtcDaliVectorMatrixP(void)
1314 {
1315   tet_infoline("Testing Dali::Vector< Matrix >");
1316
1317   Vector<Matrix> classvector;
1318   DALI_TEST_EQUALS(ZERO, classvector.Count(), TEST_LOCATION);
1319   DALI_TEST_EQUALS(ZERO, classvector.Capacity(), TEST_LOCATION);
1320
1321   classvector.PushBack(Matrix());
1322
1323   DALI_TEST_EQUALS(1u, classvector.Count(), TEST_LOCATION);
1324   DALI_TEST_GREATER(classvector.Capacity(), ZERO, TEST_LOCATION);
1325
1326   classvector.PushBack(Matrix::IDENTITY);
1327
1328   DALI_TEST_EQUALS(2u, classvector.Count(), TEST_LOCATION);
1329
1330   DALI_TEST_EQUALS(Matrix(), classvector[0], TEST_LOCATION);
1331   DALI_TEST_EQUALS(Matrix::IDENTITY, classvector[1], TEST_LOCATION);
1332
1333   tet_result(TET_PASS); // for now
1334   END_TEST;
1335 }
1336
1337 int UtcDaliVectorCpp11ForP(void)
1338 {
1339   Vector<Vector3> classvector;
1340   for(auto i : classvector)
1341   {
1342     std::ignore = i;
1343     tet_result(TET_FAIL);
1344   }
1345
1346   classvector.PushBack(Vector3(0.1f, 0.2f, 0.3f));
1347   classvector.PushBack(Vector3(0.1f, 0.2f, 0.3f));
1348   classvector.PushBack(Vector3(0.1f, 0.2f, 0.3f));
1349
1350   for(auto i : classvector)
1351   {
1352     DALI_TEST_EQUALS(Vector3(0.1f, 0.2f, 0.3f), i, TEST_LOCATION);
1353   }
1354
1355   END_TEST;
1356 }
1357
1358 int UtcDaliVectorMoveConstructor(void)
1359 {
1360   Vector<Vector3> movedFrom;
1361   movedFrom.PushBack(Vector3::ONE);
1362   movedFrom.PushBack(Vector3::NEGATIVE_YAXIS);
1363   movedFrom.PushBack(Vector3::NEGATIVE_ZAXIS);
1364
1365   Vector<Vector3> movedTo(std::move(movedFrom));
1366   DALI_TEST_EQUALS(movedTo.Size(), 3u, TEST_LOCATION);
1367   DALI_TEST_EQUALS(movedFrom.Size(), 0u, TEST_LOCATION);
1368
1369   END_TEST;
1370 }
1371
1372 int UtcDaliVectorMoveAssignment(void)
1373 {
1374   Vector<Vector3> movedFrom;
1375   movedFrom.PushBack(Vector3::ONE);
1376   movedFrom.PushBack(Vector3::NEGATIVE_YAXIS);
1377   movedFrom.PushBack(Vector3::NEGATIVE_ZAXIS);
1378
1379   Vector<Vector3> movedTo;
1380   DALI_TEST_EQUALS(movedTo.Size(), 0u, TEST_LOCATION);
1381   DALI_TEST_EQUALS(movedFrom.Size(), 3u, TEST_LOCATION);
1382
1383   movedTo = std::move(movedFrom);
1384   DALI_TEST_EQUALS(movedTo.Size(), 3u, TEST_LOCATION);
1385   DALI_TEST_EQUALS(movedFrom.Size(), 0u, TEST_LOCATION);
1386
1387   END_TEST;
1388 }
1389
1390 int UtcDaliVectorEraseFreeFunction(void)
1391 {
1392   tet_infoline("Testing Dali::Erase<Vector<int>>");
1393
1394   Vector<int> vector;
1395
1396   // erasing from empty vector
1397   Dali::Erase(vector, 2);
1398   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
1399   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
1400
1401   vector.PushBack(1);
1402   vector.PushBack(2);
1403   vector.PushBack(3);
1404   vector.PushBack(4);
1405   vector.PushBack(5);
1406   vector.PushBack(3);
1407
1408   // erase multiple value
1409   Dali::Erase(vector, 3);
1410   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(4), vector.Count(), TEST_LOCATION);
1411
1412   DALI_TEST_EQUALS(vector[0], 1, TEST_LOCATION);
1413   DALI_TEST_EQUALS(vector[1], 2, TEST_LOCATION);
1414   DALI_TEST_EQUALS(vector[2], 4, TEST_LOCATION);
1415   DALI_TEST_EQUALS(vector[3], 5, TEST_LOCATION);
1416
1417   // erase an element present at start
1418   Dali::Erase(vector, 1);
1419   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), vector.Count(), TEST_LOCATION);
1420   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
1421   DALI_TEST_EQUALS(vector[1], 4, TEST_LOCATION);
1422   DALI_TEST_EQUALS(vector[2], 5, TEST_LOCATION);
1423
1424   // erase an element present at end
1425   Dali::Erase(vector, 5);
1426   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), vector.Count(), TEST_LOCATION);
1427   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
1428   DALI_TEST_EQUALS(vector[1], 4, TEST_LOCATION);
1429
1430   // erase an element not present in the vector
1431   Dali::Erase(vector, 42);
1432   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), vector.Count(), TEST_LOCATION);
1433   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
1434   DALI_TEST_EQUALS(vector[1], 4, TEST_LOCATION);
1435
1436   END_TEST;
1437 }
1438
1439 int UtcDaliVectorEraseIfFreeFunction(void)
1440 {
1441   tet_infoline("Testing Dali::EraseIf<Vector<int>>");
1442
1443   Vector<int> vector;
1444
1445   // erasing from empty vector
1446   Dali::EraseIf(vector, [](const auto& value) { return value == 2; });
1447   DALI_TEST_EQUALS(ZERO, vector.Count(), TEST_LOCATION);
1448   DALI_TEST_EQUALS(ZERO, vector.Capacity(), TEST_LOCATION);
1449
1450   vector.PushBack(1);
1451   vector.PushBack(2);
1452   vector.PushBack(3);
1453   vector.PushBack(4);
1454   vector.PushBack(5);
1455   vector.PushBack(3);
1456
1457   // erase multiple value
1458   Dali::EraseIf(vector, [](const auto& value) { return value == 3; });
1459   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(4), vector.Count(), TEST_LOCATION);
1460
1461   DALI_TEST_EQUALS(vector[0], 1, TEST_LOCATION);
1462   DALI_TEST_EQUALS(vector[1], 2, TEST_LOCATION);
1463   DALI_TEST_EQUALS(vector[2], 4, TEST_LOCATION);
1464   DALI_TEST_EQUALS(vector[3], 5, TEST_LOCATION);
1465
1466   // erase an element present at start
1467   Dali::EraseIf(vector, [](const auto& value) { return value == 1; });
1468   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(3), vector.Count(), TEST_LOCATION);
1469   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
1470   DALI_TEST_EQUALS(vector[1], 4, TEST_LOCATION);
1471   DALI_TEST_EQUALS(vector[2], 5, TEST_LOCATION);
1472
1473   // erase an element present at end
1474   Dali::EraseIf(vector, [](const auto& value) { return value == 5; });
1475   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), vector.Count(), TEST_LOCATION);
1476   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
1477   DALI_TEST_EQUALS(vector[1], 4, TEST_LOCATION);
1478
1479   // erase an element not present in the vector
1480   Dali::EraseIf(vector, [](const auto& value) { return value == 42; });
1481   DALI_TEST_EQUALS(static_cast<Dali::VectorBase::SizeType>(2), vector.Count(), TEST_LOCATION);
1482   DALI_TEST_EQUALS(vector[0], 2, TEST_LOCATION);
1483   DALI_TEST_EQUALS(vector[1], 4, TEST_LOCATION);
1484
1485   END_TEST;
1486 }
1487
1488 /*
1489  * this does not compile at the moment
1490  * Vector< Actor > classvector; this does not compile yet either
1491  *
1492 namespace
1493 {
1494
1495 bool gConstructorCalled = false;
1496 bool gDestructorCalled = false;
1497
1498 struct ComplexType
1499 {
1500   ComplexType()
1501   {
1502     gConstructorCalled = true;
1503   }
1504   ~ComplexType()
1505   {
1506     gDestructorCalled = true;
1507   }
1508 };
1509
1510 } // anonymous namespace
1511
1512 int UtcDaliVectorComplex( void)
1513 {
1514   tet_infoline("Testing Dali::Vector< ComplexType > ");
1515
1516   Vector< ComplexType > classvector;
1517   DALI_TEST_EQUALS( ZERO, classvector.Count(), TEST_LOCATION );
1518   DALI_TEST_EQUALS( ZERO, classvector.Capacity(), TEST_LOCATION );
1519
1520   DALI_TEST_EQUALS( false, gConstructorCalled, TEST_LOCATION );
1521   DALI_TEST_EQUALS( false, gDestructorCalled, TEST_LOCATION );
1522   classvector.PushBack( ComplexType() );
1523   DALI_TEST_EQUALS( true, gConstructorCalled, TEST_LOCATION );
1524   classvector.Clear();
1525   DALI_TEST_EQUALS( true, gDestructorCalled, TEST_LOCATION );
1526   tet_result(TET_PASS); // for now
1527   END_TEST;
1528 }
1529 */