2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali-toolkit-test-suite-utils.h>
23 #include <dali-toolkit/internal/text/cursor-helper-functions.h>
24 #include <dali-toolkit/dali-toolkit.h>
25 #include <toolkit-text-utils.h>
29 using namespace Toolkit;
32 // Tests the following functions.
34 // LineIndex GetClosestLine( VisualModelPtr visualModel,
37 // CharacterIndex GetClosestCursorIndex( VisualModelPtr visualModel,
38 // LogicalModelPtr logicalModel,
39 // MetricsPtr metrics,
42 // CharacterHitTest::Mode mode,
43 // bool& isCharacterHit )
45 //////////////////////////////////////////////////////////
50 struct GetClosestLineData
52 std::string description; ///< Description of the test.
53 std::string text; ///< Input text.
54 unsigned int numberOfTests; ///< The number of tests.
55 float* visualY; ///< The visual 'y' position for each test.
56 LineIndex* lineIndex; ///< The expected line index for each test.
57 bool* isLineHit; ///< The expected line hit value for each test.
60 struct GetClosestCursorIndexData
62 std::string description; ///< Description of the test.
63 std::string text; ///< Input text.
64 unsigned int numberOfTests; ///< The number of tests.
65 float* visualX; ///< The visual 'x' position for each test.
66 float* visualY; ///< The visual 'y' position for each test.
67 CharacterHitTest::Mode* mode; ///< The type of hit test.
68 CharacterIndex* logicalIndex; ///< The expected logical cursor index for each test.
69 bool* isCharacterHit; ///< The expected character hit value for each test.
72 struct GetCursorPositionData
74 std::string description; ///< Description of the test.
75 std::string text; ///< Input text.
76 unsigned int numberOfTests; ///< The number of tests.
77 CharacterIndex* logicalIndex; ///< The logical cursor index for each test.
78 float* visualX; ///< The expected visual 'x' position for each test.
79 float* visualY; ///< The expected visual 'y' position for each test.
82 struct FindSelectionIndicesData
84 std::string description; ///< Description of the test.
85 std::string text; ///< Input text.
86 unsigned int numberOfTests; ///< The number of tests.
87 float* visualX; ///< The visual 'x' position for each test.
88 float* visualY; ///< The visual 'y' position for each test.
89 bool* found; ///< Whether selection indices are found.
90 CharacterIndex* startIndex; ///< The expected start cursor index for each test.
91 CharacterIndex* endIndex; ///< The expected end cursor index for each test.
92 CharacterIndex* noTextHitIndex; ///< The expected character index when there is no hit.
95 bool GetClosestLineTest( const GetClosestLineData& data )
97 std::cout << " testing : " << data.description << std::endl;
99 // 1) Create the model.
102 Size textArea(400.f, 600.f);
105 Vector<FontDescriptionRun> fontDescriptionRuns;
106 LayoutOptions options;
107 CreateTextModel( data.text,
116 LogicalModelPtr logicalModel = textModel->mLogicalModel;
117 VisualModelPtr visualModel = textModel->mVisualModel;
119 for( unsigned int index = 0; index < data.numberOfTests; ++index )
121 bool isLineHit = false;
122 const LineIndex lineIndex = GetClosestLine( visualModel,
126 if( lineIndex != data.lineIndex[index] )
128 std::cout << " test " << index << " failed. Different line index : " << lineIndex << ", expected : " << data.lineIndex[index] << std::endl;
131 if( isLineHit != data.isLineHit[index] )
133 std::cout << " test " << index << " failed. Different line hit value : " << isLineHit << ", expected : " << data.isLineHit[index] << std::endl;
141 bool GetClosestCursorIndexTest( const GetClosestCursorIndexData& data )
143 std::cout << " testing : " << data.description << std::endl;
145 // 1) Create the model.
148 Size textArea(400.f, 600.f);
151 Vector<FontDescriptionRun> fontDescriptionRuns;
152 LayoutOptions options;
153 CreateTextModel( data.text,
162 LogicalModelPtr logicalModel = textModel->mLogicalModel;
163 VisualModelPtr visualModel = textModel->mVisualModel;
165 for( unsigned int index = 0; index < data.numberOfTests; ++index )
167 bool isCharacterHit = false;
168 const CharacterIndex logicalCursorIndex = GetClosestCursorIndex( visualModel,
176 if( logicalCursorIndex != data.logicalIndex[index] )
178 std::cout << " test " << index << " failed. Different logical cursor index : " << logicalCursorIndex << ", expected : " << data.logicalIndex[index] << std::endl;
181 if( isCharacterHit != data.isCharacterHit[index] )
183 std::cout << " test " << index << " failed. Different character hit value : " << isCharacterHit << ", expected : " << data.isCharacterHit[index] << std::endl;
191 bool GetCursorPositionTest( const GetCursorPositionData& data )
193 std::cout << " testing : " << data.description << std::endl;
195 // 1) Create the model.
198 Size textArea(400.f, 600.f);
201 Vector<FontDescriptionRun> fontDescriptionRuns;
202 LayoutOptions options;
203 CreateTextModel( data.text,
212 LogicalModelPtr logicalModel = textModel->mLogicalModel;
213 VisualModelPtr visualModel = textModel->mVisualModel;
215 GetCursorPositionParameters parameters;
216 parameters.visualModel = visualModel;
217 parameters.logicalModel = logicalModel;
218 parameters.metrics = metrics;
219 parameters.isMultiline = true;
221 for( unsigned int index = 0; index < data.numberOfTests; ++index )
223 CursorInfo cursorInfo;
224 parameters.logical = data.logicalIndex[index];
226 GetCursorPosition( parameters,
229 if( floor(cursorInfo.primaryPosition.x) != data.visualX[index] )
231 std::cout << " test " << index << " failed. Different 'x' cursor position : " << cursorInfo.primaryPosition.x << ", expected : " << data.visualX[index] << std::endl;
234 if( floor(cursorInfo.primaryPosition.y) != data.visualY[index] )
236 std::cout << " test " << index << " failed. Different 'y' cursor position : " << cursorInfo.primaryPosition.y << ", expected : " << data.visualY[index] << std::endl;
244 bool FindSelectionIndicesTest( const FindSelectionIndicesData& data )
246 std::cout << " testing : " << data.description << std::endl;
248 // 1) Create the model.
251 Size textArea(400.f, 600.f);
254 Vector<FontDescriptionRun> fontDescriptionRuns;
255 LayoutOptions options;
256 CreateTextModel( data.text,
265 LogicalModelPtr logicalModel = textModel->mLogicalModel;
266 VisualModelPtr visualModel = textModel->mVisualModel;
268 for( unsigned int index = 0; index < data.numberOfTests; ++index )
270 CharacterIndex startIndex = 0;
271 CharacterIndex endIndex = 0;
272 CharacterIndex noTextHitIndex = 0;
273 const bool found = FindSelectionIndices( visualModel,
282 if( found != data.found[index] )
284 std::cout << " test " << index << " failed. Different found value : " << found << ", expected : " << data.found[index] << std::endl;
287 if( startIndex != data.startIndex[index] )
289 std::cout << " test " << index << " failed. Different start index : " << startIndex << ", expected : " << data.startIndex[index] << std::endl;
292 if( endIndex != data.endIndex[index] )
294 std::cout << " test " << index << " failed. Different end index : " << endIndex << ", expected : " << data.endIndex[index] << std::endl;
297 if( noTextHitIndex != data.noTextHitIndex[index] )
299 std::cout << " test " << index << " failed. Different no text hit index : " << noTextHitIndex << ", expected : " << data.noTextHitIndex[index] << std::endl;
308 //////////////////////////////////////////////////////////
310 // UtcDaliGetClosestLine
311 // UtcDaliGetClosestCursorIndex
313 //////////////////////////////////////////////////////////
315 int UtcDaliGetClosestLine(void)
317 tet_infoline(" UtcDaliGetClosestLine");
319 float visualY01[] = { -4.f, 3.f, 1000.f };
320 LineIndex lineIndices01[] = { 0, 0, 0 };
321 bool isLineHit01[] = { false, false, false };
323 float visualY02[] = { -4.f, 3.f, 1000.f };
324 LineIndex lineIndices02[] = { 0, 0, 0 };
325 bool isLineHit02[] = { false, true, false };
327 float visualY03[] = { -4.f, 11.f, 30.f, 51.f, 68.f, 87.f, 109.f, 130.f };
328 LineIndex lineIndices03[] = { 0, 0, 1u, 2u, 3u, 4u, 5u, 5u };
329 bool isLineHit03[] = { false, true, true, true, true, true, true, false };
331 struct GetClosestLineData data[] =
351 "abcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuדאוvwxה"
352 "סתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuד"
353 "אוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqr"
354 "פרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmno"
355 "צמםpqrפרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjkl"
356 "חלךmnoצמםpqrפרףstuדאוvwxהסתyzטזץ",
363 const unsigned int numberOfTests = 3u;
365 for( unsigned int index = 0; index < numberOfTests; ++index )
367 ToolkitTestApplication application;
368 if( !GetClosestLineTest( data[index] ) )
370 tet_result(TET_FAIL);
374 tet_result(TET_PASS);
378 int UtcDaliGetClosestCursorIndex(void)
380 tet_infoline(" UtcDaliGetClosestCursorIndex");
382 float visualX01[] = { -100.f };
383 float visualY01[] = { -100.f };
384 CharacterHitTest::Mode mode01[] = { CharacterHitTest::TAP };
385 CharacterIndex logicalIndex01[] = { 0 };
386 bool isCharacterHit01[] = { false };
388 float visualX02[] = { -100.f, 1000.f, 60.f, 79.f, 83.f, 148.f, 99.f };
389 float visualY02[] = { -100.f, 1000.f, 12.f, 12.f, 12.f, 12.f, 12.f };
390 CharacterHitTest::Mode mode02[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
391 CharacterIndex logicalIndex02[] = { 0, 21u, 7u, 10u, 10u, 14u, 12u };
392 bool isCharacterHit02[] = { false, false, true, true, true, true, true };
394 float visualX03[] = { 19.f, 104.f, -2.f, 127.f };
395 float visualY03[] = { 12.f, 12.f, 12.f, 12.f };
396 CharacterHitTest::Mode mode03[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
397 CharacterIndex logicalIndex03[] = { 3u, 13u, 0, 18u };
398 bool isCharacterHit03[] = { true, true, false, false };
405 // different الأربعاء \n
406 float visualX04[] = { -100.f, 40.f, 44.f, 85.f, 500.f,
407 500.f, 367.f, 359.f, 329.f, -100.f,
408 -100.f, 19.f, 64.f, 72.f, 104.f, 111.f, 500.f};
409 float visualY04[] = { -100.f, 12.f, 12.f, 12.f, 12.f,
410 30.f, 30.f, 30.f, 30.f, 30.f,
411 50.f, 50.f, 50.f, 50.f, 50.f, 50.f, 50.f };
412 CharacterHitTest::Mode mode04[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
413 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
414 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
415 CharacterIndex logicalIndex04[] = { 0, 5u, 6u, 11u, 11u,
416 12u, 16u, 17u, 21u, 21u,
417 22u, 25u, 31u, 32u, 35u, 34u, 40u,
419 bool isCharacterHit04[] = { false, true, true, true, false,
420 false, true, true, true, false,
421 false, true, true, true, true, true, false };
424 // abcשנבdefג קכghiעיןjk lחלךmnoצמם pqrפרףstuד אוvwxה
426 // סתyz טזץabcשנבd efגקכghiעי ןjklחלךmno צמםpqrפרףstuד
427 // 93 100 110 120 130 139
428 // אוvwxהס תyzטזץabcש נבdefגקכgh iעיןjklחלך mnoצמםpqr
429 // 139 150 160 170 180 186
430 // פרףstuדאוvw xהסתyzטזץa bcשנבdefגק כghiעיןjkl חלךmno
431 // 186 190 200 210 220 233
432 // צמםp qrפרףstuדא וvwxהסתyzט זץabcשנבde fגקכghiעיןjkl
433 // 233 240 250 260 265
434 // חלךmnoצ מםpqrפרףst uדאוvwxהסת yzטזץ
436 float visualX05[] = { -100.f, 96.f, 155.f, 250.f, 344.f, 500.f,
437 -100.f, 36.f, 124.f, 190.f, 280.f, 500.f,
438 -100.f, 56.f, 158.f, 237.f, 303.f, 500.f,
439 -100.f, 98.f, 184.f, 261.f, 337.f, 500.f,
440 -100.f, 40.f, 113.f, 223.f, 302.f, 500.f,
441 -100.f, 82.f, 160.f, 253.f, 500.f };
442 float visualY05[] = { -100.f, 12.f, 12.f, 12.f, 12.f, 12.f,
443 30.f, 30.f, 30.f, 30.f, 30.f, 30.f,
444 50.f, 50.f, 50.f, 50.f, 50.f, 50.f,
445 67.f, 67.f, 67.f, 67.f, 67.f, 67.f,
446 87.f, 87.f, 87.f, 87.f, 87.f, 87.f,
447 107.f, 107.f, 107.f, 107.f, 107.f };
448 CharacterHitTest::Mode mode05[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
449 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
450 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
451 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
452 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
453 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
454 CharacterIndex logicalIndex05[] = { 0, 10u, 19u, 28u, 39u, 44u,
455 45u, 49u, 59u, 66u, 78u, 87u,
456 89u, 96u, 106u, 115u, 124u, 133u,
457 134u, 145u, 154u, 162u, 171u, 179u,
458 180u, 184u, 191u, 203u, 212u,
459 221u, 222u, 233u, 240u, 251u, 265u };
460 bool isCharacterHit05[] = { false, true, true, true, true, false,
461 false, true, true, true, true, false,
462 false, true, true, true, true, false,
463 false, true, true, true, true, false,
464 false, true, true, true, true, false,
465 false, true, true, true, false };
468 // שנבabcגקכd efעיןghiחל ךjklצמםmno פרףpqrדאוs tuהסתv
470 // wxטז ץyzשנבabcג קכdefעיןgh iחלךjklצמם mnoפרףpqrדאוs
471 // 93 100 110 120 130 139
472 // tuהסתvw xטזץyzשנבa bcגקכdefעי ןghiחלךjkl צמםmnoפרף
473 // 139 150 160 170 180 186
474 // pqrדאוstuהס תvwxטזץyzש נבabcגקכde fעיןghiחלך jklצמם
475 // 186 190 200 210 220 232
476 // mnoפ רףpqrדאוst uהסתvwxטזץ yzשנבabcגק כdefעיןghiחל
477 // 232 240 250 260 265
478 // ךjklצמםm noפרףpqrדא וstuהסתvwx טזץyz
480 float visualX06[] = { 500.f, 307.f, 237.f, 148.f, 55.f, -100.f,
481 500.f, 362.f, 276.f, 213.f, 121.f, -100.f,
482 500.f, 344.f, 238.f, 167.f, 93.f, -100.f,
483 500.f, 306.f, 216.f, 142.f, 58.f, -100.f,
484 500.f, 355.f, 279.f, 182.f, 92.f, -100.f,
485 500.f, 326.f, 238.f, 150.f, -100.f };
486 float visualY06[] = { -100.f, 12.f, 12.f, 12.f, 12.f, 12.f,
487 30.f, 30.f, 30.f, 30.f, 30.f, 30.f,
488 50.f, 50.f, 50.f, 50.f, 50.f, 50.f,
489 67.f, 67.f, 67.f, 67.f, 67.f, 67.f,
490 87.f, 87.f, 87.f, 87.f, 87.f, 87.f,
491 107.f, 107.f, 107.f, 107.f, 107.f };
492 CharacterHitTest::Mode mode06[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
493 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
494 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
495 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
496 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
497 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
498 CharacterIndex logicalIndex06[] = { 0, 10u, 19u, 28u, 39u, 44u,
499 45u, 48u, 57u, 65u, 78u, 87u,
500 89u, 96u, 107u, 114u, 124u, 133u,
501 134u, 144u, 154u, 162u, 171u, 178u,
502 179u, 185u, 192u, 203u, 212u, 221u,
503 222u, 232u, 240u, 251u, 265u };
504 bool isCharacterHit06[] = { false, true, true, true, true, false,
505 false, true, true, true, true, false,
506 false, true, true, true, true, false,
507 false, true, true, true, true, false,
508 false, true, true, true, true, false,
509 false, true, true, true, false };
511 float visualX07[] = { 395.f };
512 float visualY07[] = { 12.f };
513 CharacterHitTest::Mode mode07[] = { CharacterHitTest::TAP };
514 CharacterIndex logicalIndex07[] = { 1u };
515 bool isCharacterHit07[] = { true };
517 float visualX08[] = { 7.f };
518 float visualY08[] = { 12.f };
519 CharacterHitTest::Mode mode08[] = { CharacterHitTest::TAP };
520 CharacterIndex logicalIndex08[] = { 2u };
521 bool isCharacterHit08[] = { true };
523 struct GetClosestCursorIndexData data[] =
537 "Hello world שלום עולם",
546 "Single line with ligatures",
547 "different الأربعاء",
556 "Multiline. Single line paragraphs",
559 "different الأربعاء\n",
568 "Multiline. Single bidirectional paragraph, starts LTR, wrapped lines",
569 "abcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuדאוvwxה"
570 "סתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuד"
571 "אוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqr"
572 "פרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmno"
573 "צמםpqrפרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjkl"
574 "חלךmnoצמםpqrפרףstuדאוvwxהסתyzטזץ",
583 "Multiline. Single bidirectional paragraph, starts RTL, wrapped lines",
584 "שנבabcגקכdefעיןghiחלךjklצמםmnoפרףpqrדאוstuהסתv"
585 "wxטזץyzשנבabcגקכdefעיןghiחלךjklצמםmnoפרףpqrדאוs"
586 "tuהסתvwxטזץyzשנבabcגקכdefעיןghiחלךjklצמםmnoפרף"
587 "pqrדאוstuהסתvwxטזץyzשנבabcגקכdefעיןghiחלךjklצמם"
588 "mnoפרףpqrדאוstuהסתvwxטזץyzשנבabcגקכdefעיןghiחל"
589 "ךjklצמםmnoפרףpqrדאוstuהסתvwxטזץyz",
598 "Testing complex characters. Arabic ligatures",
599 "الأَبْجَدِيَّة العَرَبِيَّة",
608 "Testing complex characters. Latin ligatures",
618 const unsigned int numberOfTests = 8u;
620 for( unsigned int index = 0; index < numberOfTests; ++index )
622 ToolkitTestApplication application;
623 if( !GetClosestCursorIndexTest( data[index] ) )
625 tet_result(TET_FAIL);
629 tet_result(TET_PASS);
633 int UtcDaliGetCursorPosition(void)
635 tet_infoline(" UtcDaliGetCursorPosition");
637 float visualX08[] = { 4.f };
638 float visualY08[] = { 0.f };
639 CharacterIndex logicalIndex08[] = { 1u };
641 struct GetCursorPositionData data[] =
644 "Testing complex characters. Latin ligatures",
652 const unsigned int numberOfTests = 1u;
654 for( unsigned int index = 0; index < numberOfTests; ++index )
656 ToolkitTestApplication application;
657 if( !GetCursorPositionTest( data[index] ) )
659 tet_result(TET_FAIL);
663 tet_result(TET_PASS);
667 int UtcDaliFindSelectionIndices(void)
669 tet_infoline(" UtcDaliFindSelectionIndices");
671 float visualX01[] = { -100.f };
672 float visualY01[] = { -100.f };
673 bool found01[] = { false };
674 CharacterIndex startIndex01[] = { 0 };
675 CharacterIndex endIndex01[] = { 0 };
676 CharacterIndex noHitText01[] = { 0 };
678 float visualX02[] = { -100.f, 1000.f, 1000.f };
679 float visualY02[] = { -100.f, 12.f, 1000.f };
680 bool found02[] = { false, false, false };
681 CharacterIndex startIndex02[] = { 0, 6u, 6u };
682 CharacterIndex endIndex02[] = { 5u, 11u, 11u };
683 CharacterIndex noHitText02[] = { 0, 11u, 11u };
685 float visualX03[] = { 70.f };
686 float visualY03[] = { 12.f };
687 bool found03[] = { true };
688 CharacterIndex startIndex03[] = { 6u };
689 CharacterIndex endIndex03[] = { 11u };
690 CharacterIndex noHitText03[] = { 0u };
692 float visualX04[] = { 131.f };
693 float visualY04[] = { 12.f };
694 bool found04[] = { true };
695 CharacterIndex startIndex04[] = { 12u };
696 CharacterIndex endIndex04[] = { 16u };
697 CharacterIndex noHitText04[] = { 0u };
699 float visualX05[] = { 0.f };
700 float visualY05[] = { 12.f };
701 bool found05[] = { true };
702 CharacterIndex startIndex05[] = { 0 };
703 CharacterIndex endIndex05[] = { 1u };
704 CharacterIndex noHitText05[] = { 0 };
706 float visualX06[] = { 10.f };
707 float visualY06[] = { 12.f };
708 bool found06[] = { true };
709 CharacterIndex startIndex06[] = { 0 };
710 CharacterIndex endIndex06[] = { 1u };
711 CharacterIndex noHitText06[] = { 0u };
713 struct FindSelectionIndicesData data[] =
727 "touch out of text's boundaries",
749 "touch on the new paragraph character at the end of line",
750 "Hello world demo\n",
760 "touch on a white space character. is the unique character of the line",
771 "touch on a white space character. is between two words",
782 const unsigned int numberOfTests = 6u;
784 for( unsigned int index = 0; index < numberOfTests; ++index )
786 ToolkitTestApplication application;
787 if( !FindSelectionIndicesTest( data[index] ) )
789 tet_result(TET_FAIL);
793 tet_result(TET_PASS);