Builder templated constant expansion
[platform/core/uifw/dali-toolkit.git] / automated-tests / dali-test-suite / table-view / utc-Dali-TableView.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 #include <iostream>
18
19 #include <stdlib.h>
20 #include <tet_api.h>
21
22 #include <dali/public-api/dali-core.h>
23 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
24
25 #include <dali-toolkit-test-suite-utils.h>
26
27 using namespace Dali;
28 using namespace Toolkit;
29
30 static void Startup();
31 static void Cleanup();
32
33 namespace
34 {
35 static bool gObjectCreatedCallBackCalled;
36
37 static void TestCallback(BaseHandle handle)
38 {
39   gObjectCreatedCallBackCalled = true;
40 }
41 } // namespace
42
43 extern "C" {
44   void (*tet_startup)() = Startup;
45   void (*tet_cleanup)() = Cleanup;
46 }
47
48 static void UtcDaliTableViewNew();
49 static void UtcDaliTableViewMetricsPadding();
50 static void UtcDaliTableViewMetricsFixed();
51 static void UtcDaliTableViewMetricsRelative();
52 static void UtcDaliTableViewAnimation();
53 static void UtcDaliTableViewChild();
54 static void UtcDaliTableViewAdd();
55 static void UtcDaliTableViewCells();
56 static void UtcDaliTableViewChildAssert();
57 static void UtcDaliTableViewMetricsAssert();
58
59 enum {
60   POSITIVE_TC_IDX = 0x01,
61   NEGATIVE_TC_IDX,
62 };
63
64 // Add test functionality for all APIs in the class (Positive and Negative)
65 extern "C" {
66   struct tet_testlist tet_testlist[] = {
67     { UtcDaliTableViewNew, POSITIVE_TC_IDX },
68     { UtcDaliTableViewMetricsPadding, POSITIVE_TC_IDX },
69     { UtcDaliTableViewMetricsFixed, POSITIVE_TC_IDX },
70     { UtcDaliTableViewMetricsRelative, POSITIVE_TC_IDX },
71     { UtcDaliTableViewAnimation, POSITIVE_TC_IDX },
72     { UtcDaliTableViewChild, POSITIVE_TC_IDX },
73     { UtcDaliTableViewAdd, POSITIVE_TC_IDX },
74     { UtcDaliTableViewCells, POSITIVE_TC_IDX },
75     { UtcDaliTableViewChildAssert, POSITIVE_TC_IDX },
76     { UtcDaliTableViewMetricsAssert, POSITIVE_TC_IDX },
77     { NULL, 0 }
78   };
79 }
80
81 // Called only once before first test is run.
82 static void Startup()
83 {
84 }
85
86 // Called only once after last test is run
87 static void Cleanup()
88 {
89 }
90
91 struct Constraint100
92 {
93   Constraint100( )
94   {
95   }
96
97   /**
98    * function operator to apply the parent size
99    */
100   Dali::Vector3 operator()(const Dali::Vector3& current)
101   {
102     return Dali::Vector3( 100.0f, 100.0f, 100.0f );
103   }
104 };
105
106 // Convenience function to quickly set up a 10x10 table with each cell being 10x10 pixels in size by default.
107 static void SetupTableViewAndActors(TableView& tableView, Actor& actor1, Actor& actor2, Actor& actor3)
108 {
109   tableView = TableView::New(10,10); // 10 by 10 grid.
110   DALI_TEST_CHECK(tableView);
111
112   Stage::GetCurrent().Add( tableView );
113   tableView.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, Constraint100() ) );
114   tableView.SetLayoutAnimationDuration(0.0f);
115
116   actor1 = Actor::New();
117   actor2 = Actor::New();
118   actor3 = Actor::New();
119
120   actor1.SetSize(10,10);
121   actor2.SetSize(10,10);
122   actor3.SetSize(10,10);
123
124   tableView.AddChild(actor1, TableView::CellPosition(0,0));
125   tableView.AddChild(actor2, TableView::CellPosition(0,1));
126   tableView.AddChild(actor3, TableView::CellPosition(1,0));
127 }
128
129 static void UtcDaliTableViewNew()
130 {
131   ToolkitTestApplication application;
132
133   TableView tableView = TableView::New(10,10);
134   DALI_TEST_CHECK(tableView);
135
136   //Additional check to ensure object is created by checking if it's registered
137   ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
138   DALI_TEST_CHECK( registry );
139
140   gObjectCreatedCallBackCalled = false;
141   registry.ObjectCreatedSignal().Connect(&TestCallback);
142   {
143     TableView tableView = TableView::New(10,10);
144   }
145   DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
146 }
147
148 // Test adjusting the metric values for the cell.
149 static void UtcDaliTableViewMetricsPadding()
150 {
151   ToolkitTestApplication application;
152
153   tet_infoline("UtcDaliTableViewMetricsPadding");
154
155   TableView tableView;
156   Actor actor1;
157   Actor actor2;
158   Actor actor3;
159
160   SetupTableViewAndActors(tableView, actor1, actor2, actor3);
161
162   // 1. check that padding works. no padding:
163   tableView.SetCellPadding(Size(0.0f, 0.0f));
164   application.SendNotification();
165   application.Render();
166
167   DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(0.0f, 0.0f), TEST_LOCATION );
168   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
169   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
170   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
171
172   // 1. check that padding works. some padding:
173   tableView.SetCellPadding(Size(5.0f, 10.0f));
174   application.SendNotification();
175   application.Render();
176
177   DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(5.0f, 10.0f), TEST_LOCATION );
178   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(5.0f, 10.0f, 0.0f), TEST_LOCATION );
179 }
180
181 // Test adjusting the metric values for the cell.
182 static void UtcDaliTableViewMetricsFixed()
183 {
184   ToolkitTestApplication application;
185
186   tet_infoline("UtcDaliTableViewMetricsFixed");
187
188   TableView tableView;
189   Actor actor1;
190   Actor actor2;
191   Actor actor3;
192
193   SetupTableViewAndActors(tableView, actor1, actor2, actor3);
194   application.SendNotification();
195   application.Render();
196
197   // 1. check that with no fixed width/heights, actors are in default position.
198   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
199   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
200   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
201
202   // 2. check that with a fixed width & height, actors to the right and below are offsetted.
203   tableView.SetFixedWidth(0, 20.0f);
204   tableView.SetFixedHeight(0, 50.0f);
205   DALI_TEST_EQUALS( tableView.GetFixedWidth(0), 20.0f, TEST_LOCATION );
206   DALI_TEST_EQUALS( tableView.GetFixedHeight(0), 50.0f, TEST_LOCATION );
207
208   application.SendNotification();
209   application.Render();
210
211   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
212   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(20.0f, 0.0f, 0.0f), TEST_LOCATION );
213   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION );
214 }
215
216 // Test adjusting the metric values for the cell.
217 static void UtcDaliTableViewMetricsRelative()
218 {
219   ToolkitTestApplication application;
220
221   tet_infoline("UtcDaliTableViewMetricsRelative");
222
223   TableView tableView;
224   Actor actor1;
225   Actor actor2;
226   Actor actor3;
227
228   SetupTableViewAndActors(tableView, actor1, actor2, actor3);
229   application.SendNotification();
230   application.Render();
231
232   // 1. check that with no relative width/heights, actors are in default position.
233   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
234   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
235   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
236
237   // 2. check that with a relative width & height, actors to the right and below are offsetted.
238   tableView.SetRelativeWidth(0, 0.3f); // cell 0,0 occupies 30%x50% of the grid (i.e. 30x50 pixels)
239   tableView.SetRelativeHeight(0, 0.5f);
240   DALI_TEST_EQUALS( tableView.GetRelativeWidth(0), 0.3f, TEST_LOCATION );
241   DALI_TEST_EQUALS( tableView.GetRelativeHeight(0), 0.5f, TEST_LOCATION );
242
243   application.SendNotification();
244   application.Render();
245
246   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
247   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(30.0f, 0.0f, 0.0f), TEST_LOCATION );
248   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION );
249 }
250
251
252 // Test animation duration setting.
253 static void UtcDaliTableViewAnimation()
254 {
255   ToolkitTestApplication application;
256
257   tet_infoline("UtcDaliTableViewAnimation");
258   TableView tableView = TableView::New(10,10);
259   DALI_TEST_CHECK(tableView);
260
261   tableView.SetLayoutAnimationDuration(5.0f);
262   DALI_TEST_EQUALS(tableView.GetLayoutAnimationDuration(), 5.0f, TEST_LOCATION);
263
264   tableView.SetLayoutAnimationDuration(2.5f);
265   DALI_TEST_EQUALS(tableView.GetLayoutAnimationDuration(), 2.5f, TEST_LOCATION);
266 }
267
268 // Test Adding/Removing/Finding Children.
269 static void UtcDaliTableViewChild()
270 {
271   ToolkitTestApplication application;
272
273   tet_infoline("UtcDaliTableViewChild");
274
275   // Create a 10x10 table-view
276   TableView tableView = TableView::New(10,10);
277   DALI_TEST_CHECK( tableView );
278
279   // Check if actor doesn't exist.
280   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
281
282   // Add an actor to it at 0,0
283   Actor actor = Actor::New();
284   tableView.AddChild(actor, TableView::CellPosition());
285
286   // Check if exists.
287   DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(0,0)) );
288
289   // Remove this actor
290   tableView.RemoveChildAt(TableView::CellPosition());
291
292   // Check if actor no longer exists.
293   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
294
295   // Add actor to it again, but at 2,5
296   tableView.AddChild(actor, TableView::CellPosition(2,5));
297
298   // Add another actor somewhere else 7,8
299   Actor actor2 = Actor::New();
300   tableView.AddChild(actor2, TableView::CellPosition(7,8));
301
302   Actor searchActor;
303
304   // Check that no actor exists in a few random places.
305   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
306   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(2,1)) );
307   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(6,3)) );
308   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(9,5)) );
309
310   // Check for actors at actual positions.
311   searchActor = tableView.GetChildAt(TableView::CellPosition(2,5));
312   DALI_TEST_CHECK( searchActor == actor);
313
314   searchActor = tableView.GetChildAt(TableView::CellPosition(7,8));
315   DALI_TEST_CHECK( searchActor == actor2);
316
317   // Create a second table, and add already added Child to new one.
318   TableView tableView2 = TableView::New(5,5);
319   tableView2.AddChild(actor, TableView::CellPosition(2,2));
320   DALI_TEST_CHECK( tableView2.GetChildAt(TableView::CellPosition(2,2)) );
321 }
322
323 // Test calling Add on it's own (to invoke the OnChildAdd)
324 static void UtcDaliTableViewAdd()
325 {
326   ToolkitTestApplication application;
327
328   tet_infoline("UtcDaliTableViewAdd");
329
330   // Create a 4x1 table-view, and just keep adding.
331   TableView tableView = TableView::New(1,4);
332   DALI_TEST_CHECK( tableView );
333
334   for(unsigned int i = 0;i<16;i++)
335   {
336     Actor currentActor = Actor::New();
337     TableView::CellPosition position = TableView::CellPosition();
338     tableView.Add( currentActor );
339     tableView.FindChildPosition(currentActor, position);
340     tet_printf("%dx%d (%d,%d)\n", tableView.GetColumns(), tableView.GetRows(), position.columnIndex, position.rowIndex);
341
342     DALI_TEST_EQUALS((position.rowIndex * 4 + position.columnIndex), i, TEST_LOCATION);
343   }
344 }
345
346 // Test cell modification.
347 static void UtcDaliTableViewCells()
348 {
349   ToolkitTestApplication application;
350   tet_infoline("UtcDaliTableViewCells");
351
352   // Create a 10x10 table-view
353   TableView tableView = TableView::New(10,10);
354   DALI_TEST_CHECK( tableView );
355
356   // Add a few actors to the table.
357   Actor actor1 = Actor::New();
358   Actor actor2 = Actor::New();
359   Actor actor3 = Actor::New();
360   actor1.SetName("Actor1");
361   actor2.SetName("Actor2");
362   actor3.SetName("Actor3");
363
364   // note: positions are specified in reversed cartesian coords - row,col (i.e. y,x)
365   tableView.AddChild(actor1, TableView::CellPosition(0,0));
366   tableView.AddChild(actor2, TableView::CellPosition(5,5));
367   tableView.AddChild(actor3, TableView::CellPosition(7,2));
368
369   DALI_TEST_CHECK( tableView.GetRows() == 10 && tableView.GetColumns() == 10 );
370
371   // Add a row between actor1 and actor2 | insert column on actor1 and see what happens...
372   tableView.InsertRow(3);
373   tableView.InsertColumn(0);
374   DALI_TEST_CHECK( tableView.GetRows() == 11 && tableView.GetColumns() == 11 );
375
376   TableView::CellPosition cellPosition;
377   bool result;
378
379   result = tableView.FindChildPosition(actor1, cellPosition);
380   DALI_TEST_CHECK( result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
381   result = tableView.FindChildPosition(actor2, cellPosition);
382   DALI_TEST_CHECK( result && cellPosition.rowIndex == 6 && cellPosition.columnIndex == 6);
383   result = tableView.FindChildPosition(actor3, cellPosition);
384   DALI_TEST_CHECK( result && cellPosition.rowIndex == 8 && cellPosition.columnIndex == 3);
385
386   // Delete a row between actor2 and actor3 | delete column on actor2 and see what happens...
387   tableView.DeleteRow(7);
388   tableView.DeleteColumn(6);
389   DALI_TEST_CHECK( tableView.GetRows() == 10 && tableView.GetColumns() == 10 );
390
391   result = tableView.FindChildPosition(actor1, cellPosition);
392   DALI_TEST_CHECK( result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
393   result = tableView.FindChildPosition(actor2, cellPosition);
394   DALI_TEST_CHECK( !result );
395   result = tableView.FindChildPosition(actor3, cellPosition);
396   DALI_TEST_CHECK( result && cellPosition.rowIndex == 7 && cellPosition.columnIndex == 3);
397
398   // Delete the other two remaining actors by a row delete and a column delete.
399   std::vector<Actor> actorsRemoved;
400   tableView.DeleteRow(0, actorsRemoved);
401   tet_printf("Row Delete >> Actors Removed: %d {", actorsRemoved.size());
402   for(size_t i = 0;i<actorsRemoved.size();i++) tet_printf("%d => %s, ", i, actorsRemoved[i].GetName().c_str());
403   tet_printf("}\n");
404   DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
405   DALI_TEST_CHECK( actorsRemoved[0] == actor1 );
406
407   actorsRemoved.clear();
408   tableView.DeleteColumn(3, actorsRemoved);
409   tet_printf("Column Delete >> Actors Removed: %d {", actorsRemoved.size());
410   for(size_t i = 0;i<actorsRemoved.size();i++) tet_printf("%d => %s, ", i, actorsRemoved[i].GetName().c_str());
411   tet_printf("}\n");
412   DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
413   DALI_TEST_CHECK( actorsRemoved[0] == actor3 );
414
415   DALI_TEST_CHECK( tableView.GetRows() == 9 && tableView.GetColumns() == 9 );
416
417   tableView.AddChild(actor1, TableView::CellPosition(5,8));
418   tableView.Resize(100,100);
419   DALI_TEST_CHECK( tableView.GetRows() == 100 && tableView.GetColumns() == 100 );
420
421   tableView.AddChild(actor2, TableView::CellPosition(69,57));
422   DALI_TEST_CHECK( tableView.FindChildPosition(actor1, cellPosition) && tableView.FindChildPosition(actor2, cellPosition) );
423
424   tableView.Resize(20,20);
425   DALI_TEST_CHECK( tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition) );
426
427   actorsRemoved.clear();
428   tableView.Resize(1,1, actorsRemoved);
429   DALI_TEST_CHECK( !tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition) );
430   DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
431   DALI_TEST_CHECK( actorsRemoved[0] == actor1 );
432
433   // Add child outside table size, forcing a resize.
434   tableView.AddChild(actor1, TableView::CellPosition(100, 100, 1, 1));
435   DALI_TEST_CHECK( tableView.GetRows() == 101 && tableView.GetColumns() == 101 );
436
437   // Add child outside table size, forcing a resize.
438   tableView.AddChild(actor1, TableView::CellPosition(110, 110, 5, 5));
439   DALI_TEST_CHECK( tableView.GetRows() == 115 && tableView.GetColumns() == 115 );
440
441   DALI_TEST_CHECK( true );
442 }
443
444 static void UtcDaliTableViewChildAssert()
445 {
446   ToolkitTestApplication application;
447   tet_infoline("UtcDaliTableViewChildAssert");
448
449   // Create a 10x10 table-view
450   TableView tableView = TableView::New(10,10);
451   DALI_TEST_CHECK( tableView );
452   Actor childActor;
453
454   try
455   {
456     tableView.AddChild( childActor, TableView::CellPosition(0,0,5,5) );
457     // should assert
458     tet_result(TET_FAIL);
459   }
460   catch( Dali::DaliException &e )
461   {
462     tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
463     DALI_TEST_EQUALS(e.mCondition, "child", TEST_LOCATION);
464   }
465 }
466
467 static void UtcDaliTableViewMetricsAssert()
468 {
469   ToolkitTestApplication application;
470   tet_infoline("UtcDaliTableViewChildAssert");
471
472   // Create a 10x10 table-view
473   TableView tableView = TableView::New(10,10);
474   DALI_TEST_CHECK( tableView );
475
476   // fixeds...
477
478   try
479   {
480     tableView.SetFixedHeight( 10, 1.0f );
481
482     tet_result(TET_FAIL);
483   }
484   catch( Dali::DaliException &e)
485   {
486     tet_printf("1. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
487     DALI_TEST_EQUALS(e.mCondition, "rowIndex < mFixedHeights.size()", TEST_LOCATION);
488   }
489
490   try
491   {
492     tableView.GetFixedHeight( 10 );
493
494     tet_result(TET_FAIL);
495   }
496   catch( Dali::DaliException &e)
497   {
498     tet_printf("2. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
499     DALI_TEST_EQUALS(e.mCondition, "rowIndex < mFixedHeights.size()", TEST_LOCATION);
500   }
501
502   try
503   {
504     tableView.SetFixedWidth( 10, 1.0f );
505
506     tet_result(TET_FAIL);
507   }
508   catch( Dali::DaliException &e)
509   {
510     tet_printf("3. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
511     DALI_TEST_EQUALS(e.mCondition, "columnIndex < mFixedWidths.size()", TEST_LOCATION);
512   }
513
514   try
515   {
516     tableView.GetFixedWidth( 10 );
517
518     tet_result(TET_FAIL);
519   }
520   catch( Dali::DaliException &e)
521   {
522     tet_printf("4. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
523     DALI_TEST_EQUALS(e.mCondition, "columnIndex < mFixedWidths.size()", TEST_LOCATION);
524   }
525
526   // relatives...
527
528   try
529   {
530     tableView.SetRelativeHeight( 10, 0.1f );
531
532     tet_result(TET_FAIL);
533   }
534   catch( Dali::DaliException &e)
535   {
536     tet_printf("5. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
537     DALI_TEST_EQUALS(e.mCondition, "rowIndex < mRelativeHeights.size()", TEST_LOCATION);
538   }
539
540   try
541   {
542     tableView.GetRelativeHeight( 10 );
543
544     tet_result(TET_FAIL);
545   }
546   catch( Dali::DaliException &e)
547   {
548     tet_printf("6. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
549     DALI_TEST_EQUALS(e.mCondition, "rowIndex < mRelativeHeights.size()", TEST_LOCATION);
550   }
551
552   try
553   {
554     tableView.SetRelativeWidth( 10, 0.1f );
555
556     tet_result(TET_FAIL);
557   }
558   catch( Dali::DaliException &e)
559   {
560     tet_printf("7. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
561     DALI_TEST_EQUALS(e.mCondition, "columnIndex < mRelativeWidths.size()", TEST_LOCATION);
562   }
563
564   try
565   {
566     tableView.GetRelativeWidth( 10 );
567
568     tet_result(TET_FAIL);
569   }
570   catch( Dali::DaliException &e)
571   {
572     tet_printf("8. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
573     DALI_TEST_EQUALS(e.mCondition, "columnIndex < mRelativeWidths.size()", TEST_LOCATION);
574   }
575 }