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,
117 for( unsigned int index = 0; index < data.numberOfTests; ++index )
119 bool isLineHit = false;
120 const LineIndex lineIndex = GetClosestLine( visualModel,
124 if( lineIndex != data.lineIndex[index] )
126 std::cout << " test " << index << " failed. Different line index : " << lineIndex << ", expected : " << data.lineIndex[index] << std::endl;
129 if( isLineHit != data.isLineHit[index] )
131 std::cout << " test " << index << " failed. Different line hit value : " << isLineHit << ", expected : " << data.isLineHit[index] << std::endl;
139 bool GetClosestCursorIndexTest( const GetClosestCursorIndexData& data )
141 std::cout << " testing : " << data.description << std::endl;
143 // 1) Create the model.
144 LogicalModelPtr logicalModel;
145 VisualModelPtr visualModel;
147 Size textArea(400.f, 600.f);
150 Vector<FontDescriptionRun> fontDescriptionRuns;
151 LayoutOptions options;
152 CreateTextModel( data.text,
161 for( unsigned int index = 0; index < data.numberOfTests; ++index )
163 bool isCharacterHit = false;
164 const CharacterIndex logicalCursorIndex = GetClosestCursorIndex( visualModel,
172 if( logicalCursorIndex != data.logicalIndex[index] )
174 std::cout << " test " << index << " failed. Different logical cursor index : " << logicalCursorIndex << ", expected : " << data.logicalIndex[index] << std::endl;
177 if( isCharacterHit != data.isCharacterHit[index] )
179 std::cout << " test " << index << " failed. Different character hit value : " << isCharacterHit << ", expected : " << data.isCharacterHit[index] << std::endl;
187 bool GetCursorPositionTest( const GetCursorPositionData& data )
189 std::cout << " testing : " << data.description << std::endl;
191 // 1) Create the model.
192 LogicalModelPtr logicalModel;
193 VisualModelPtr visualModel;
195 Size textArea(400.f, 600.f);
198 Vector<FontDescriptionRun> fontDescriptionRuns;
199 LayoutOptions options;
200 CreateTextModel( data.text,
209 for( unsigned int index = 0; index < data.numberOfTests; ++index )
211 CursorInfo cursorInfo;
212 GetCursorPosition( visualModel,
215 data.logicalIndex[index],
218 if( cursorInfo.primaryPosition.x != data.visualX[index] )
220 std::cout << " test " << index << " failed. Different 'x' cursor position : " << cursorInfo.primaryPosition.x << ", expected : " << data.visualX[index] << std::endl;
223 if( cursorInfo.primaryPosition.y != data.visualY[index] )
225 std::cout << " test " << index << " failed. Different 'y' cursor position : " << cursorInfo.primaryPosition.y << ", expected : " << data.visualY[index] << std::endl;
233 bool FindSelectionIndicesTest( const FindSelectionIndicesData& data )
235 std::cout << " testing : " << data.description << std::endl;
237 // 1) Create the model.
238 LogicalModelPtr logicalModel;
239 VisualModelPtr visualModel;
241 Size textArea(400.f, 600.f);
244 Vector<FontDescriptionRun> fontDescriptionRuns;
245 LayoutOptions options;
246 CreateTextModel( data.text,
255 for( unsigned int index = 0; index < data.numberOfTests; ++index )
257 CharacterIndex startIndex = 0;
258 CharacterIndex endIndex = 0;
259 CharacterIndex noTextHitIndex = 0;
260 const bool found = FindSelectionIndices( visualModel,
269 if( found != data.found[index] )
271 std::cout << " test " << index << " failed. Different found value : " << found << ", expected : " << data.found[index] << std::endl;
274 if( startIndex != data.startIndex[index] )
276 std::cout << " test " << index << " failed. Different start index : " << startIndex << ", expected : " << data.startIndex[index] << std::endl;
279 if( endIndex != data.endIndex[index] )
281 std::cout << " test " << index << " failed. Different end index : " << endIndex << ", expected : " << data.endIndex[index] << std::endl;
284 if( noTextHitIndex != data.noTextHitIndex[index] )
286 std::cout << " test " << index << " failed. Different no text hit index : " << noTextHitIndex << ", expected : " << data.noTextHitIndex[index] << std::endl;
295 //////////////////////////////////////////////////////////
297 // UtcDaliGetClosestLine
298 // UtcDaliGetClosestCursorIndex
300 //////////////////////////////////////////////////////////
302 int UtcDaliGetClosestLine(void)
304 tet_infoline(" UtcDaliGetClosestLine");
306 float visualY01[] = { -4.f, 3.f, 1000.f };
307 LineIndex lineIndices01[] = { 0, 0, 0 };
308 bool isLineHit01[] = { false, false, false };
310 float visualY02[] = { -4.f, 3.f, 1000.f };
311 LineIndex lineIndices02[] = { 0, 0, 0 };
312 bool isLineHit02[] = { false, true, false };
314 float visualY03[] = { -4.f, 11.f, 30.f, 51.f, 68.f, 87.f, 109.f, 130.f };
315 LineIndex lineIndices03[] = { 0, 0, 1u, 2u, 3u, 4u, 5u, 5u };
316 bool isLineHit03[] = { false, true, true, true, true, true, true, false };
318 struct GetClosestLineData data[] =
338 "abcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuדאוvwxה"
339 "סתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuד"
340 "אוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqr"
341 "פרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmno"
342 "צמםpqrפרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjkl"
343 "חלךmnoצמםpqrפרףstuדאוvwxהסתyzטזץ",
350 const unsigned int numberOfTests = 3u;
352 for( unsigned int index = 0; index < numberOfTests; ++index )
354 ToolkitTestApplication application;
355 if( !GetClosestLineTest( data[index] ) )
357 tet_result(TET_FAIL);
361 tet_result(TET_PASS);
365 int UtcDaliGetClosestCursorIndex(void)
367 tet_infoline(" UtcDaliGetClosestCursorIndex");
369 float visualX01[] = { -100.f };
370 float visualY01[] = { -100.f };
371 CharacterHitTest::Mode mode01[] = { CharacterHitTest::TAP };
372 CharacterIndex logicalIndex01[] = { 0 };
373 bool isCharacterHit01[] = { false };
375 float visualX02[] = { -100.f, 1000.f, 60.f, 79.f, 83.f, 148.f, 99.f };
376 float visualY02[] = { -100.f, 1000.f, 12.f, 12.f, 12.f, 12.f, 12.f };
377 CharacterHitTest::Mode mode02[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
378 CharacterIndex logicalIndex02[] = { 0, 21u, 7u, 10u, 11u, 13u, 20u };
379 bool isCharacterHit02[] = { false, false, true, true, true, true, true };
381 float visualX03[] = { 19.f, 104.f, -2.f, 127.f };
382 float visualY03[] = { 12.f, 12.f, 12.f, 12.f };
383 CharacterHitTest::Mode mode03[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
384 CharacterIndex logicalIndex03[] = { 3u, 12u, 0, 18u };
385 bool isCharacterHit03[] = { true, true, false, false };
392 // different الأربعاء \n
393 float visualX04[] = { -100.f, 40.f, 44.f, 85.f, 500.f,
394 500.f, 367.f, 359.f, 329.f, -100.f,
395 -100.f, 19.f, 64.f, 72.f, 104.f, 111.f, 500.f};
396 float visualY04[] = { -100.f, 12.f, 12.f, 12.f, 12.f,
397 30.f, 30.f, 30.f, 30.f, 30.f,
398 50.f, 50.f, 50.f, 50.f, 50.f, 50.f, 50.f };
399 CharacterHitTest::Mode mode04[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
400 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
401 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
402 CharacterIndex logicalIndex04[] = { 0, 5u, 6u, 11u, 11u,
403 12u, 16u, 17u, 21u, 21u,
404 22u, 25u, 31u, 32u, 34u, 40u, 40u,
406 bool isCharacterHit04[] = { false, true, true, false, false,
407 false, true, true, true, false,
408 false, true, true, true, true, true, false };
411 // abcשנבdefג קכghiעיןjk lחלךmnoצמם pqrפרףstuד אוvwxה
413 // סתyz טזץabcשנבd efגקכghiעי ןjklחלךmno צמםpqrפרףstuד
414 // 93 100 110 120 130 139
415 // אוvwxהס תyzטזץabcש נבdefגקכgh iעיןjklחלך mnoצמםpqr
416 // 139 150 160 170 180 186
417 // פרףstuדאוvw xהסתyzטזץa bcשנבdefגק כghiעיןjkl חלךmno
418 // 186 190 200 210 220 233
419 // צמםp qrפרףstuדא וvwxהסתyzט זץabcשנבde fגקכghiעיןjkl
420 // 233 240 250 260 265
421 // חלךmnoצ מםpqrפרףst uדאוvwxהסת yzטזץ
423 float visualX05[] = { -100.f, 96.f, 155.f, 250.f, 344.f, 500.f,
424 -100.f, 36.f, 124.f, 190.f, 280.f, 500.f,
425 -100.f, 56.f, 158.f, 237.f, 303.f, 500.f,
426 -100.f, 98.f, 184.f, 261.f, 337.f, 500.f,
427 -100.f, 40.f, 113.f, 223.f, 302.f, 500.f,
428 -100.f, 82.f, 160.f, 253.f, 500.f };
429 float visualY05[] = { -100.f, 12.f, 12.f, 12.f, 12.f, 12.f,
430 30.f, 30.f, 30.f, 30.f, 30.f, 30.f,
431 50.f, 50.f, 50.f, 50.f, 50.f, 50.f,
432 67.f, 67.f, 67.f, 67.f, 67.f, 67.f,
433 87.f, 87.f, 87.f, 87.f, 87.f, 87.f,
434 107.f, 107.f, 107.f, 107.f, 107.f };
435 CharacterHitTest::Mode mode05[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
436 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
437 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
438 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
439 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
440 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
441 CharacterIndex logicalIndex05[] = { 0, 10u, 20u, 30u, 40u, 45u,
442 46u, 50u, 60u, 70u, 80u, 92u,
443 93u, 100u, 110u, 120u, 130u, 138u,
444 139u, 150u, 160u, 170u, 180u, 185u,
445 186u, 190u, 200u, 210u, 220u, 232u,
446 233u, 240u, 250u, 260u, 265u };
447 bool isCharacterHit05[] = { false, true, true, true, true, false,
448 false, true, true, true, true, false,
449 false, true, true, true, true, false,
450 false, true, true, true, true, false,
451 false, true, true, true, true, false,
452 false, true, true, true, false };
455 // שנבabcגקכd efעיןghiחל ךjklצמםmno פרףpqrדאוs tuהסתv
457 // wxטז ץyzשנבabcג קכdefעיןgh iחלךjklצמם mnoפרףpqrדאוs
458 // 93 100 110 120 130 139
459 // tuהסתvw xטזץyzשנבa bcגקכdefעי ןghiחלךjkl צמםmnoפרף
460 // 139 150 160 170 180 186
461 // pqrדאוstuהס תvwxטזץyzש נבabcגקכde fעיןghiחלך jklצמם
462 // 186 190 200 210 220 232
463 // mnoפ רףpqrדאוst uהסתvwxטזץ yzשנבabcגק כdefעיןghiחל
464 // 232 240 250 260 265
465 // ךjklצמםm noפרףpqrדא וstuהסתvwx טזץyz
467 float visualX06[] = { 500.f, 307.f, 237.f, 148.f, 55.f, -100.f,
468 500.f, 362.f, 276.f, 213.f, 121.f, -100.f,
469 500.f, 344.f, 238.f, 167.f, 93.f, -100.f,
470 500.f, 306.f, 216.f, 142.f, 58.f, -100.f,
471 500.f, 355.f, 279.f, 182.f, 92.f, -100.f,
472 500.f, 326.f, 238.f, 150.f, -100.f };
473 float visualY06[] = { -100.f, 12.f, 12.f, 12.f, 12.f, 12.f,
474 30.f, 30.f, 30.f, 30.f, 30.f, 30.f,
475 50.f, 50.f, 50.f, 50.f, 50.f, 50.f,
476 67.f, 67.f, 67.f, 67.f, 67.f, 67.f,
477 87.f, 87.f, 87.f, 87.f, 87.f, 87.f,
478 107.f, 107.f, 107.f, 107.f, 107.f };
479 CharacterHitTest::Mode mode06[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
480 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
481 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
482 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
483 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
484 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
485 CharacterIndex logicalIndex06[] = { 0, 10u, 20u, 30u, 40u, 45u,
486 46u, 50u, 60u, 70u, 80u, 92u,
487 93u, 100u, 110u, 120u, 130u, 138u,
488 139u, 150u, 160u, 170u, 180u, 185u,
489 186u, 190u, 200u, 210u, 220u, 231u,
490 232u, 240u, 250u, 260u, 265u };
491 bool isCharacterHit06[] = { false, true, true, true, true, false,
492 false, true, true, true, true, false,
493 false, true, true, true, true, false,
494 false, true, true, true, true, false,
495 false, true, true, true, true, false,
496 false, true, true, true, false };
498 float visualX07[] = { 395.f };
499 float visualY07[] = { 12.f };
500 CharacterHitTest::Mode mode07[] = { CharacterHitTest::TAP };
501 CharacterIndex logicalIndex07[] = { 1u };
502 bool isCharacterHit07[] = { true };
504 float visualX08[] = { 7.f };
505 float visualY08[] = { 12.f };
506 CharacterHitTest::Mode mode08[] = { CharacterHitTest::TAP };
507 CharacterIndex logicalIndex08[] = { 1u };
508 bool isCharacterHit08[] = { true };
510 struct GetClosestCursorIndexData data[] =
524 "Hello world שלום עולם",
533 "Single line with ligatures",
534 "different الأربعاء",
543 "Multiline. Single line paragraphs",
546 "different الأربعاء\n",
555 "Multiline. Single bidirectional paragraph, starts LTR, wrapped lines",
556 "abcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuדאוvwxה"
557 "סתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuד"
558 "אוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqr"
559 "פרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmno"
560 "צמםpqrפרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjkl"
561 "חלךmnoצמםpqrפרףstuדאוvwxהסתyzטזץ",
570 "Multiline. Single bidirectional paragraph, starts RTL, wrapped lines",
571 "שנבabcגקכdefעיןghiחלךjklצמםmnoפרףpqrדאוstuהסתv"
572 "wxטזץyzשנבabcגקכdefעיןghiחלךjklצמםmnoפרףpqrדאוs"
573 "tuהסתvwxטזץyzשנבabcגקכdefעיןghiחלךjklצמםmnoפרף"
574 "pqrדאוstuהסתvwxטזץyzשנבabcגקכdefעיןghiחלךjklצמם"
575 "mnoפרףpqrדאוstuהסתvwxטזץyzשנבabcגקכdefעיןghiחל"
576 "ךjklצמםmnoפרףpqrדאוstuהסתvwxטזץyz",
585 "Testing complex characters. Arabic ligatures",
586 "الأَبْجَدِيَّة العَرَبِيَّة",
595 "Testing complex characters. Latin ligatures",
605 const unsigned int numberOfTests = 8u;
607 for( unsigned int index = 0; index < numberOfTests; ++index )
609 ToolkitTestApplication application;
610 if( !GetClosestCursorIndexTest( data[index] ) )
612 tet_result(TET_FAIL);
616 tet_result(TET_PASS);
620 int UtcDaliGetCursorPosition(void)
622 tet_infoline(" UtcDaliGetCursorPosition");
624 float visualX08[] = { 5.f };
625 float visualY08[] = { 0.f };
626 CharacterIndex logicalIndex08[] = { 1u };
628 struct GetCursorPositionData data[] =
631 "Testing complex characters. Latin ligatures",
639 const unsigned int numberOfTests = 1u;
641 for( unsigned int index = 0; index < numberOfTests; ++index )
643 ToolkitTestApplication application;
644 if( !GetCursorPositionTest( data[index] ) )
646 tet_result(TET_FAIL);
650 tet_result(TET_PASS);
654 int UtcDaliFindSelectionIndices(void)
656 tet_infoline(" UtcDaliFindSelectionIndices");
658 float visualX01[] = { -100.f };
659 float visualY01[] = { -100.f };
660 bool found01[] = { false };
661 CharacterIndex startIndex01[] = { 0 };
662 CharacterIndex endIndex01[] = { 0 };
663 CharacterIndex noHitText01[] = { 0 };
665 float visualX02[] = { -100.f, 1000.f, 1000.f };
666 float visualY02[] = { -100.f, 12.f, 1000.f };
667 bool found02[] = { false, false, false };
668 CharacterIndex startIndex02[] = { 0, 6u, 6u };
669 CharacterIndex endIndex02[] = { 5u, 11u, 11u };
670 CharacterIndex noHitText02[] = { 0, 11u, 11u };
672 float visualX03[] = { 70.f };
673 float visualY03[] = { 12.f };
674 bool found03[] = { true };
675 CharacterIndex startIndex03[] = { 6u };
676 CharacterIndex endIndex03[] = { 11u };
677 CharacterIndex noHitText03[] = { 0u };
679 float visualX04[] = { 132.f };
680 float visualY04[] = { 12.f };
681 bool found04[] = { true };
682 CharacterIndex startIndex04[] = { 12u };
683 CharacterIndex endIndex04[] = { 16u };
684 CharacterIndex noHitText04[] = { 0u };
686 float visualX05[] = { 1.f };
687 float visualY05[] = { 12.f };
688 bool found05[] = { true };
689 CharacterIndex startIndex05[] = { 0 };
690 CharacterIndex endIndex05[] = { 1u };
691 CharacterIndex noHitText05[] = { 0 };
693 float visualX06[] = { 10.f };
694 float visualY06[] = { 12.f };
695 bool found06[] = { true };
696 CharacterIndex startIndex06[] = { 0 };
697 CharacterIndex endIndex06[] = { 1u };
698 CharacterIndex noHitText06[] = { 0u };
700 struct FindSelectionIndicesData data[] =
714 "touch out of text's boundaries",
736 "touch on the new paragraph character at the end of line",
737 "Hello world demo\n",
747 "touch on a white space character. is the unique character of the line",
758 "touch on a white space character. is between two words",
769 const unsigned int numberOfTests = 6u;
771 for( unsigned int index = 0; index < numberOfTests; ++index )
773 ToolkitTestApplication application;
774 if( !FindSelectionIndicesTest( data[index] ) )
776 tet_result(TET_FAIL);
780 tet_result(TET_PASS);