Formatting automated-tests
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Path.cpp
1 /*
2  * Copyright (c) 2020 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 using namespace Dali::Internal;
26
27 namespace
28 {
29 // Knots fed into Allegro, which generates control points
30 static void SetupPath(Dali::Path& path)
31 {
32   path.AddPoint(Vector3(30.0, 80.0, 0.0));
33   path.AddPoint(Vector3(70.0, 120.0, 0.0));
34   path.AddPoint(Vector3(100.0, 100.0, 0.0));
35
36   //Control points for first segment
37   path.AddControlPoint(Vector3(39.0, 90.0, 0.0));
38   path.AddControlPoint(Vector3(56.0, 119.0, 0.0));
39
40   //Control points for second segment
41   path.AddControlPoint(Vector3(78.0, 120.0, 0.0));
42   path.AddControlPoint(Vector3(93.0, 104.0, 0.0));
43 }
44
45 } // anonymous namespace
46
47 int utcDaliPathGetPoint(void)
48 {
49   TestApplication application;
50
51   Dali::Path path = Dali::Path::New();
52   path.AddPoint(Vector3(50.0, 50.0, 0.0));
53   path.AddPoint(Vector3(120.0, 70.0, 0.0));
54   path.AddPoint(Vector3(190.0, 250.0, 0.0));
55   path.AddPoint(Vector3(260.0, 260.0, 0.0));
56   path.AddPoint(Vector3(330.0, 220.0, 0.0));
57   path.AddPoint(Vector3(400.0, 50.0, 0.0));
58
59   DALI_TEST_EQUALS(path.GetPoint(0), Vector3(50.0, 50.0, 0.0), TEST_LOCATION);
60   DALI_TEST_EQUALS(path.GetPoint(1), Vector3(120.0, 70.0, 0.0), TEST_LOCATION);
61   DALI_TEST_EQUALS(path.GetPoint(2), Vector3(190.0, 250.0, 0.0), TEST_LOCATION);
62   DALI_TEST_EQUALS(path.GetPoint(3), Vector3(260.0, 260.0, 0.0), TEST_LOCATION);
63   DALI_TEST_EQUALS(path.GetPoint(4), Vector3(330.0, 220.0, 0.0), TEST_LOCATION);
64   DALI_TEST_EQUALS(path.GetPoint(5), Vector3(400.0, 50.0, 0.0), TEST_LOCATION);
65   END_TEST;
66 }
67
68 int utcDaliPathGetPoint02(void)
69 {
70   TestApplication application;
71
72   Dali::Path path = Dali::Path::New();
73   path.AddPoint(Vector3(50.0, 50.0, 0.0f));
74
75   try
76   {
77     path.GetPoint(1);
78     tet_result(TET_FAIL);
79   }
80   catch(Dali::DaliException& e)
81   {
82     DALI_TEST_PRINT_ASSERT(e);
83     DALI_TEST_ASSERT(e, "index < mPoint.Size()", TEST_LOCATION);
84   }
85   END_TEST;
86 }
87
88 int utcDaliPathGetPoint03(void)
89 {
90   TestApplication application;
91
92   Dali::Path path = Dali::Path::New();
93
94   try
95   {
96     path.GetPoint(0);
97     tet_result(TET_FAIL);
98   }
99   catch(Dali::DaliException& e)
100   {
101     DALI_TEST_PRINT_ASSERT(e);
102     DALI_TEST_ASSERT(e, "index < mPoint.Size()", TEST_LOCATION);
103   }
104   END_TEST;
105 }
106
107 int utcDaliPathGetControlPoints(void)
108 {
109   TestApplication application;
110
111   Dali::Path path = Dali::Path::New();
112   path.AddControlPoint(Vector3(0.0f, 0.0f, 0.0));
113   path.AddControlPoint(Vector3(108.0f, 57.0f, 0.0));
114
115   DALI_TEST_EQUALS(path.GetControlPoint(0), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
116   DALI_TEST_EQUALS(path.GetControlPoint(1), Vector3(108.0f, 57.0f, 0.0f), TEST_LOCATION);
117   END_TEST;
118 }
119
120 int utcDaliPathGetControlPoints01(void)
121 {
122   TestApplication application;
123
124   Dali::Path path = Dali::Path::New();
125   path.AddControlPoint(Vector3(0.0f, 0.0f, 0.0));
126   path.AddControlPoint(Vector3(108.0f, 57.0f, 0.0));
127
128   try
129   {
130     path.GetControlPoint(5);
131     tet_result(TET_FAIL);
132   }
133   catch(Dali::DaliException& e)
134   {
135     DALI_TEST_PRINT_ASSERT(e);
136     DALI_TEST_ASSERT(e, "index < mControlPoint.Size()", TEST_LOCATION);
137   }
138   END_TEST;
139 }
140
141 int utcDaliPathGetControlPoints02(void)
142 {
143   TestApplication application;
144
145   Dali::Path path = Dali::Path::New();
146   try
147   {
148     path.GetControlPoint(0);
149     tet_result(TET_FAIL);
150   }
151   catch(Dali::DaliException& e)
152   {
153     DALI_TEST_PRINT_ASSERT(e);
154     DALI_TEST_ASSERT(e, "index < mControlPoint.Size()", TEST_LOCATION);
155   }
156   END_TEST;
157 }
158
159 int utcDaliPathGenerateControlPoints01(void)
160 {
161   TestApplication application;
162
163   Dali::Path path = Dali::Path::New();
164
165   path.AddPoint(Vector3(50.0, 50.0, 0.0));
166   path.AddPoint(Vector3(120.0, 70.0, 0.0));
167   path.AddPoint(Vector3(190.0, 250.0, 0.0));
168   path.AddPoint(Vector3(260.0, 260.0, 0.0));
169   path.AddPoint(Vector3(330.0, 220.0, 0.0));
170   path.AddPoint(Vector3(400.0, 50.0, 0.0));
171
172   path.GenerateControlPoints(0.25);
173
174   DALI_TEST_EQUALS(path.GetControlPoint(0), Vector3(68.0, 55.0, 0.0), 1.0, TEST_LOCATION);
175   DALI_TEST_EQUALS(path.GetControlPoint(1), Vector3(107.0, 58.0, 0.0), 1.0, TEST_LOCATION);
176
177   DALI_TEST_EQUALS(path.GetControlPoint(2), Vector3(156.0, 102.0, 0.0), 1.0, TEST_LOCATION);
178   DALI_TEST_EQUALS(path.GetControlPoint(3), Vector3(152.0, 220.0, 0.0), 1.0, TEST_LOCATION);
179
180   DALI_TEST_EQUALS(path.GetControlPoint(4), Vector3(204.0, 261.0, 0.0), 1.0, TEST_LOCATION);
181   DALI_TEST_EQUALS(path.GetControlPoint(5), Vector3(243.0, 263.0, 0.0), 1.0, TEST_LOCATION);
182
183   DALI_TEST_EQUALS(path.GetControlPoint(6), Vector3(280.0, 256.0, 0.0), 1.0, TEST_LOCATION);
184   DALI_TEST_EQUALS(path.GetControlPoint(7), Vector3(317.0, 235.0, 0.0), 1.0, TEST_LOCATION);
185
186   DALI_TEST_EQUALS(path.GetControlPoint(8), Vector3(360.0, 185.0, 0.0), 1.0, TEST_LOCATION);
187   DALI_TEST_EQUALS(path.GetControlPoint(9), Vector3(383.0, 93.0, 0.0), 1.0, TEST_LOCATION);
188
189   END_TEST;
190 }
191
192 int utcDaliPathGetPointCount(void)
193 {
194   TestApplication application;
195   Dali::Path      path = Dali::Path::New();
196
197   DALI_TEST_EQUALS(path.GetPointCount(), 0u, TEST_LOCATION);
198
199   path.AddPoint(Vector3(50.0, 50.0, 0.0));
200   path.AddPoint(Vector3(120.0, 70.0, 0.0));
201   path.AddPoint(Vector3(190.0, 250.0, 0.0));
202   path.AddPoint(Vector3(260.0, 260.0, 0.0));
203
204   DALI_TEST_EQUALS(path.GetPointCount(), 4u, TEST_LOCATION);
205
206   path.AddPoint(Vector3(330.0, 220.0, 0.0));
207   path.AddPoint(Vector3(400.0, 50.0, 0.0));
208
209   DALI_TEST_EQUALS(path.GetPointCount(), 6u, TEST_LOCATION);
210   END_TEST;
211 }
212
213 int utcDaliPathGenerateControlPoints02(void)
214 {
215   TestApplication application;
216
217   Dali::Path path = Dali::Path::New();
218   try
219   {
220     path.GenerateControlPoints(0.25);
221     tet_result(TET_FAIL);
222   }
223   catch(Dali::DaliException& e)
224   {
225     DALI_TEST_PRINT_ASSERT(e);
226     DALI_TEST_ASSERT(e, "numSegments > 0", TEST_LOCATION);
227   }
228   END_TEST;
229 }
230
231 int utcDaliPathGenerateControlPoints03(void)
232 {
233   TestApplication application;
234
235   Dali::Path path = Dali::Path::New();
236   path.AddPoint(Vector3(400.0, 50.0, 0.0f));
237   try
238   {
239     path.GenerateControlPoints(0.25);
240     tet_result(TET_FAIL);
241   }
242   catch(Dali::DaliException& e)
243   {
244     DALI_TEST_PRINT_ASSERT(e);
245     DALI_TEST_ASSERT(e, "numSegments > 0", TEST_LOCATION);
246   }
247   END_TEST;
248 }
249
250 int UtcDaliPathSample01(void)
251 {
252   TestApplication application;
253   Dali::Path      path = Dali::Path::New();
254   SetupPath(path);
255
256   //t = 0
257   Vector3 position, tangent;
258   path.Sample(0.0f, position, tangent);
259   DALI_TEST_EQUALS(position.x, 30.0f, TEST_LOCATION);
260   DALI_TEST_EQUALS(position.y, 80.0f, TEST_LOCATION);
261   DALI_TEST_EQUALS(tangent.x, 0.6f, 0.1f, TEST_LOCATION);
262   DALI_TEST_EQUALS(tangent.y, 0.7f, 0.1f, TEST_LOCATION);
263
264   //t = 0.25
265   path.Sample(0.25f, position, tangent);
266   DALI_TEST_EQUALS(position.x, 48.0f, 2.0f, TEST_LOCATION);
267   DALI_TEST_EQUALS(position.y, 102.0f, 2.0f, TEST_LOCATION);
268   DALI_TEST_EQUALS(tangent.x, 0.6f, 0.1f, TEST_LOCATION);
269   DALI_TEST_EQUALS(tangent.y, 0.7f, 0.1f, TEST_LOCATION);
270
271   // t = 0.5
272   path.Sample(0.5f, position, tangent);
273   DALI_TEST_EQUALS(position.x, 70.0f, TEST_LOCATION);
274   DALI_TEST_EQUALS(position.y, 120.0f, TEST_LOCATION);
275   DALI_TEST_EQUALS(tangent.x, 1.0f, 0.1f, TEST_LOCATION);
276   DALI_TEST_EQUALS(tangent.y, 0.0f, 0.1f, TEST_LOCATION);
277
278   //t = 0.75
279   path.Sample(0.75f, position, tangent);
280   DALI_TEST_EQUALS(position.x, 85.0f, 2.0f, TEST_LOCATION);
281   DALI_TEST_EQUALS(position.y, 112.0f, 2.0f, TEST_LOCATION);
282   DALI_TEST_EQUALS(tangent.x, 0.7f, 0.1f, TEST_LOCATION);
283   DALI_TEST_EQUALS(tangent.y, -0.6f, 0.1f, TEST_LOCATION);
284
285   // t = 1
286   path.Sample(1.0f, position, tangent);
287   DALI_TEST_EQUALS(position.x, 100.0f, TEST_LOCATION);
288   DALI_TEST_EQUALS(position.y, 100.0f, TEST_LOCATION);
289   DALI_TEST_EQUALS(tangent.x, 0.8f, 0.1f, TEST_LOCATION);
290   DALI_TEST_EQUALS(tangent.y, -0.4f, 0.1f, TEST_LOCATION);
291
292   END_TEST;
293 }
294
295 int UtcDaliPathDownCast(void)
296 {
297   TestApplication application;
298
299   Dali::Path path   = Dali::Path::New();
300   Handle     handle = path;
301   SetupPath(path);
302
303   Dali::Path path2 = Dali::Path::DownCast(handle);
304   DALI_TEST_CHECK(path2);
305
306   //t = 0
307   Vector3 position, tangent;
308   path2.Sample(0.0f, position, tangent);
309   DALI_TEST_EQUALS(position.x, 30.0f, TEST_LOCATION);
310   DALI_TEST_EQUALS(position.y, 80.0f, TEST_LOCATION);
311   DALI_TEST_EQUALS(tangent.x, 0.6f, 0.1f, TEST_LOCATION);
312   DALI_TEST_EQUALS(tangent.y, 0.7f, 0.1f, TEST_LOCATION);
313
314   //t = 0.25
315   path2.Sample(0.25f, position, tangent);
316   DALI_TEST_EQUALS(position.x, 48.0f, 2.0f, TEST_LOCATION);
317   DALI_TEST_EQUALS(position.y, 102.0f, 2.0f, TEST_LOCATION);
318   DALI_TEST_EQUALS(tangent.x, 0.6f, 0.1f, TEST_LOCATION);
319   DALI_TEST_EQUALS(tangent.y, 0.7f, 0.1f, TEST_LOCATION);
320
321   // t = 0.5
322   path2.Sample(0.5f, position, tangent);
323   DALI_TEST_EQUALS(position.x, 70.0f, TEST_LOCATION);
324   DALI_TEST_EQUALS(position.y, 120.0f, TEST_LOCATION);
325   DALI_TEST_EQUALS(tangent.x, 1.0f, 0.1f, TEST_LOCATION);
326   DALI_TEST_EQUALS(tangent.y, 0.0f, 0.1f, TEST_LOCATION);
327
328   //t = 0.75
329   path2.Sample(0.75f, position, tangent);
330   DALI_TEST_EQUALS(position.x, 85.0f, 2.0f, TEST_LOCATION);
331   DALI_TEST_EQUALS(position.y, 112.0f, 2.0f, TEST_LOCATION);
332   DALI_TEST_EQUALS(tangent.x, 0.7f, 0.1f, TEST_LOCATION);
333   DALI_TEST_EQUALS(tangent.y, -0.6f, 0.1f, TEST_LOCATION);
334
335   // t = 1
336   path2.Sample(1.0f, position, tangent);
337   DALI_TEST_EQUALS(position.x, 100.0f, TEST_LOCATION);
338   DALI_TEST_EQUALS(position.y, 100.0f, TEST_LOCATION);
339   DALI_TEST_EQUALS(tangent.x, 0.8f, 0.1f, TEST_LOCATION);
340   DALI_TEST_EQUALS(tangent.y, -0.4f, 0.1f, TEST_LOCATION);
341
342   END_TEST;
343 }
344
345 int UtcDaliPathAssignment(void)
346 {
347   TestApplication application;
348
349   Dali::Path path = Dali::Path::New();
350   SetupPath(path);
351
352   Dali::Path path2;
353   path2 = path;
354   DALI_TEST_CHECK(path2);
355
356   //t = 0
357   Vector3 position, tangent;
358   path2.Sample(0.0f, position, tangent);
359   DALI_TEST_EQUALS(position.x, 30.0f, TEST_LOCATION);
360   DALI_TEST_EQUALS(position.y, 80.0f, TEST_LOCATION);
361   DALI_TEST_EQUALS(tangent.x, 0.6f, 0.1f, TEST_LOCATION);
362   DALI_TEST_EQUALS(tangent.y, 0.7f, 0.1f, TEST_LOCATION);
363
364   //t = 0.25
365   path2.Sample(0.25f, position, tangent);
366   DALI_TEST_EQUALS(position.x, 48.0f, 2.0f, TEST_LOCATION);
367   DALI_TEST_EQUALS(position.y, 102.0f, 2.0f, TEST_LOCATION);
368   DALI_TEST_EQUALS(tangent.x, 0.6f, 0.1f, TEST_LOCATION);
369   DALI_TEST_EQUALS(tangent.y, 0.7f, 0.1f, TEST_LOCATION);
370
371   // t = 0.5
372   path2.Sample(0.5f, position, tangent);
373   DALI_TEST_EQUALS(position.x, 70.0f, TEST_LOCATION);
374   DALI_TEST_EQUALS(position.y, 120.0f, TEST_LOCATION);
375   DALI_TEST_EQUALS(tangent.x, 1.0f, 0.1f, TEST_LOCATION);
376   DALI_TEST_EQUALS(tangent.y, 0.0f, 0.1f, TEST_LOCATION);
377
378   //t = 0.75
379   path2.Sample(0.75f, position, tangent);
380   DALI_TEST_EQUALS(position.x, 85.0f, 2.0f, TEST_LOCATION);
381   DALI_TEST_EQUALS(position.y, 112.0f, 2.0f, TEST_LOCATION);
382   DALI_TEST_EQUALS(tangent.x, 0.7f, 0.1f, TEST_LOCATION);
383   DALI_TEST_EQUALS(tangent.y, -0.6f, 0.1f, TEST_LOCATION);
384
385   // t = 1
386   path2.Sample(1.0f, position, tangent);
387   DALI_TEST_EQUALS(position.x, 100.0f, TEST_LOCATION);
388   DALI_TEST_EQUALS(position.y, 100.0f, TEST_LOCATION);
389   DALI_TEST_EQUALS(tangent.x, 0.8f, 0.1f, TEST_LOCATION);
390   DALI_TEST_EQUALS(tangent.y, -0.4f, 0.1f, TEST_LOCATION);
391
392   END_TEST;
393 }
394
395 int UtcDaliPathPropertyPoints(void)
396 {
397   TestApplication application;
398
399   Dali::Path path = Dali::Path::New();
400
401   Dali::Property::Array points;
402   points.Add(Vector3(100.0f, 100.0f, 100.0f))
403     .Add(Vector3(200.0f, 200.0f, 200.0f))
404     .Add(Vector3(300.0f, 300.0f, 300.0f));
405   path.SetProperty(Dali::Path::Property::POINTS, points);
406
407   {
408     Property::Value  value = path.GetProperty(Dali::Path::Property::POINTS);
409     Property::Array* array = value.GetArray();
410     DALI_TEST_CHECK(array);
411
412     const unsigned int noOfPoints = points.Size();
413     for(unsigned int i = 0; i < noOfPoints; ++i)
414     {
415       DALI_TEST_EQUALS((*array)[i].Get<Vector3>(), points[i].Get<Vector3>(), TEST_LOCATION);
416     }
417   }
418
419   {
420     Property::Value  value = path.GetCurrentProperty(Dali::Path::Property::POINTS);
421     Property::Array* array = value.GetArray();
422     DALI_TEST_CHECK(array);
423
424     const unsigned int noOfPoints = points.Size();
425     for(unsigned int i = 0; i < noOfPoints; ++i)
426     {
427       DALI_TEST_EQUALS((*array)[i].Get<Vector3>(), points[i].Get<Vector3>(), TEST_LOCATION);
428     }
429   }
430
431   END_TEST;
432 }
433
434 int UtcDaliPathPropertyControlPoints(void)
435 {
436   TestApplication application;
437
438   Dali::Path path = Dali::Path::New();
439
440   Dali::Property::Array points;
441   points.Add(Vector3(0.1f, 0.1f, 0.1f))
442     .Add(Vector3(0.2f, 0.2f, 0.2f))
443     .Add(Vector3(0.3f, 0.3f, 0.3f));
444   path.SetProperty(Dali::Path::Property::CONTROL_POINTS, points);
445
446   {
447     Property::Value  value = path.GetProperty(Dali::Path::Property::CONTROL_POINTS);
448     Property::Array* array = value.GetArray();
449     DALI_TEST_CHECK(array);
450
451     const unsigned int noOfPoints = points.Size();
452     for(unsigned int i = 0; i < noOfPoints; ++i)
453     {
454       DALI_TEST_EQUALS((*array)[i].Get<Vector3>(), points[i].Get<Vector3>(), TEST_LOCATION);
455     }
456   }
457
458   {
459     Property::Value  value = path.GetCurrentProperty(Dali::Path::Property::CONTROL_POINTS);
460     Property::Array* array = value.GetArray();
461     DALI_TEST_CHECK(array);
462
463     const unsigned int noOfPoints = points.Size();
464     for(unsigned int i = 0; i < noOfPoints; ++i)
465     {
466       DALI_TEST_EQUALS((*array)[i].Get<Vector3>(), points[i].Get<Vector3>(), TEST_LOCATION);
467     }
468   }
469
470   END_TEST;
471 }
472
473 int UtcDaliPathRegisterProperty(void)
474 {
475   TestApplication application;
476
477   Dali::Path path = Dali::Path::New();
478
479   Property::Index index = path.RegisterProperty("sceneProperty", 0.f);
480   DALI_TEST_EQUALS(index, (Property::Index)PROPERTY_CUSTOM_START_INDEX, TEST_LOCATION);
481   DALI_TEST_EQUALS(path.GetProperty<float>(index), 0.f, TEST_LOCATION);
482
483   path.SetProperty(index, -1);
484   DALI_TEST_EQUALS(path.GetProperty<float>(index), -1.f, TEST_LOCATION);
485
486   using Dali::Animation;
487   Animation animation = Animation::New(1.0f);
488   animation.AnimateTo(Property(path, index), 100.f);
489
490   DALI_TEST_EQUALS(path.GetProperty<float>(index), -1.f, TEST_LOCATION);
491   // Start the animation
492   animation.Play();
493
494   application.SendNotification();
495   application.Render(1000 /* 100% progress */);
496   DALI_TEST_EQUALS(path.GetProperty<float>(index), 100.0f, TEST_LOCATION);
497
498   END_TEST;
499 }
500
501 int UtcDaliPathMoveConstrcutor(void)
502 {
503   TestApplication application;
504
505   Dali::Path path = Dali::Path::New();
506   DALI_TEST_CHECK(path);
507   DALI_TEST_EQUALS(1, path.GetBaseObject().ReferenceCount(), TEST_LOCATION);
508
509   path.AddPoint(Vector3(50.0, 50.0, 0.0));
510   DALI_TEST_EQUALS(path.GetPoint(0), Vector3(50.0, 50.0, 0.0), TEST_LOCATION);
511
512   Dali::Path move = std::move(path);
513   DALI_TEST_CHECK(move);
514   DALI_TEST_EQUALS(1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION);
515   DALI_TEST_EQUALS(move.GetPoint(0), Vector3(50.0, 50.0, 0.0), TEST_LOCATION);
516   DALI_TEST_CHECK(!path);
517
518   END_TEST;
519 }
520
521 int UtcDaliPathMoveAssignment(void)
522 {
523   TestApplication application;
524
525   Dali::Path path = Dali::Path::New();
526   DALI_TEST_CHECK(path);
527   DALI_TEST_EQUALS(1, path.GetBaseObject().ReferenceCount(), TEST_LOCATION);
528
529   path.AddPoint(Vector3(50.0, 50.0, 0.0));
530   DALI_TEST_EQUALS(path.GetPoint(0), Vector3(50.0, 50.0, 0.0), TEST_LOCATION);
531
532   Dali::Path move;
533   move = std::move(path);
534   DALI_TEST_CHECK(move);
535   DALI_TEST_EQUALS(1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION);
536   DALI_TEST_EQUALS(move.GetPoint(0), Vector3(50.0, 50.0, 0.0), TEST_LOCATION);
537   DALI_TEST_CHECK(!path);
538
539   END_TEST;
540 }
541
542 int UtcDaliPathAddControlPointNegative(void)
543 {
544   TestApplication application;
545   Dali::Path      instance;
546   try
547   {
548     Dali::Vector3 arg1;
549     instance.AddControlPoint(arg1);
550     DALI_TEST_CHECK(false); // Should not get here
551   }
552   catch(...)
553   {
554     DALI_TEST_CHECK(true); // We expect an assert
555   }
556   END_TEST;
557 }
558
559 int UtcDaliPathGetControlPointNegative(void)
560 {
561   TestApplication application;
562   Dali::Path      instance;
563   try
564   {
565     unsigned long arg1(0u);
566     instance.GetControlPoint(arg1);
567     DALI_TEST_CHECK(false); // Should not get here
568   }
569   catch(...)
570   {
571     DALI_TEST_CHECK(true); // We expect an assert
572   }
573   END_TEST;
574 }
575
576 int UtcDaliPathGenerateControlPointsNegative(void)
577 {
578   TestApplication application;
579   Dali::Path      instance;
580   try
581   {
582     float arg1(0.0f);
583     instance.GenerateControlPoints(arg1);
584     DALI_TEST_CHECK(false); // Should not get here
585   }
586   catch(...)
587   {
588     DALI_TEST_CHECK(true); // We expect an assert
589   }
590   END_TEST;
591 }
592
593 int UtcDaliPathAddPointNegative(void)
594 {
595   TestApplication application;
596   Dali::Path      instance;
597   try
598   {
599     Dali::Vector3 arg1;
600     instance.AddPoint(arg1);
601     DALI_TEST_CHECK(false); // Should not get here
602   }
603   catch(...)
604   {
605     DALI_TEST_CHECK(true); // We expect an assert
606   }
607   END_TEST;
608 }
609
610 int UtcDaliPathGetPointNegative(void)
611 {
612   TestApplication application;
613   Dali::Path      instance;
614   try
615   {
616     unsigned long arg1(0u);
617     instance.GetPoint(arg1);
618     DALI_TEST_CHECK(false); // Should not get here
619   }
620   catch(...)
621   {
622     DALI_TEST_CHECK(true); // We expect an assert
623   }
624   END_TEST;
625 }
626
627 int UtcDaliPathGetPointCountNegative(void)
628 {
629   TestApplication application;
630   Dali::Path      instance;
631   try
632   {
633     instance.GetPointCount();
634     DALI_TEST_CHECK(false); // Should not get here
635   }
636   catch(...)
637   {
638     DALI_TEST_CHECK(true); // We expect an assert
639   }
640   END_TEST;
641 }
642
643 int UtcDaliPathSampleNegative(void)
644 {
645   TestApplication application;
646   Dali::Path      instance;
647   try
648   {
649     float         arg1(0.0f);
650     Dali::Vector3 arg2;
651     Dali::Vector3 arg3;
652     instance.Sample(arg1, arg2, arg3);
653     DALI_TEST_CHECK(false); // Should not get here
654   }
655   catch(...)
656   {
657     DALI_TEST_CHECK(true); // We expect an assert
658   }
659   END_TEST;
660 }