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