bab8800e66db33812e6348b142b84f452e988cd8
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-Text-Ellipsis.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 <iostream>
19 #include <stdlib.h>
20 #include <unistd.h>
21
22 #include <dali-toolkit-test-suite-utils.h>
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <toolkit-text-utils.h>
25 #include <dali-toolkit/internal/text/font-description-run.h>
26 #include <dali-toolkit/internal/text/rendering/text-typesetter.h>
27 #include <dali-toolkit/internal/text/rendering/view-model.h>
28 #include <dali-toolkit/internal/text/text-controller.h>
29 #include <dali-toolkit/internal/text/text-view.h>
30
31
32 using namespace Dali;
33 using namespace Toolkit;
34 using namespace Text;
35
36
37 namespace
38 {
39
40   const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
41
42   struct ElideData
43   {
44     std::string                                                description;
45     std::string                                                text;
46     bool                                                       isMultiLines;
47     DevelText::LineWrap::Mode                                  lineWrapMode;
48     DevelText::EllipsisPosition::Type                          ellipsisPosition;
49     bool                                                       isMarkup;
50     Vector2                                                    size;
51     unsigned int                                               numberOfLines;
52     unsigned int                                               numberOfGlyphs;
53     float*                                                     positions;
54   };
55
56
57   bool ElideTestViewModel( const ElideData& data )
58   {
59     std::cout << "  testing : " << data.description << std::endl;
60
61     // Load some fonts.
62     TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
63     fontClient.SetDpi( 93u, 93u );
64
65     char* pathNamePtr = get_current_dir_name();
66     const std::string pathName( pathNamePtr );
67     free( pathNamePtr );
68
69     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
70     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
71     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
72
73     // Creates a text controller.
74     ControllerPtr controller = Controller::New();
75
76     // Tests the rendering controller has been created.
77     TypesetterPtr typesetter = Typesetter::New( controller->GetTextModel() );
78     DALI_TEST_CHECK(typesetter);
79
80     // Tests the view model has been created.
81     ViewModel* model = typesetter->GetViewModel();
82     DALI_TEST_CHECK(model);
83
84     // Configures the text controller similarly to the text-label.
85     ConfigureTextLabel( controller );
86
87     // Sets a text and relais-out.
88     controller->SetMarkupProcessorEnabled( data.isMarkup );
89
90     controller->SetMultiLineEnabled( data.isMultiLines );
91     controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) );
92     controller->SetEllipsisPosition( data.ellipsisPosition );
93
94     controller->SetText( data.text );
95     controller->Relayout( data.size );
96
97     // Elide the glyphs.
98     model->ElideGlyphs();
99
100     if( data.numberOfLines != model->GetNumberOfLines() )
101     {
102       std::cout << "  different number of lines : " << model->GetNumberOfLines() << ", expected : " << data.numberOfLines << std::endl;
103       return false;
104     }
105
106     Length numberOfGlyphs = model->GetNumberOfGlyphs();
107
108     if( data.numberOfGlyphs != numberOfGlyphs )
109     {
110       std::cout << "  different number of glyphs : " << numberOfGlyphs << ", expected : " << data.numberOfGlyphs << std::endl;
111       return false;
112     }
113
114     const Vector2* const layoutBuffer              = model->GetLayout();
115     const Length         numberOfLines             = model->GetNumberOfLines();
116     const GlyphIndex     startIndexOfGlyphs        = model->GetStartIndexOfElidedGlyphs();
117     const GlyphIndex     endIndexOfGlyphs          = model->GetEndIndexOfElidedGlyphs();
118     const GlyphIndex     firstMiddleIndexOfGlyphs  = model->GetFirstMiddleIndexOfElidedGlyphs();
119
120
121     //Test total height of lines is fit inside Controller's size
122     Length heightOfLines = 0;
123     for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
124     {
125         const LineRun& tempLine         = *( model->GetLines() + lineIndex);
126         heightOfLines+= (tempLine.ascender - tempLine.descender);
127     }
128
129     if(heightOfLines > data.size.height)
130     {
131         std::cout << "The heightOfLines should be less than height of controller.";
132         std::cout << " The heightOfLines is "<< heightOfLines << "and the height of controller is "<< data.size.height <<std::endl;
133         return false;
134     }
135
136     if( numberOfLines != 0u )
137     {
138       Length   elidedLineIndex    = 0u;
139       for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
140       {
141           const LineRun& tempLine         = *( model->GetLines() + elidedLineIndex);
142           if(tempLine.ellipsis)
143           {
144             elidedLineIndex = lineIndex;
145             break;
146           }
147       }
148       const LineRun& elidedLine                   = *( model->GetLines() + elidedLineIndex);
149       Length         numberOfLineGlyphs           = 0u;
150       Length         numberOfLineGlyphsSecondHalf = 0u;
151
152       switch(data.ellipsisPosition)
153       {
154         case DevelText::EllipsisPosition::START:
155         {
156           numberOfLineGlyphs = elidedLine.glyphRun.numberOfGlyphs - ( startIndexOfGlyphs - elidedLine.glyphRun.glyphIndex);
157           break;
158         }
159         case DevelText::EllipsisPosition::MIDDLE:
160         {
161           numberOfLineGlyphs = firstMiddleIndexOfGlyphs - elidedLine.glyphRun.glyphIndex +1u ;
162           break;
163         }
164         case DevelText::EllipsisPosition::END:
165         default:
166         {
167           numberOfLineGlyphs = endIndexOfGlyphs - elidedLine.glyphRun.glyphIndex + 1u;
168           break;
169         }
170       }
171
172       unsigned int index = 0u;
173       for( ; index < numberOfLineGlyphs; ++index )
174       {
175         if( *( data.positions + index ) != floor(elidedLine.alignmentOffset + ( *( layoutBuffer + index ) ).x ) )
176         {
177           std::cout << "  different layout :";
178           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
179           {
180             std::cout << " " << floor( elidedLine.alignmentOffset + ( *( layoutBuffer + i ) ).x );
181           }
182           std::cout << std::endl;
183           std::cout << "          expected :";
184           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
185           {
186             std::cout << " " << *( data.positions + i );
187           }
188           std::cout << std::endl;
189           return false;
190         }
191       }
192
193
194       for( ; index < numberOfLineGlyphsSecondHalf; ++index )
195       {
196         if( *( data.positions + index ) != floor(elidedLine.alignmentOffset + ( *( layoutBuffer + index ) ).x ) )
197         {
198           std::cout << "  different layout :";
199           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
200           {
201             std::cout << " " << floor( elidedLine.alignmentOffset + ( *( layoutBuffer + i ) ).x );
202           }
203           std::cout << std::endl;
204           std::cout << "          expected :";
205           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
206           {
207             std::cout << " " << *( data.positions + i );
208           }
209           std::cout << std::endl;
210           return false;
211         }
212       }
213
214     }
215
216     return true;
217   }
218
219   bool ElideTestTextView( const ElideData& data )
220   {
221     std::cout << "  testing : " << data.description << std::endl;
222
223     // Load some fonts.
224     TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
225     fontClient.SetDpi( 93u, 93u );
226
227     char* pathNamePtr = get_current_dir_name();
228     const std::string pathName( pathNamePtr );
229     free( pathNamePtr );
230
231     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
232     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
233     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
234
235     // Creates a text controller.
236     ControllerPtr controller = Controller::New();
237
238     if(data.isMultiLines)
239     {
240        // Configures the text controller similarly to the text-editor.
241        ConfigureTextEditor( controller );
242        controller->SetVerticalScrollEnabled( false );
243     }
244     else
245     {
246       // Configures the text controller similarly to the text-field.
247       ConfigureTextField( controller );
248     }
249
250     controller->SetDefaultFontFamily("TizenSansRegular");
251     controller->SetDefaultFontSize(12.0f, Text::Controller::POINT_SIZE);
252
253     controller->SetMultiLineEnabled( data.isMultiLines );
254     controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) );
255
256     // Sets a text and relais-out.
257     controller->SetMarkupProcessorEnabled( data.isMarkup );
258
259     controller->SetTextElideEnabled( true );
260     controller->SetEllipsisPosition( data.ellipsisPosition );
261
262     controller->SetText( data.text );
263     controller->Relayout( data.size );
264
265     // Get view to elide the glyphs.
266     Text::ViewInterface& view = controller->GetView();
267
268     Length numberOfGlyphs = view.GetNumberOfGlyphs();
269
270     if(numberOfGlyphs == 0u)
271     {
272       return data.numberOfGlyphs == 0u;
273     }
274
275     Vector<GlyphInfo> glyphs;
276     glyphs.Resize(numberOfGlyphs);
277
278     Vector<Vector2> positions;
279     positions.Resize(numberOfGlyphs);
280
281     float alignmentOffset = 0u;
282     numberOfGlyphs = view.GetGlyphs(glyphs.Begin(),
283                                     positions.Begin(),
284                                     alignmentOffset,
285                                     0u,
286                                     numberOfGlyphs);
287
288     glyphs.Resize(numberOfGlyphs);
289     positions.Resize(numberOfGlyphs);
290
291
292     if( data.numberOfGlyphs != numberOfGlyphs )
293     {
294       std::cout << "  different number of glyphs : " << numberOfGlyphs << ", expected : " << data.numberOfGlyphs << std::endl;
295       return false;
296     }
297
298     // Tests the text model has been created.
299     const ModelInterface* textModel  = controller->GetTextModel();
300     DALI_TEST_CHECK(textModel);
301
302     if( data.numberOfLines != textModel->GetNumberOfLines() )
303     {
304       std::cout << "  different number of lines : " << textModel->GetNumberOfLines() << ", expected : " << data.numberOfLines << std::endl;
305       return false;
306     }
307
308     const Length     numberOfLines             = textModel->GetNumberOfLines();
309     const GlyphIndex startIndexOfGlyphs        = textModel->GetStartIndexOfElidedGlyphs();
310     const GlyphIndex endIndexOfGlyphs          = textModel->GetEndIndexOfElidedGlyphs();
311     const GlyphIndex firstMiddleIndexOfGlyphs  = textModel->GetFirstMiddleIndexOfElidedGlyphs();
312     const GlyphIndex secondMiddleIndexOfGlyphs = textModel->GetSecondMiddleIndexOfElidedGlyphs();
313
314     //Test total height of lines is fit inside Controller's size
315     Length heightOfLines = 0;
316     for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
317     {
318         const LineRun& tempLine         = *( textModel->GetLines() + lineIndex);
319         heightOfLines+= (tempLine.ascender - tempLine.descender);
320     }
321
322     if(heightOfLines > data.size.height)
323     {
324         std::cout << "The heightOfLines should be less than height of controller.";
325         std::cout << " The heightOfLines is "<< heightOfLines << "and the height of controller is "<< data.size.height <<std::endl;
326         return false;
327     }
328
329     if( numberOfLines != 0u )
330     {
331       Length   elidedLineIndex    = 0u;
332       for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
333       {
334           const LineRun& tempLine         = *( textModel->GetLines() + lineIndex);
335           if(tempLine.ellipsis)
336           {
337             elidedLineIndex = lineIndex;
338             break;
339           }
340       }
341       const LineRun& elidedLine         = *( textModel->GetLines() + elidedLineIndex);
342
343       Length         numberOfLineGlyphs           = 0u;
344       Length         numberOfLineGlyphsSecondHalf = 0u;
345
346       switch(data.ellipsisPosition)
347       {
348         case DevelText::EllipsisPosition::START:
349         {
350           numberOfLineGlyphs = elidedLine.glyphRun.numberOfGlyphs - ( startIndexOfGlyphs - elidedLine.glyphRun.glyphIndex);
351           break;
352         }
353         case DevelText::EllipsisPosition::MIDDLE:
354         {
355           numberOfLineGlyphs = firstMiddleIndexOfGlyphs == elidedLine.glyphRun.glyphIndex ? 0u : (firstMiddleIndexOfGlyphs - elidedLine.glyphRun.glyphIndex +1u);
356
357           if(elidedLine.isSplitToTwoHalves)
358           {
359             numberOfLineGlyphsSecondHalf = (elidedLine.glyphRunSecondHalf.glyphIndex + elidedLine.glyphRunSecondHalf.numberOfGlyphs) - secondMiddleIndexOfGlyphs ;
360
361           }
362           break;
363         }
364         case DevelText::EllipsisPosition::END:
365         default:
366         {
367           numberOfLineGlyphs = endIndexOfGlyphs - elidedLine.glyphRun.glyphIndex + 1u;
368           break;
369         }
370       }
371
372
373       unsigned int index = 0u;
374       for(  ; index < numberOfLineGlyphs; ++index )
375       {
376
377         if( *( data.positions + index ) != floor( elidedLine.alignmentOffset + positions[index].x ))
378         {
379           std::cout << "  different layout :";
380           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
381           {
382             std::cout << " " << floor( elidedLine.alignmentOffset + positions[i].x );
383           }
384           std::cout << std::endl;
385           std::cout << "          expected :";
386           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
387           {
388             std::cout << " " << *( data.positions + i );
389           }
390           std::cout << std::endl;
391           return false;
392         }
393       }
394
395       for( ; index < numberOfLineGlyphsSecondHalf; ++index )
396       {
397         if( *( data.positions + index ) != floor( elidedLine.alignmentOffset + positions[index].x ))
398         {
399           std::cout << "  different layout :";
400           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
401           {
402             std::cout << " " << floor( elidedLine.alignmentOffset + positions[i].x );
403           }
404           std::cout << std::endl;
405           std::cout << "          expected :";
406           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
407           {
408             std::cout << " " << *( data.positions + i );
409           }
410           std::cout << std::endl;
411           return false;
412         }
413       }
414     }
415
416     return true;
417   }
418
419 }
420
421 int UtcDaliTextLabelElideTextLocation(void)
422 {
423   tet_infoline(" UtcDaliTextLabelElideTextLocation ");
424
425   Size textSize00( 100.f, 100.f );
426
427   Size  textSize01( 120.0f, 50.0f );
428   float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
429
430   Size  textSize02( 120.0f, 50.0f );
431   float positions02[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 49.0f, 59.0f, 69.0f, 79.0f, 90.0f };
432
433   Size  textSize03( 120.0f, 60.0f );
434   float positions03[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 63.0f, 73.0f, 82.0f, 0.0f, 14.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 76.0f, 88.0f };
435
436   Size  textSize04( 120.0f, 60.0f );
437   float positions04[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 92.0f, 103.0f, 109.0f, 0.0f, 14.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f, 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
438
439   Size  textSize05( 110.0f, 60.0f );
440   float positions05[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 0.0f, 8.0f, 19.0f, 25.0f, 30.0f, 44.0f, 54.0f, 63.0f, 68.0f, 82.0f, 93.0f, 0.0f, 8.0f, 19.0f, 33.0f, 42.0f, 48.0f, 59.0f, 69.0f, 74.0f, 78.0f };
441
442   Size  textSize06( 110.0f, 60.0f );
443   float positions06[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 63.0f, 73.0f, 82.0f, 0.0f, 14.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 77.0f };
444
445   Size  textSize07( 120.0f, 50.0f );
446   float positions07[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f };
447
448   Size  textSize08( 120.0f, 50.0f );
449   float positions08[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f };
450
451   Size  textSize09( 120.0f, 60.0f );
452   float positions09[] = { 8.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 76.0f, 87.0f, 97.0f, 102.0f, 105.0f, 115.0f };
453
454   Size  textSize10( 120.0f, 60.0f );
455   float positions10[] = { 8.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f };
456
457   Size  textSize11( 100.0f, 60.0f );
458   float positions11[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f };
459
460   Size  textSize12( 100.0f, 60.0f );
461   float positions12[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
462
463   Size  textSize13( 120.0f, 60.0f );
464   float positions13[] = { 118.0f, 111.0f, 97.0f, 89.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 46.0f, 37.0f, 31.0f, 22.0f, 7.0f };
465
466   Size  textSize14( 120.0f, 60.0f );
467   float positions14[] = { 115.0f, 108.0f, 94.0f, 86.0f, 77.0f, 71.0f, 61.0f, 56.0f, 51.0f, 43.0f, 34.0f, 30.0f, 112.0f, 104.0f, 94.0f, 89.0f, 87.0f, 81.0f, 77.0f, 67.0f, 59.0f, 54.0f, 45.0f, 38.0f, 34.0f, 30.0f, 142.0f, 131.0f, 126.0f, 121.0f, 119.0f, 109.0f, 105.0f, 91.0f, 83.0f, 74.0f, 72.0f, 66.0f, 60.0f, 55.0f, 46.0f, 32.0f };
468
469   Size  textSize15( 110.0f, 60.0f );
470   float positions15[] = { 108.0f, 101.0f, 87.0f, 79.0f, 70.0f, 64.0f, 54.0f, 49.0f, 44.0f, 36.0f, 27.0f, 21.0f, 12.0f, 4.0f, 96.0f, 91.0f, 89.0f, 83.0f, 79.0f, 69.0f, 61.0f, 56.0f, 47.0f, 40.0f, 36.0f, 30.0f, 27.0f, 16.0f, 11.0f, 6.0f, 4.0f, 102.0f, 98.0f, 84.0f, 75.0f, 66.0f, 64.0f, 58.0f, 53.0f, 47.0f, 38.0f, 25.0f, 22.0f, 5.0f };
471
472   Size  textSize16( 110.0f, 60.0f );
473   float positions16[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 35.0f, 28.0f, 24.0f, 20.0f, 116.0f, 104.0f, 99.0f, 95.0f, 92.0f, 83.0f, 79.0f, 65.0f, 56.0f, 48.0f, 45.0f, 39.0f, 24.0f };
474
475   Size  textSize17( 110.0f, 60.0f );
476   float positions17[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 35.0f, 28.0f, 24.0f, 20.0f, 116.0f, 104.0f, 99.0f, 95.0f, 92.0f, 83.0f, 79.0f, 65.0f, 56.0f, 48.0f, 45.0f, 39.0f, 24.0f };
477
478   Size  textSize18( 120.0f, 60.0f );
479   float positions18[] = { 89.0f, 79.0f, 70.0f, 68.0f, 62.0f, 56.0f, 51.0f, 42.0f, 28.0f, 25.0f, 14.0f, 7.0f, 0.0f };
480
481   Size  textSize19( 120.0f, 60.0f );
482   float positions19[] = { 103.0f, 91.0f, 86.0f, 84.0f, 78.0f, 74.0f, 64.0f, 56.0f, 51.0f, 42.0f, 35.0f, 31.0f, 27.0f };
483
484   Size  textSize20( 110.0f, 60.0f );
485   float positions20[] = { 89.0f, 82.0f, 78.0f, 68.0f, 60.0f, 55.0f, 46.0f, 39.0f, 35.0f, 29.0f, 26.0f, 15.0f, 10.0f, 5.0f, 3.0f };
486
487   Size  textSize21( 110.0f, 60.0f );
488   float positions21[] = { 93.0f, 81.0f, 76.0f, 74.0f, 68.0f, 64.0f, 54.0f, 46.0f, 41.0f, 32.0f, 25.0f, 21.0f, 17.0f };
489
490   Size  textSize22( 110.0f, 60.0f );
491   float positions22[] = { 93.0f, 81.0f, 76.0f, 74.0f, 68.0f, 64.0f, 54.0f, 46.0f, 41.0f, 32.0f, 25.0f, 21.0f, 17.0f };
492
493   Size  textSize23( 120.0f, 50.0f );
494   float positions23[] = { 0.0f, 11.0f, 20.0f, 32.0f, 44.0f };
495
496   Size  textSize24( 120.0f, 50.0f );
497   float positions24[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
498
499   Size  textSize25( 120.0f, 60.0f );
500   float positions25[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 64.0f };
501
502   Size  textSize26( 120.0f, 60.0f );
503   float positions26[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 92.0f, 103.0f, 109.0f, 0.0f, 14.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 86.0f };
504
505   Size  textSize27( 110.0f, 60.0f );
506   float positions27[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 0.0f, 8.0f, 19.0f, 25.0f, 30.0f, 44.0f, 54.0f, 63.0f, 69.0f };
507
508   Size  textSize28( 110.0f, 60.0f );
509   float positions28[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 64.0f };
510
511   Size  textSize29( 120.0f, 60.0f );
512   float positions29[] = { 115.0f, 108.0f, 94.0f, 86.0f, 78.0f, 72.0f, 61.0f };
513
514   Size  textSize30( 120.0f, 60.0f );
515   float positions30[] = { 115.0f, 108.0f, 94.0f, 86.0f, 77.0f, 71.0f, 61.0f, 56.0f, 51.0f, 43.0f, 34.0f, 30.0f, 112.0f, 104.0f, 94.0f, 89.0f, 87.0f, 81.0f, 77.0f, 67.0f, 59.0f, 54.0f, 34.0f };
516
517   Size  textSize31( 110.0f, 60.0f );
518   float positions31[] = { 108.0f, 101.0f, 87.0f, 79.0f, 70.0f, 64.0f, 54.0f, 49.0f, 44.0f, 36.0f, 27.0f, 21.0f, 12.0f, 4.0f, 96.0f, 91.0f, 89.0f, 83.0f, 79.0f, 69.0f, 61.0f, 56.0f, 47.0f, 40.0f, 36.0f, 30.0f, 27.0f, 11.0f };
519
520   Size  textSize32( 110.0f, 60.0f );
521   float positions32[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 24.0f };
522
523   Size  textSize33( 110.0f, 60.0f );
524   float positions33[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 24.0f };
525
526   Size  textSize34( 120.0f, 30.0f );
527   float positions34[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
528
529   Size  textSize35( 120.0f, 30.0f );
530   float positions35[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
531
532   Size  textSize36( 120.0f, 30.0f );
533   float positions36[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
534
535   struct ElideData data[] =
536   {
537     {
538       "void text",
539       "",
540       false,
541       DevelText::LineWrap::WORD,
542       DevelText::EllipsisPosition::END,
543       false,
544       textSize00,
545       0u,
546       0u,
547       nullptr
548     },
549
550     {
551       "void text",
552       "",
553       false,
554       DevelText::LineWrap::WORD,
555       DevelText::EllipsisPosition::START,
556       false,
557       textSize00,
558       0u,
559       0u,
560       nullptr
561     },
562
563     {
564       "void text",
565       "",
566       false,
567       DevelText::LineWrap::WORD,
568       DevelText::EllipsisPosition::MIDDLE,
569       false,
570       textSize00,
571       0u,
572       0u,
573       nullptr
574     },
575
576    //END LTR cases
577     {
578       "EllipsisPosition: TextLabel: Basic case SingleLine LTR END",
579       "A0123456789 B0123456789 C0123456789 D0123456789 ",
580       false,
581       DevelText::LineWrap::WORD,
582       DevelText::EllipsisPosition::END,
583       false,
584       textSize01,
585       1u,
586       10u,
587       positions01
588     },
589
590     {
591       "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR END",
592       "A0123456789 B0123456789 C0123456789 D0123456789 ",
593       true,
594       DevelText::LineWrap::WORD,
595       DevelText::EllipsisPosition::END,
596       false,
597       textSize02,
598       2u,
599       22u,
600       positions02
601     },
602
603     {
604       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR END",
605       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
606       true,
607       DevelText::LineWrap::WORD,
608       DevelText::EllipsisPosition::END,
609       false,
610       textSize03,
611       3u,
612       29u,
613       positions03
614     },
615
616     {
617       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR END",
618       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
619       true,
620       DevelText::LineWrap::CHARACTER,
621       DevelText::EllipsisPosition::END,
622       false,
623       textSize04,
624       3u,
625       40u,
626       positions04
627     },
628
629     {
630       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR END",
631       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
632       true,
633       DevelText::LineWrap::HYPHENATION,
634       DevelText::EllipsisPosition::END,
635       false,
636       textSize05,
637       3u,
638       32u,
639       positions05
640     },
641
642     {
643       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR END",
644       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
645       true,
646       DevelText::LineWrap::MIXED,
647       DevelText::EllipsisPosition::END,
648       false,
649       textSize06,
650       3u,
651       28u,
652       positions06
653     },
654
655    //START LTR cases
656     {
657       "EllipsisPosition: TextLabel: Basic case SingleLine LTR START",
658       "A0123456789 B0123456789 C0123456789 D0123456789 ",
659       false,
660       DevelText::LineWrap::WORD,
661       DevelText::EllipsisPosition::START,
662       false,
663       textSize07,
664       1u,
665       11u,
666       positions07
667     },
668
669     {
670       "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR START",
671       "A0123456789 B0123456789 C0123456789 D0123456789 ",
672       true,
673       DevelText::LineWrap::WORD,
674       DevelText::EllipsisPosition::START,
675       false,
676       textSize08,
677       2u,
678       23u,
679       positions08
680     },
681
682     {
683       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR START",
684       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
685       true,
686       DevelText::LineWrap::WORD,
687       DevelText::EllipsisPosition::START,
688       false,
689       textSize09,
690       3u,
691       33u,
692       positions09
693     },
694
695     {
696       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR START",
697       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
698       true,
699       DevelText::LineWrap::CHARACTER,
700       DevelText::EllipsisPosition::START,
701       false,
702       textSize10,
703       3u,
704       37u,
705       positions10
706     },
707
708     {
709       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR START",
710       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
711       true,
712       DevelText::LineWrap::HYPHENATION,
713       DevelText::EllipsisPosition::START,
714       false,
715       textSize11,
716       3u,
717       25u,
718       positions11
719     },
720
721     {
722       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR START",
723       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
724       true,
725       DevelText::LineWrap::MIXED,
726       DevelText::EllipsisPosition::START,
727       false,
728       textSize12,
729       3u,
730       25u,
731       positions12
732     },
733
734   //END RTL cases
735     {
736       "EllipsisPosition: TextLabel: SingleLine RTL END",
737       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
738       false,
739       DevelText::LineWrap::WORD,
740       DevelText::EllipsisPosition::END,
741       false,
742       textSize13,
743       1u,
744       14u,
745       positions13
746     },
747
748     {
749       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL END",
750       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
751       true,
752       DevelText::LineWrap::WORD,
753       DevelText::EllipsisPosition::END,
754       false,
755       textSize14,
756       3u,
757       42u,
758       positions14
759     },
760
761     {
762       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL END",
763       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
764       true,
765       DevelText::LineWrap::CHARACTER,
766       DevelText::EllipsisPosition::END,
767       false,
768       textSize15,
769       3u,
770       44u,
771       positions15
772     },
773
774     {
775       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL END",
776       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
777       true,
778       DevelText::LineWrap::HYPHENATION,
779       DevelText::EllipsisPosition::END,
780       false,
781       textSize16,
782       3u,
783       39u,
784       positions16
785     },
786
787     {
788       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL END",
789       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
790       true,
791       DevelText::LineWrap::MIXED,
792       DevelText::EllipsisPosition::END,
793       false,
794       textSize17,
795       3u,
796       39u,
797       positions17
798     },
799
800    //START RTL cases
801     {
802       "EllipsisPosition: TextLabel: SingleLine RTL START",
803       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
804       false,
805       DevelText::LineWrap::WORD,
806       DevelText::EllipsisPosition::START,
807       false,
808       textSize18,
809       1u,
810       13u,
811       positions18
812     },
813
814     {
815       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL START",
816       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
817       true,
818       DevelText::LineWrap::WORD,
819       DevelText::EllipsisPosition::START,
820       false,
821       textSize19,
822       3u,
823       33u,
824       positions19
825     },
826
827     {
828       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL START",
829       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
830       true,
831       DevelText::LineWrap::CHARACTER,
832       DevelText::EllipsisPosition::START,
833       false,
834       textSize20,
835       3u,
836       30u,
837       positions20
838     },
839
840     {
841       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL START",
842       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
843       true,
844       DevelText::LineWrap::HYPHENATION,
845       DevelText::EllipsisPosition::START,
846       false,
847       textSize21,
848       3u,
849       33u,
850       positions21
851     },
852
853     {
854       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL START",
855       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
856       true,
857       DevelText::LineWrap::MIXED,
858       DevelText::EllipsisPosition::START,
859       false,
860       textSize22,
861       3u,
862       33u,
863       positions22
864     },
865
866   //MIDDLE LTR cases
867     {
868       "EllipsisPosition: TextLabel: Basic case SingleLine LTR MIDDLE",
869       "ABCDEFGHIJKLMNPQRSTUVWXYZ abcdefghijklmnpqrstuvwxyz",
870       false,
871       DevelText::LineWrap::WORD,
872       DevelText::EllipsisPosition::MIDDLE,
873       false,
874       textSize23,
875       1u,
876       10u,
877       positions23
878     },
879
880     {
881       "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
882       "A0123456789 B0123456789 C0123456789 D0123456789 ",
883       true,
884       DevelText::LineWrap::WORD,
885       DevelText::EllipsisPosition::MIDDLE,
886       false,
887       textSize24,
888       2u,
889       22u,
890       positions24
891     },
892
893     {
894       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR MIDDLE",
895       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
896       true,
897       DevelText::LineWrap::WORD,
898       DevelText::EllipsisPosition::MIDDLE,
899       false,
900       textSize25,
901       3u,
902       24u,
903       positions25
904     },
905
906     {
907       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
908       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
909       true,
910       DevelText::LineWrap::CHARACTER,
911       DevelText::EllipsisPosition::MIDDLE,
912       false,
913       textSize26,
914       3u,
915       36u,
916       positions26
917     },
918
919     {
920       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
921       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
922       true,
923       DevelText::LineWrap::HYPHENATION,
924       DevelText::EllipsisPosition::MIDDLE,
925       false,
926       textSize27,
927       3u,
928       27u,
929       positions27
930     },
931
932     {
933       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR MIDDLE",
934       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
935       true,
936       DevelText::LineWrap::MIXED,
937       DevelText::EllipsisPosition::MIDDLE,
938       false,
939       textSize28,
940       3u,
941       24u,
942       positions28
943     },
944
945 //MIDDLE RTL cases
946     {
947       "EllipsisPosition: TextLabel: SingleLine RTL MIDDLE",
948       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
949       false,
950       DevelText::LineWrap::WORD,
951       DevelText::EllipsisPosition::MIDDLE,
952       false,
953       textSize29,
954       1u,
955       13u,
956       positions29
957     },
958
959     {
960       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL MIDDLE",
961       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
962       true,
963       DevelText::LineWrap::WORD,
964       DevelText::EllipsisPosition::MIDDLE,
965       false,
966       textSize30,
967       3u,
968       31u,
969       positions30
970     },
971
972     {
973       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
974       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
975       true,
976       DevelText::LineWrap::CHARACTER,
977       DevelText::EllipsisPosition::MIDDLE,
978       false,
979       textSize31,
980       3u,
981       29u,
982       positions31
983     },
984
985     {
986       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
987       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
988       true,
989       DevelText::LineWrap::HYPHENATION,
990       DevelText::EllipsisPosition::MIDDLE,
991       false,
992       textSize32,
993       3u,
994       31u,
995       positions32
996     },
997
998     {
999       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL MIDDLE",
1000       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1001       true,
1002       DevelText::LineWrap::MIXED,
1003       DevelText::EllipsisPosition::MIDDLE,
1004       false,
1005       textSize33,
1006       3u,
1007       31u,
1008       positions33
1009     },
1010
1011     {
1012       "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR END",
1013       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1014       true,
1015       DevelText::LineWrap::WORD,
1016       DevelText::EllipsisPosition::END,
1017       false,
1018       textSize34,
1019       1u,
1020       13u,
1021       positions34
1022     },
1023
1024     {
1025       "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR START",
1026       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1027       true,
1028       DevelText::LineWrap::WORD,
1029       DevelText::EllipsisPosition::START,
1030       false,
1031       textSize35,
1032       1u,
1033       11u,
1034       positions35
1035     },
1036
1037     {
1038       "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
1039       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1040       true,
1041       DevelText::LineWrap::WORD,
1042       DevelText::EllipsisPosition::MIDDLE,
1043       false,
1044       textSize36,
1045       1u,
1046       12u,
1047       positions36
1048     },
1049
1050   };
1051   const unsigned int numberOfTests = 39u;
1052
1053   for( unsigned int index = 0u; index < numberOfTests; ++index )
1054   {
1055     ToolkitTestApplication application;
1056     if( !ElideTestViewModel( data[index] ) )
1057     {
1058       tet_result(TET_FAIL);
1059     }
1060   }
1061
1062   tet_result(TET_PASS);
1063   END_TEST;
1064 }
1065
1066
1067 int UtcDaliTextFieldlElideTextLocation(void)
1068 {
1069   tet_infoline(" UtcDaliTextFieldlElideTextLocation ");
1070
1071   Size textSize00( 100.f, 100.f );
1072
1073   Size  textSize01( 120.0f, 50.0f );
1074   float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
1075
1076   Size  textSize02( 120.0f, 50.0f );
1077   float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
1078
1079   Size  textSize03( 120.0f, 50.0f );
1080   float positions03[] = { 117.0f, 111.0f, 97.0f, 88.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 45.0f, 37.0f, 31.0f, 22.0f, 7.0f };
1081
1082   Size  textSize04( 120.0f, 50.0f );
1083   float positions04[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f };
1084
1085   Size  textSize05( 120.0f, 50.0f );
1086   float positions05[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
1087
1088   Size  textSize06( 120.0f, 50.0f );
1089   float positions06[] = { 90.0f, 79.0f, 70.0f, 68.0f, 62.0f, 56.0f, 51.0f, 42.0f, 29.0f, 26.0f, 15.0f, 7.0f, 0.0f };
1090
1091   Size  textSize07( 120.0f, 50.0f );
1092   float positions07[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 53.0f };
1093
1094   Size  textSize08( 120.0f, 50.0f );
1095   float positions08[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1096
1097   Size  textSize09( 120.0f, 50.0f );
1098   float positions09[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f };
1099
1100   Size  textSize10( 120.0f, 50.0f );
1101   float positions10[] = { 121.0f, 116.0f, 111.0f, 106.0f, 101.0f, 96.0f, 92.0f, 87.0f, 83.0f, 77.0f, 63.0f, 55.0f, 46.0f, 40.0f, 30.0f, 16.0f };
1102
1103   Size  textSize11( 120.0f, 50.0f );
1104   float positions11[] = { 93.0f, 77.0f, 74.0f, 63.0f, 56.0f, 49.0f, 44.0f, 39.0f, 34.0f, 29.0f, 24.0f, 19.0f, 14.0f, 9.0f, 5.0f };
1105
1106   Size  textSize12( 120.0f, 50.0f );
1107   float positions12[] = { 117.0f, 112.0f, 107.0f, 102.0f, 97.0f, 92.0f, 87.0f, 82.0f, 79.0f, 72.0f };
1108
1109   struct ElideData data[] =
1110   {
1111     {
1112       "void text",
1113       "",
1114       false,
1115       DevelText::LineWrap::WORD,
1116       DevelText::EllipsisPosition::END,
1117       false,
1118       textSize00,
1119       0u,
1120       0u,
1121       nullptr
1122     },
1123
1124     {
1125       "void text",
1126       "",
1127       false,
1128       DevelText::LineWrap::WORD,
1129       DevelText::EllipsisPosition::START,
1130       false,
1131       textSize00,
1132       0u,
1133       0u,
1134       nullptr
1135     },
1136
1137     {
1138       "void text",
1139       "",
1140       false,
1141       DevelText::LineWrap::WORD,
1142       DevelText::EllipsisPosition::MIDDLE,
1143       false,
1144       textSize00,
1145       0u,
1146       0u,
1147       nullptr
1148     },
1149
1150     {
1151       "EllipsisPosition: TextField: Basic case SingleLine LTR END",
1152       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1153       false,
1154       DevelText::LineWrap::WORD,
1155       DevelText::EllipsisPosition::END,
1156       false,
1157       textSize01,
1158       1u,
1159       10u,
1160       positions01
1161     },
1162
1163     {
1164       "EllipsisPosition: TextField: SingleLine LTR END",
1165       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1166       false,
1167       DevelText::LineWrap::WORD,
1168       DevelText::EllipsisPosition::END,
1169       false,
1170       textSize02,
1171       1u,
1172       13u,
1173       positions02
1174     },
1175
1176     {
1177       "EllipsisPosition: TextField: SingleLine RTL END",
1178       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1179       false,
1180       DevelText::LineWrap::WORD,
1181       DevelText::EllipsisPosition::END,
1182       false,
1183       textSize03,
1184       1u,
1185       14u,
1186       positions03
1187     },
1188
1189     {
1190       "EllipsisPosition: TextField: Basic case SingleLine LTR START",
1191       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1192       false,
1193       DevelText::LineWrap::WORD,
1194       DevelText::EllipsisPosition::START,
1195       false,
1196       textSize04,
1197       1u,
1198       11u,
1199       positions04
1200     },
1201
1202     {
1203       "EllipsisPosition: TextField: SingleLine LTR START",
1204       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1205       false,
1206       DevelText::LineWrap::WORD,
1207       DevelText::EllipsisPosition::START,
1208       false,
1209       textSize05,
1210       1u,
1211       11u,
1212       positions05
1213     },
1214
1215     {
1216       "EllipsisPosition: TextField: SingleLine RTL START",
1217       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1218       false,
1219       DevelText::LineWrap::WORD,
1220       DevelText::EllipsisPosition::START,
1221       false,
1222       textSize06,
1223       1u,
1224       13u,
1225       positions06
1226     },
1227
1228     {
1229       "EllipsisPosition: TextField: Basic case SingleLine LTR MIDDLE",
1230       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1231       false,
1232       DevelText::LineWrap::WORD,
1233       DevelText::EllipsisPosition::MIDDLE,
1234       false,
1235       textSize07,
1236       1u,
1237       11u,
1238       positions07
1239     },
1240
1241     {
1242       "EllipsisPosition: TextField: SingleLine LTR MIDDLE",
1243       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
1244       false,
1245       DevelText::LineWrap::WORD,
1246       DevelText::EllipsisPosition::MIDDLE,
1247       false,
1248       textSize08,
1249       1u,
1250       13u,
1251       positions08
1252     },
1253
1254     {
1255       "EllipsisPosition: TextField: SingleLine RTL MIDDLE",
1256       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1257       false,
1258       DevelText::LineWrap::WORD,
1259       DevelText::EllipsisPosition::MIDDLE,
1260       false,
1261       textSize09,
1262       1u,
1263       13u,
1264       positions09
1265     },
1266
1267     {
1268       "EllipsisPosition: TextField: Head and Tail whitespaces RTL END",
1269       "        السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة         ",
1270       false,
1271       DevelText::LineWrap::WORD,
1272       DevelText::EllipsisPosition::END,
1273       false,
1274       textSize10,
1275       1u,
1276       16u,
1277       positions10
1278     },
1279
1280     {
1281       "EllipsisPosition: TextField: Head and Tail whitespaces RTL START",
1282       "        السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة         ",
1283       false,
1284       DevelText::LineWrap::WORD,
1285       DevelText::EllipsisPosition::START,
1286       false,
1287       textSize11,
1288       1u,
1289       15u,
1290       positions11
1291     },
1292
1293     {
1294       "EllipsisPosition: TextField: Head and Tail whitespaces RTL MIDDLE",
1295       "        السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة         ",
1296       false,
1297       DevelText::LineWrap::WORD,
1298       DevelText::EllipsisPosition::MIDDLE,
1299       false,
1300       textSize12,
1301       1u,
1302       20u,
1303       positions12
1304     },
1305
1306   };
1307
1308   const unsigned int numberOfTests = 15u;
1309
1310   for( unsigned int index = 0u; index < numberOfTests; ++index )
1311   {
1312     ToolkitTestApplication application;
1313     if( !ElideTestTextView( data[index] ) )
1314     {
1315       tet_result(TET_FAIL);
1316     }
1317   }
1318   tet_result(TET_PASS);
1319   END_TEST;
1320
1321 }
1322
1323
1324 int UtcDaliTextEditorElideTextLocation(void)
1325 {
1326   tet_infoline(" UtcDaliTextEditorElideTextLocation ");
1327
1328   Size textSize00( 100.f, 100.f );
1329
1330   Size  textSize01( 120.0f, 50.0f );
1331   float positions01[] =  { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f };
1332
1333   Size  textSize02( 120.0f, 60.0f );
1334   float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f };
1335
1336   Size  textSize03( 120.0f, 60.0f );
1337   float positions03[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 92.0f };
1338
1339   Size  textSize04( 110.0f, 60.0f );
1340   float positions04[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f };
1341
1342   Size  textSize05( 110.0f, 60.0f );
1343   float positions05[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1344
1345   Size  textSize06( 120.0f, 50.0f );
1346   float positions06[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f };
1347
1348   Size  textSize07( 120.0f, 60.0f );
1349   float positions07[] = { 8.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 76.0f, 87.0f, 97.0f, 102.0f, 105.0f, 115.0f };
1350
1351   Size  textSize08( 120.0f, 60.0f );
1352   float positions08[] = { 8.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f };
1353
1354   Size  textSize09( 100.0f, 60.0f );
1355   float positions09[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f };
1356
1357   Size  textSize10( 100.0f, 60.0f );
1358   float positions10[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1359
1360   Size  textSize11( 120.0f, 60.0f );
1361   float positions11[] = { 117.0f, 111.0f, 97.0f, 89.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 45.0f, 37.0f, 32.0f, 112.0f, 103.0f, 94.0f, 89.0f };
1362
1363   Size  textSize12( 110.0f, 60.0f );
1364   float positions12[] = { 109.0f, 102.0f, 89.0f, 80.0f, 72.0f, 66.0f, 56.0f, 50.0f, 46.0f, 37.0f, 29.0f, 23.0f, 14.0f };
1365
1366   Size  textSize13( 110.0f, 60.0f );
1367   float positions13[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f, 57.0f, 53.0f, 44.0f, 36.0f, 31.0f, 111.0f };
1368
1369   Size  textSize14( 110.0f, 60.0f );
1370   float positions14[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f, 57.0f, 53.0f, 44.0f, 36.0f, 31.0f, 111.0f };
1371
1372   Size  textSize15( 120.0f, 60.0f );
1373   float positions15[] = { 130.0f, 118.0f, 113.0f, 111.0f, 105.0f, 101.0f, 91.0f, 83.0f, 78.0f, 69.0f, 62.0f, 58.0f, 54.0f };
1374
1375   Size  textSize16( 110.0f, 60.0f );
1376   float positions16[] = { 92.0f, 85.0f, 81.0f, 71.0f, 63.0f, 58.0f, 49.0f, 42.0f, 38.0f, 32.0f, 29.0f, 18.0f, 13.0f, 8.0f, 6.0f };
1377
1378   Size  textSize17( 110.0f, 60.0f );
1379   float positions17[] = { 110.0f, 98.0f, 93.0f, 91.0f, 85.0f, 81.0f, 71.0f, 63.0f, 58.0f, 49.0f, 42.0f, 38.0f, 34.0f };
1380
1381   Size  textSize18( 110.0f, 60.0f );
1382   float positions18[] = { 110.0f, 98.0f, 93.0f, 91.0f, 85.0f, 81.0f, 71.0f, 63.0f, 58.0f, 49.0f, 42.0f, 38.0f, 34.0f };
1383
1384   Size  textSize19( 120.0f, 50.0f );
1385   float positions19[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
1386
1387   Size  textSize20( 120.0f, 60.0f );
1388   float positions20[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1389
1390   Size  textSize21( 120.0f, 60.0f );
1391   float positions21[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f };
1392
1393   Size  textSize22( 110.0f, 60.0f );
1394   float positions22[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1395
1396   Size  textSize23( 110.0f, 60.0f );
1397   float positions23[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1398
1399   Size  textSize24( 120.0f, 60.0f );
1400   float positions24[] = { 142.0f, 135.0f, 121.0f, 113.0f, 104.0f, 98.0f, 88.0f, 83.0f, 78.0f, 70.0f, 61.0f };
1401
1402   Size  textSize25( 110.0f, 60.0f );
1403   float positions25[] = { 111.0f, 104.0f, 90.0f, 82.0f, 73.0f, 67.0f, 57.0f, 52.0f, 47.0f, 39.0f, 30.0f, 24.0f, 15.0f, 7.0f };
1404
1405   Size  textSize26( 110.0f, 60.0f );
1406   float positions26[] = { 122.0f, 115.0f, 101.0f, 93.0f, 84.0f, 78.0f, 68.0f, 63.0f, 58.0f, 50.0f, 41.0f };
1407
1408   Size  textSize27( 110.0f, 60.0f );
1409   float positions27[] = { 122.0f, 115.0f, 101.0f, 93.0f, 84.0f, 78.0f, 68.0f, 63.0f, 58.0f, 50.0f, 41.0f };
1410
1411   Size  textSize28( 120.0f, 30.0f );
1412   float positions28[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
1413
1414   Size  textSize29( 120.0f, 30.0f );
1415   float positions29[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
1416
1417   Size  textSize30( 120.0f, 30.0f );
1418   float positions30[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1419
1420
1421   struct ElideData data[] =
1422   {
1423     {
1424       "void text",
1425       "",
1426       true,
1427       DevelText::LineWrap::WORD,
1428       DevelText::EllipsisPosition::END,
1429       false,
1430       textSize00,
1431       0u,
1432       0u,
1433       nullptr
1434     },
1435
1436     {
1437       "void text",
1438       "",
1439       true,
1440       DevelText::LineWrap::WORD,
1441       DevelText::EllipsisPosition::START,
1442       false,
1443       textSize00,
1444       0u,
1445       0u,
1446       nullptr
1447     },
1448
1449     {
1450       "void text",
1451       "",
1452       true,
1453       DevelText::LineWrap::WORD,
1454       DevelText::EllipsisPosition::MIDDLE,
1455       false,
1456       textSize00,
1457       0u,
1458       0u,
1459       nullptr
1460     },
1461
1462    //END LTR cases
1463
1464     {
1465       "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR END",
1466       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1467       true,
1468       DevelText::LineWrap::WORD,
1469       DevelText::EllipsisPosition::END,
1470       false,
1471       textSize01,
1472       2u,
1473       22u,
1474       positions01
1475     },
1476
1477     {
1478       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR END",
1479       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1480       true,
1481       DevelText::LineWrap::WORD,
1482       DevelText::EllipsisPosition::END,
1483       false,
1484       textSize02,
1485       3u,
1486       29u,
1487       positions02
1488     },
1489
1490     {
1491       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR END",
1492       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1493       true,
1494       DevelText::LineWrap::CHARACTER,
1495       DevelText::EllipsisPosition::END,
1496       false,
1497       textSize03,
1498       3u,
1499       40u,
1500       positions03
1501     },
1502
1503     {
1504       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR END",
1505       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1506       true,
1507       DevelText::LineWrap::HYPHENATION,
1508       DevelText::EllipsisPosition::END,
1509       false,
1510       textSize04,
1511       3u,
1512       32u,
1513       positions04
1514     },
1515
1516     {
1517       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR END",
1518       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1519       true,
1520       DevelText::LineWrap::MIXED,
1521       DevelText::EllipsisPosition::END,
1522       false,
1523       textSize05,
1524       3u,
1525       28u,
1526       positions05
1527     },
1528
1529    //START LTR cases
1530
1531     {
1532       "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR START",
1533       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1534       true,
1535       DevelText::LineWrap::WORD,
1536       DevelText::EllipsisPosition::START,
1537       false,
1538       textSize06,
1539       2u,
1540       23u,
1541       positions06
1542     },
1543
1544     {
1545       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR START",
1546       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1547       true,
1548       DevelText::LineWrap::WORD,
1549       DevelText::EllipsisPosition::START,
1550       false,
1551       textSize07,
1552       3u,
1553       33u,
1554       positions07
1555     },
1556
1557     {
1558       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR START",
1559       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1560       true,
1561       DevelText::LineWrap::CHARACTER,
1562       DevelText::EllipsisPosition::START,
1563       false,
1564       textSize08,
1565       3u,
1566       37u,
1567       positions08
1568     },
1569
1570     {
1571       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR START",
1572       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1573       true,
1574       DevelText::LineWrap::HYPHENATION,
1575       DevelText::EllipsisPosition::START,
1576       false,
1577       textSize09,
1578       3u,
1579       25u,
1580       positions09
1581     },
1582
1583     {
1584       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR START",
1585       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1586       true,
1587       DevelText::LineWrap::MIXED,
1588       DevelText::EllipsisPosition::START,
1589       false,
1590       textSize10,
1591       3u,
1592       25u,
1593       positions10
1594     },
1595
1596   //END RTL cases
1597
1598     {
1599       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL END",
1600       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1601       true,
1602       DevelText::LineWrap::WORD,
1603       DevelText::EllipsisPosition::END,
1604       false,
1605       textSize11,
1606       3u,
1607       42u,
1608       positions11
1609     },
1610
1611     {
1612       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL END",
1613       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1614       true,
1615       DevelText::LineWrap::CHARACTER,
1616       DevelText::EllipsisPosition::END,
1617       false,
1618       textSize12,
1619       3u,
1620       44u,
1621       positions12
1622     },
1623
1624     {
1625       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL END",
1626       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1627       true,
1628       DevelText::LineWrap::HYPHENATION,
1629       DevelText::EllipsisPosition::END,
1630       false,
1631       textSize13,
1632       3u,
1633       39u,
1634       positions13
1635     },
1636
1637     {
1638       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL END",
1639       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1640       true,
1641       DevelText::LineWrap::MIXED,
1642       DevelText::EllipsisPosition::END,
1643       false,
1644       textSize14,
1645       3u,
1646       39u,
1647       positions14
1648     },
1649
1650    //START RTL cases
1651
1652     {
1653       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL START",
1654       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1655       true,
1656       DevelText::LineWrap::WORD,
1657       DevelText::EllipsisPosition::START,
1658       false,
1659       textSize15,
1660       3u,
1661       33u,
1662       positions15
1663     },
1664
1665     {
1666       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL START",
1667       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1668       true,
1669       DevelText::LineWrap::CHARACTER,
1670       DevelText::EllipsisPosition::START,
1671       false,
1672       textSize16,
1673       3u,
1674       30u,
1675       positions16
1676     },
1677
1678     {
1679       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL START",
1680       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1681       true,
1682       DevelText::LineWrap::HYPHENATION,
1683       DevelText::EllipsisPosition::START,
1684       false,
1685       textSize17,
1686       3u,
1687       33u,
1688       positions17
1689     },
1690
1691     {
1692       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL START",
1693       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1694       true,
1695       DevelText::LineWrap::MIXED,
1696       DevelText::EllipsisPosition::START,
1697       false,
1698       textSize18,
1699       3u,
1700       33u,
1701       positions18
1702     },
1703
1704 //MIDDLE LTR cases
1705
1706     {
1707       "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
1708       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1709       true,
1710       DevelText::LineWrap::WORD,
1711       DevelText::EllipsisPosition::MIDDLE,
1712       false,
1713       textSize19,
1714       2u,
1715       22u,
1716       positions19
1717     },
1718
1719     {
1720       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR MIDDLE",
1721       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1722       true,
1723       DevelText::LineWrap::WORD,
1724       DevelText::EllipsisPosition::MIDDLE,
1725       false,
1726       textSize20,
1727       3u,
1728       24u,
1729       positions20
1730     },
1731
1732     {
1733       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
1734       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1735       true,
1736       DevelText::LineWrap::CHARACTER,
1737       DevelText::EllipsisPosition::MIDDLE,
1738       false,
1739       textSize21,
1740       3u,
1741       36u,
1742       positions21
1743     },
1744
1745     {
1746       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
1747       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1748       true,
1749       DevelText::LineWrap::HYPHENATION,
1750       DevelText::EllipsisPosition::MIDDLE,
1751       false,
1752       textSize22,
1753       3u,
1754       27u,
1755       positions22
1756     },
1757
1758     {
1759       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR MIDDLE",
1760       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1761       true,
1762       DevelText::LineWrap::MIXED,
1763       DevelText::EllipsisPosition::MIDDLE,
1764       false,
1765       textSize23,
1766       3u,
1767       24u,
1768       positions23
1769     },
1770
1771 //MIDDLE RTL cases
1772
1773     {
1774       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL MIDDLE",
1775       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1776       true,
1777       DevelText::LineWrap::WORD,
1778       DevelText::EllipsisPosition::MIDDLE,
1779       false,
1780       textSize24,
1781       3u,
1782       31u,
1783       positions24
1784     },
1785
1786     {
1787       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
1788       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1789       true,
1790       DevelText::LineWrap::CHARACTER,
1791       DevelText::EllipsisPosition::MIDDLE,
1792       false,
1793       textSize25,
1794       3u,
1795       29u,
1796       positions25
1797     },
1798
1799     {
1800       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
1801       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1802       true,
1803       DevelText::LineWrap::HYPHENATION,
1804       DevelText::EllipsisPosition::MIDDLE,
1805       false,
1806       textSize26,
1807       3u,
1808       31u,
1809       positions26
1810     },
1811
1812     {
1813       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL MIDDLE",
1814       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1815       true,
1816       DevelText::LineWrap::MIXED,
1817       DevelText::EllipsisPosition::MIDDLE,
1818       false,
1819       textSize27,
1820       3u,
1821       31u,
1822       positions27
1823     },
1824
1825     {
1826       "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR END",
1827       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1828       true,
1829       DevelText::LineWrap::WORD,
1830       DevelText::EllipsisPosition::END,
1831       false,
1832       textSize28,
1833       1u,
1834       13u,
1835       positions28
1836     },
1837
1838     {
1839       "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR START",
1840       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1841       true,
1842       DevelText::LineWrap::WORD,
1843       DevelText::EllipsisPosition::START,
1844       false,
1845       textSize29,
1846       1u,
1847       11u,
1848       positions29
1849     },
1850
1851     {
1852       "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
1853       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1854       true,
1855       DevelText::LineWrap::WORD,
1856       DevelText::EllipsisPosition::MIDDLE,
1857       false,
1858       textSize30,
1859       1u,
1860       12u,
1861       positions30
1862     },
1863
1864   };
1865   const unsigned int numberOfTests = 33u;
1866
1867   for( unsigned int index = 0u; index < numberOfTests; ++index )
1868   {
1869     ToolkitTestApplication application;
1870     if( !ElideTestTextView( data[index] ) )
1871     {
1872       tet_result(TET_FAIL);
1873     }
1874   }
1875
1876   tet_result(TET_PASS);
1877   END_TEST;
1878 }