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.
100 LogicalModelPtr logicalModel;
101 VisualModelPtr visualModel;
103 Size textArea(400.f, 600.f);
106 Vector<FontDescriptionRun> fontDescriptionRuns;
107 LayoutOptions options;
108 CreateTextModel( data.text,
118 for( unsigned int index = 0; index < data.numberOfTests; ++index )
120 bool isLineHit = false;
121 const LineIndex lineIndex = GetClosestLine( visualModel,
125 if( lineIndex != data.lineIndex[index] )
127 std::cout << " test " << index << " failed. Different line index : " << lineIndex << ", expected : " << data.lineIndex[index] << std::endl;
130 if( isLineHit != data.isLineHit[index] )
132 std::cout << " test " << index << " failed. Different line hit value : " << isLineHit << ", expected : " << data.isLineHit[index] << std::endl;
140 bool GetClosestCursorIndexTest( const GetClosestCursorIndexData& data )
142 std::cout << " testing : " << data.description << std::endl;
144 // 1) Create the model.
145 LogicalModelPtr logicalModel;
146 VisualModelPtr visualModel;
148 Size textArea(400.f, 600.f);
151 Vector<FontDescriptionRun> fontDescriptionRuns;
152 LayoutOptions options;
153 CreateTextModel( data.text,
163 for( unsigned int index = 0; index < data.numberOfTests; ++index )
165 bool isCharacterHit = false;
166 const CharacterIndex logicalCursorIndex = GetClosestCursorIndex( visualModel,
174 if( logicalCursorIndex != data.logicalIndex[index] )
176 std::cout << " test " << index << " failed. Different logical cursor index : " << logicalCursorIndex << ", expected : " << data.logicalIndex[index] << std::endl;
179 if( isCharacterHit != data.isCharacterHit[index] )
181 std::cout << " test " << index << " failed. Different character hit value : " << isCharacterHit << ", expected : " << data.isCharacterHit[index] << std::endl;
189 bool GetCursorPositionTest( const GetCursorPositionData& data )
191 std::cout << " testing : " << data.description << std::endl;
193 // 1) Create the model.
194 LogicalModelPtr logicalModel;
195 VisualModelPtr visualModel;
197 Size textArea(400.f, 600.f);
200 Vector<FontDescriptionRun> fontDescriptionRuns;
201 LayoutOptions options;
202 CreateTextModel( data.text,
212 GetCursorPositionParameters parameters;
213 parameters.visualModel = visualModel;
214 parameters.logicalModel = logicalModel;
215 parameters.metrics = metrics;
216 parameters.isMultiline = true;
218 for( unsigned int index = 0; index < data.numberOfTests; ++index )
220 CursorInfo cursorInfo;
221 parameters.logical = data.logicalIndex[index];
223 GetCursorPosition( parameters,
226 if( cursorInfo.primaryPosition.x != data.visualX[index] )
228 std::cout << " test " << index << " failed. Different 'x' cursor position : " << cursorInfo.primaryPosition.x << ", expected : " << data.visualX[index] << std::endl;
231 if( cursorInfo.primaryPosition.y != data.visualY[index] )
233 std::cout << " test " << index << " failed. Different 'y' cursor position : " << cursorInfo.primaryPosition.y << ", expected : " << data.visualY[index] << std::endl;
241 bool FindSelectionIndicesTest( const FindSelectionIndicesData& data )
243 std::cout << " testing : " << data.description << std::endl;
245 // 1) Create the model.
246 LogicalModelPtr logicalModel;
247 VisualModelPtr visualModel;
249 Size textArea(400.f, 600.f);
252 Vector<FontDescriptionRun> fontDescriptionRuns;
253 LayoutOptions options;
254 CreateTextModel( data.text,
264 for( unsigned int index = 0; index < data.numberOfTests; ++index )
266 CharacterIndex startIndex = 0;
267 CharacterIndex endIndex = 0;
268 CharacterIndex noTextHitIndex = 0;
269 const bool found = FindSelectionIndices( visualModel,
278 if( found != data.found[index] )
280 std::cout << " test " << index << " failed. Different found value : " << found << ", expected : " << data.found[index] << std::endl;
283 if( startIndex != data.startIndex[index] )
285 std::cout << " test " << index << " failed. Different start index : " << startIndex << ", expected : " << data.startIndex[index] << std::endl;
288 if( endIndex != data.endIndex[index] )
290 std::cout << " test " << index << " failed. Different end index : " << endIndex << ", expected : " << data.endIndex[index] << std::endl;
293 if( noTextHitIndex != data.noTextHitIndex[index] )
295 std::cout << " test " << index << " failed. Different no text hit index : " << noTextHitIndex << ", expected : " << data.noTextHitIndex[index] << std::endl;
304 //////////////////////////////////////////////////////////
306 // UtcDaliGetClosestLine
307 // UtcDaliGetClosestCursorIndex
309 //////////////////////////////////////////////////////////
311 int UtcDaliGetClosestLine(void)
313 tet_infoline(" UtcDaliGetClosestLine");
315 float visualY01[] = { -4.f, 3.f, 1000.f };
316 LineIndex lineIndices01[] = { 0, 0, 0 };
317 bool isLineHit01[] = { false, false, false };
319 float visualY02[] = { -4.f, 3.f, 1000.f };
320 LineIndex lineIndices02[] = { 0, 0, 0 };
321 bool isLineHit02[] = { false, true, false };
323 float visualY03[] = { -4.f, 11.f, 30.f, 51.f, 68.f, 87.f, 109.f, 130.f };
324 LineIndex lineIndices03[] = { 0, 0, 1u, 2u, 3u, 4u, 5u, 5u };
325 bool isLineHit03[] = { false, true, true, true, true, true, true, false };
327 struct GetClosestLineData data[] =
347 "abcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuדאוvwxה"
348 "סתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuד"
349 "אוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqr"
350 "פרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmno"
351 "צמםpqrפרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjkl"
352 "חלךmnoצמםpqrפרףstuדאוvwxהסתyzטזץ",
359 const unsigned int numberOfTests = 3u;
361 for( unsigned int index = 0; index < numberOfTests; ++index )
363 ToolkitTestApplication application;
364 if( !GetClosestLineTest( data[index] ) )
366 tet_result(TET_FAIL);
370 tet_result(TET_PASS);
374 int UtcDaliGetClosestCursorIndex(void)
376 tet_infoline(" UtcDaliGetClosestCursorIndex");
378 float visualX01[] = { -100.f };
379 float visualY01[] = { -100.f };
380 CharacterHitTest::Mode mode01[] = { CharacterHitTest::TAP };
381 CharacterIndex logicalIndex01[] = { 0 };
382 bool isCharacterHit01[] = { false };
384 float visualX02[] = { -100.f, 1000.f, 60.f, 79.f, 83.f, 148.f, 99.f };
385 float visualY02[] = { -100.f, 1000.f, 12.f, 12.f, 12.f, 12.f, 12.f };
386 CharacterHitTest::Mode mode02[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
387 CharacterIndex logicalIndex02[] = { 0, 21u, 8u, 11u, 11u, 13u, 20u };
388 bool isCharacterHit02[] = { false, false, true, true, true, true, true };
390 float visualX03[] = { 19.f, 104.f, -2.f, 127.f };
391 float visualY03[] = { 12.f, 12.f, 12.f, 12.f };
392 CharacterHitTest::Mode mode03[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
393 CharacterIndex logicalIndex03[] = { 3u, 12u, 0, 18u };
394 bool isCharacterHit03[] = { true, true, false, false };
401 // different الأربعاء \n
402 float visualX04[] = { -100.f, 40.f, 44.f, 85.f, 500.f,
403 500.f, 367.f, 359.f, 329.f, -100.f,
404 -100.f, 19.f, 64.f, 72.f, 104.f, 111.f, 500.f};
405 float visualY04[] = { -100.f, 12.f, 12.f, 12.f, 12.f,
406 30.f, 30.f, 30.f, 30.f, 30.f,
407 50.f, 50.f, 50.f, 50.f, 50.f, 50.f, 50.f };
408 CharacterHitTest::Mode mode04[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
409 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
410 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
411 CharacterIndex logicalIndex04[] = { 0, 6u, 6u, 11u, 11u,
412 12u, 16u, 17u, 21u, 21u,
413 22u, 25u, 31u, 32u, 34u, 40u, 40u,
415 bool isCharacterHit04[] = { false, true, true, false, false,
416 false, true, true, false, false,
417 false, true, true, true, true, false, false };
420 // abcשנבdefג קכghiעיןjk lחלךmnoצמם pqrפרףstuד אוvwxה
422 // סתyz טזץabcשנבd efגקכghiעי ןjklחלךmno צמםpqrפרףstuד
423 // 93 100 110 120 130 139
424 // אוvwxהס תyzטזץabcש נבdefגקכgh iעיןjklחלך mnoצמםpqr
425 // 139 150 160 170 180 186
426 // פרףstuדאוvw xהסתyzטזץa bcשנבdefגק כghiעיןjkl חלךmno
427 // 186 190 200 210 220 233
428 // צמםp qrפרףstuדא וvwxהסתyzט זץabcשנבde fגקכghiעיןjkl
429 // 233 240 250 260 265
430 // חלךmnoצ מםpqrפרףst uדאוvwxהסת yzטזץ
432 float visualX05[] = { -100.f, 96.f, 155.f, 250.f, 344.f, 500.f,
433 -100.f, 36.f, 124.f, 190.f, 280.f, 500.f,
434 -100.f, 56.f, 158.f, 237.f, 303.f, 500.f,
435 -100.f, 98.f, 184.f, 261.f, 337.f, 500.f,
436 -100.f, 40.f, 113.f, 223.f, 302.f, 500.f,
437 -100.f, 82.f, 160.f, 253.f, 500.f };
438 float visualY05[] = { -100.f, 12.f, 12.f, 12.f, 12.f, 12.f,
439 30.f, 30.f, 30.f, 30.f, 30.f, 30.f,
440 50.f, 50.f, 50.f, 50.f, 50.f, 50.f,
441 67.f, 67.f, 67.f, 67.f, 67.f, 67.f,
442 87.f, 87.f, 87.f, 87.f, 87.f, 87.f,
443 107.f, 107.f, 107.f, 107.f, 107.f };
444 CharacterHitTest::Mode mode05[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
445 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
446 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
447 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
448 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
449 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
450 CharacterIndex logicalIndex05[] = { 0, 10u, 20u, 30u, 40u, 46u,
451 47u, 52u, 62u, 71u, 82u, 93u,
452 95u, 99u, 112u, 122u, 131u, 140u,
453 141u, 153u, 162u, 171u, 181u, 187u,
454 188u, 194u, 201u, 213u, 222u, 234u,
455 236u, 244u, 254u, 263u, 265u };
456 bool isCharacterHit05[] = { false, true, true, true, true, false,
457 false, true, true, true, true, false,
458 false, true, true, true, true, false,
459 false, true, true, true, true, false,
460 false, true, true, true, true, false,
461 false, true, true, true, false };
464 // שנבabcגקכd efעיןghiחל ךjklצמםmno פרףpqrדאוs tuהסתv
466 // wxטז ץyzשנבabcג קכdefעיןgh iחלךjklצמם mnoפרףpqrדאוs
467 // 93 100 110 120 130 139
468 // tuהסתvw xטזץyzשנבa bcגקכdefעי ןghiחלךjkl צמםmnoפרף
469 // 139 150 160 170 180 186
470 // pqrדאוstuהס תvwxטזץyzש נבabcגקכde fעיןghiחלך jklצמם
471 // 186 190 200 210 220 232
472 // mnoפ רףpqrדאוst uהסתvwxטזץ yzשנבabcגק כdefעיןghiחל
473 // 232 240 250 260 265
474 // ךjklצמםm noפרףpqrדא וstuהסתvwx טזץyz
476 float visualX06[] = { 500.f, 307.f, 237.f, 148.f, 55.f, -100.f,
477 500.f, 362.f, 276.f, 213.f, 121.f, -100.f,
478 500.f, 344.f, 238.f, 167.f, 93.f, -100.f,
479 500.f, 306.f, 216.f, 142.f, 58.f, -100.f,
480 500.f, 355.f, 279.f, 182.f, 92.f, -100.f,
481 500.f, 326.f, 238.f, 150.f, -100.f };
482 float visualY06[] = { -100.f, 12.f, 12.f, 12.f, 12.f, 12.f,
483 30.f, 30.f, 30.f, 30.f, 30.f, 30.f,
484 50.f, 50.f, 50.f, 50.f, 50.f, 50.f,
485 67.f, 67.f, 67.f, 67.f, 67.f, 67.f,
486 87.f, 87.f, 87.f, 87.f, 87.f, 87.f,
487 107.f, 107.f, 107.f, 107.f, 107.f };
488 CharacterHitTest::Mode mode06[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
489 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
490 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
491 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
492 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
493 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
494 CharacterIndex logicalIndex06[] = { 0, 10u, 20u, 30u, 40u, 45u,
495 46u, 50u, 60u, 70u, 80u, 92u,
496 93u, 100u, 110u, 121u, 131u, 138u,
497 139u, 150u, 160u, 170u, 180u, 185u,
498 186u, 190u, 200u, 210u, 220u, 231u,
499 232u, 240u, 250u, 260u, 265u };
500 bool isCharacterHit06[] = { false, true, true, true, true, false,
501 false, true, true, true, true, false,
502 false, true, true, true, true, false,
503 false, true, true, true, true, false,
504 false, true, true, true, true, false,
505 false, true, true, true, false };
507 float visualX07[] = { 395.f };
508 float visualY07[] = { 12.f };
509 CharacterHitTest::Mode mode07[] = { CharacterHitTest::TAP };
510 CharacterIndex logicalIndex07[] = { 1u };
511 bool isCharacterHit07[] = { true };
513 float visualX08[] = { 7.f };
514 float visualY08[] = { 12.f };
515 CharacterHitTest::Mode mode08[] = { CharacterHitTest::TAP };
516 CharacterIndex logicalIndex08[] = { 2u };
517 bool isCharacterHit08[] = { true };
519 struct GetClosestCursorIndexData data[] =
533 "Hello world שלום עולם",
542 "Single line with ligatures",
543 "different الأربعاء",
552 "Multiline. Single line paragraphs",
555 "different الأربعاء\n",
564 "Multiline. Single bidirectional paragraph, starts LTR, wrapped lines",
565 "abcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuדאוvwxה"
566 "סתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuד"
567 "אוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqr"
568 "פרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmno"
569 "צמםpqrפרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjkl"
570 "חלךmnoצמםpqrפרףstuדאוvwxהסתyzטזץ",
579 "Multiline. Single bidirectional paragraph, starts RTL, wrapped lines",
580 "שנבabcגקכdefעיןghiחלךjklצמםmnoפרףpqrדאוstuהסתv"
581 "wxטזץyzשנבabcגקכdefעיןghiחלךjklצמםmnoפרףpqrדאוs"
582 "tuהסתvwxטזץyzשנבabcגקכdefעיןghiחלךjklצמםmnoפרף"
583 "pqrדאוstuהסתvwxטזץyzשנבabcגקכdefעיןghiחלךjklצמם"
584 "mnoפרףpqrדאוstuהסתvwxטזץyzשנבabcגקכdefעיןghiחל"
585 "ךjklצמםmnoפרףpqrדאוstuהסתvwxטזץyz",
594 "Testing complex characters. Arabic ligatures",
595 "الأَبْجَدِيَّة العَرَبِيَّة",
604 "Testing complex characters. Latin ligatures",
614 const unsigned int numberOfTests = 8u;
616 for( unsigned int index = 0; index < numberOfTests; ++index )
618 ToolkitTestApplication application;
619 if( !GetClosestCursorIndexTest( data[index] ) )
621 tet_result(TET_FAIL);
625 tet_result(TET_PASS);
629 int UtcDaliGetCursorPosition(void)
631 tet_infoline(" UtcDaliGetCursorPosition");
633 float visualX08[] = { 4.f };
634 float visualY08[] = { 0.f };
635 CharacterIndex logicalIndex08[] = { 1u };
637 struct GetCursorPositionData data[] =
640 "Testing complex characters. Latin ligatures",
648 const unsigned int numberOfTests = 1u;
650 for( unsigned int index = 0; index < numberOfTests; ++index )
652 ToolkitTestApplication application;
653 if( !GetCursorPositionTest( data[index] ) )
655 tet_result(TET_FAIL);
659 tet_result(TET_PASS);
663 int UtcDaliFindSelectionIndices(void)
665 tet_infoline(" UtcDaliFindSelectionIndices");
667 float visualX01[] = { -100.f };
668 float visualY01[] = { -100.f };
669 bool found01[] = { false };
670 CharacterIndex startIndex01[] = { 0 };
671 CharacterIndex endIndex01[] = { 0 };
672 CharacterIndex noHitText01[] = { 0 };
674 float visualX02[] = { -100.f, 1000.f, 1000.f };
675 float visualY02[] = { -100.f, 12.f, 1000.f };
676 bool found02[] = { false, false, false };
677 CharacterIndex startIndex02[] = { 0, 6u, 6u };
678 CharacterIndex endIndex02[] = { 5u, 11u, 11u };
679 CharacterIndex noHitText02[] = { 0, 11u, 11u };
681 float visualX03[] = { 70.f };
682 float visualY03[] = { 12.f };
683 bool found03[] = { true };
684 CharacterIndex startIndex03[] = { 6u };
685 CharacterIndex endIndex03[] = { 11u };
686 CharacterIndex noHitText03[] = { 0u };
688 float visualX04[] = { 131.f };
689 float visualY04[] = { 12.f };
690 bool found04[] = { true };
691 CharacterIndex startIndex04[] = { 12u };
692 CharacterIndex endIndex04[] = { 16u };
693 CharacterIndex noHitText04[] = { 0u };
695 float visualX05[] = { 0.f };
696 float visualY05[] = { 12.f };
697 bool found05[] = { true };
698 CharacterIndex startIndex05[] = { 0 };
699 CharacterIndex endIndex05[] = { 1u };
700 CharacterIndex noHitText05[] = { 0 };
702 float visualX06[] = { 10.f };
703 float visualY06[] = { 12.f };
704 bool found06[] = { true };
705 CharacterIndex startIndex06[] = { 0 };
706 CharacterIndex endIndex06[] = { 1u };
707 CharacterIndex noHitText06[] = { 0u };
709 struct FindSelectionIndicesData data[] =
723 "touch out of text's boundaries",
745 "touch on the new paragraph character at the end of line",
746 "Hello world demo\n",
756 "touch on a white space character. is the unique character of the line",
767 "touch on a white space character. is between two words",
778 const unsigned int numberOfTests = 6u;
780 for( unsigned int index = 0; index < numberOfTests; ++index )
782 ToolkitTestApplication application;
783 if( !FindSelectionIndicesTest( data[index] ) )
785 tet_result(TET_FAIL);
789 tet_result(TET_PASS);