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 GetCursorPositionParameters parameters;
210 parameters.visualModel = visualModel;
211 parameters.logicalModel = logicalModel;
212 parameters.metrics = metrics;
213 parameters.isMultiline = true;
215 for( unsigned int index = 0; index < data.numberOfTests; ++index )
217 CursorInfo cursorInfo;
218 parameters.logical = data.logicalIndex[index];
220 GetCursorPosition( parameters,
223 if( cursorInfo.primaryPosition.x != data.visualX[index] )
225 std::cout << " test " << index << " failed. Different 'x' cursor position : " << cursorInfo.primaryPosition.x << ", expected : " << data.visualX[index] << std::endl;
228 if( cursorInfo.primaryPosition.y != data.visualY[index] )
230 std::cout << " test " << index << " failed. Different 'y' cursor position : " << cursorInfo.primaryPosition.y << ", expected : " << data.visualY[index] << std::endl;
238 bool FindSelectionIndicesTest( const FindSelectionIndicesData& data )
240 std::cout << " testing : " << data.description << std::endl;
242 // 1) Create the model.
243 LogicalModelPtr logicalModel;
244 VisualModelPtr visualModel;
246 Size textArea(400.f, 600.f);
249 Vector<FontDescriptionRun> fontDescriptionRuns;
250 LayoutOptions options;
251 CreateTextModel( data.text,
260 for( unsigned int index = 0; index < data.numberOfTests; ++index )
262 CharacterIndex startIndex = 0;
263 CharacterIndex endIndex = 0;
264 CharacterIndex noTextHitIndex = 0;
265 const bool found = FindSelectionIndices( visualModel,
274 if( found != data.found[index] )
276 std::cout << " test " << index << " failed. Different found value : " << found << ", expected : " << data.found[index] << std::endl;
279 if( startIndex != data.startIndex[index] )
281 std::cout << " test " << index << " failed. Different start index : " << startIndex << ", expected : " << data.startIndex[index] << std::endl;
284 if( endIndex != data.endIndex[index] )
286 std::cout << " test " << index << " failed. Different end index : " << endIndex << ", expected : " << data.endIndex[index] << std::endl;
289 if( noTextHitIndex != data.noTextHitIndex[index] )
291 std::cout << " test " << index << " failed. Different no text hit index : " << noTextHitIndex << ", expected : " << data.noTextHitIndex[index] << std::endl;
300 //////////////////////////////////////////////////////////
302 // UtcDaliGetClosestLine
303 // UtcDaliGetClosestCursorIndex
305 //////////////////////////////////////////////////////////
307 int UtcDaliGetClosestLine(void)
309 tet_infoline(" UtcDaliGetClosestLine");
311 float visualY01[] = { -4.f, 3.f, 1000.f };
312 LineIndex lineIndices01[] = { 0, 0, 0 };
313 bool isLineHit01[] = { false, false, false };
315 float visualY02[] = { -4.f, 3.f, 1000.f };
316 LineIndex lineIndices02[] = { 0, 0, 0 };
317 bool isLineHit02[] = { false, true, false };
319 float visualY03[] = { -4.f, 11.f, 30.f, 51.f, 68.f, 87.f, 109.f, 130.f };
320 LineIndex lineIndices03[] = { 0, 0, 1u, 2u, 3u, 4u, 5u, 5u };
321 bool isLineHit03[] = { false, true, true, true, true, true, true, false };
323 struct GetClosestLineData data[] =
343 "abcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuדאוvwxה"
344 "סתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuד"
345 "אוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqr"
346 "פרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmno"
347 "צמםpqrפרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjkl"
348 "חלךmnoצמםpqrפרףstuדאוvwxהסתyzטזץ",
355 const unsigned int numberOfTests = 3u;
357 for( unsigned int index = 0; index < numberOfTests; ++index )
359 ToolkitTestApplication application;
360 if( !GetClosestLineTest( data[index] ) )
362 tet_result(TET_FAIL);
366 tet_result(TET_PASS);
370 int UtcDaliGetClosestCursorIndex(void)
372 tet_infoline(" UtcDaliGetClosestCursorIndex");
374 float visualX01[] = { -100.f };
375 float visualY01[] = { -100.f };
376 CharacterHitTest::Mode mode01[] = { CharacterHitTest::TAP };
377 CharacterIndex logicalIndex01[] = { 0 };
378 bool isCharacterHit01[] = { false };
380 float visualX02[] = { -100.f, 1000.f, 60.f, 79.f, 83.f, 148.f, 99.f };
381 float visualY02[] = { -100.f, 1000.f, 12.f, 12.f, 12.f, 12.f, 12.f };
382 CharacterHitTest::Mode mode02[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
383 CharacterIndex logicalIndex02[] = { 0, 21u, 7u, 10u, 11u, 13u, 20u };
384 bool isCharacterHit02[] = { false, false, true, true, true, true, true };
386 float visualX03[] = { 19.f, 104.f, -2.f, 127.f };
387 float visualY03[] = { 12.f, 12.f, 12.f, 12.f };
388 CharacterHitTest::Mode mode03[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
389 CharacterIndex logicalIndex03[] = { 3u, 12u, 0, 18u };
390 bool isCharacterHit03[] = { true, true, false, false };
397 // different الأربعاء \n
398 float visualX04[] = { -100.f, 40.f, 44.f, 85.f, 500.f,
399 500.f, 367.f, 359.f, 329.f, -100.f,
400 -100.f, 19.f, 64.f, 72.f, 104.f, 111.f, 500.f};
401 float visualY04[] = { -100.f, 12.f, 12.f, 12.f, 12.f,
402 30.f, 30.f, 30.f, 30.f, 30.f,
403 50.f, 50.f, 50.f, 50.f, 50.f, 50.f, 50.f };
404 CharacterHitTest::Mode mode04[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
405 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
406 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
407 CharacterIndex logicalIndex04[] = { 0, 5u, 6u, 11u, 11u,
408 12u, 16u, 17u, 21u, 21u,
409 22u, 25u, 31u, 32u, 34u, 40u, 40u,
411 bool isCharacterHit04[] = { false, true, true, false, false,
412 false, true, true, true, false,
413 false, true, true, true, true, true, false };
416 // abcשנבdefג קכghiעיןjk lחלךmnoצמם pqrפרףstuד אוvwxה
418 // סתyz טזץabcשנבd efגקכghiעי ןjklחלךmno צמםpqrפרףstuד
419 // 93 100 110 120 130 139
420 // אוvwxהס תyzטזץabcש נבdefגקכgh iעיןjklחלך mnoצמםpqr
421 // 139 150 160 170 180 186
422 // פרףstuדאוvw xהסתyzטזץa bcשנבdefגק כghiעיןjkl חלךmno
423 // 186 190 200 210 220 233
424 // צמםp qrפרףstuדא וvwxהסתyzט זץabcשנבde fגקכghiעיןjkl
425 // 233 240 250 260 265
426 // חלךmnoצ מםpqrפרףst uדאוvwxהסת yzטזץ
428 float visualX05[] = { -100.f, 96.f, 155.f, 250.f, 344.f, 500.f,
429 -100.f, 36.f, 124.f, 190.f, 280.f, 500.f,
430 -100.f, 56.f, 158.f, 237.f, 303.f, 500.f,
431 -100.f, 98.f, 184.f, 261.f, 337.f, 500.f,
432 -100.f, 40.f, 113.f, 223.f, 302.f, 500.f,
433 -100.f, 82.f, 160.f, 253.f, 500.f };
434 float visualY05[] = { -100.f, 12.f, 12.f, 12.f, 12.f, 12.f,
435 30.f, 30.f, 30.f, 30.f, 30.f, 30.f,
436 50.f, 50.f, 50.f, 50.f, 50.f, 50.f,
437 67.f, 67.f, 67.f, 67.f, 67.f, 67.f,
438 87.f, 87.f, 87.f, 87.f, 87.f, 87.f,
439 107.f, 107.f, 107.f, 107.f, 107.f };
440 CharacterHitTest::Mode mode05[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
441 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
442 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
443 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
444 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
445 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
446 CharacterIndex logicalIndex05[] = { 0, 10u, 20u, 30u, 40u, 45u,
447 46u, 50u, 60u, 70u, 80u, 92u,
448 93u, 100u, 110u, 120u, 130u, 138u,
449 139u, 150u, 160u, 170u, 180u, 185u,
450 186u, 190u, 200u, 210u, 220u, 232u,
451 233u, 240u, 250u, 260u, 265u };
452 bool isCharacterHit05[] = { false, true, true, true, true, false,
453 false, true, true, true, true, false,
454 false, true, true, true, true, false,
455 false, true, true, true, true, false,
456 false, true, true, true, true, false,
457 false, true, true, true, false };
460 // שנבabcגקכd efעיןghiחל ךjklצמםmno פרףpqrדאוs tuהסתv
462 // wxטז ץyzשנבabcג קכdefעיןgh iחלךjklצמם mnoפרףpqrדאוs
463 // 93 100 110 120 130 139
464 // tuהסתvw xטזץyzשנבa bcגקכdefעי ןghiחלךjkl צמםmnoפרף
465 // 139 150 160 170 180 186
466 // pqrדאוstuהס תvwxטזץyzש נבabcגקכde fעיןghiחלך jklצמם
467 // 186 190 200 210 220 232
468 // mnoפ רףpqrדאוst uהסתvwxטזץ yzשנבabcגק כdefעיןghiחל
469 // 232 240 250 260 265
470 // ךjklצמםm noפרףpqrדא וstuהסתvwx טזץyz
472 float visualX06[] = { 500.f, 307.f, 237.f, 148.f, 55.f, -100.f,
473 500.f, 362.f, 276.f, 213.f, 121.f, -100.f,
474 500.f, 344.f, 238.f, 167.f, 93.f, -100.f,
475 500.f, 306.f, 216.f, 142.f, 58.f, -100.f,
476 500.f, 355.f, 279.f, 182.f, 92.f, -100.f,
477 500.f, 326.f, 238.f, 150.f, -100.f };
478 float visualY06[] = { -100.f, 12.f, 12.f, 12.f, 12.f, 12.f,
479 30.f, 30.f, 30.f, 30.f, 30.f, 30.f,
480 50.f, 50.f, 50.f, 50.f, 50.f, 50.f,
481 67.f, 67.f, 67.f, 67.f, 67.f, 67.f,
482 87.f, 87.f, 87.f, 87.f, 87.f, 87.f,
483 107.f, 107.f, 107.f, 107.f, 107.f };
484 CharacterHitTest::Mode mode06[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
485 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
486 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
487 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
488 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
489 CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
490 CharacterIndex logicalIndex06[] = { 0, 10u, 20u, 30u, 40u, 45u,
491 46u, 50u, 60u, 70u, 80u, 92u,
492 93u, 100u, 110u, 120u, 130u, 138u,
493 139u, 150u, 160u, 170u, 180u, 185u,
494 186u, 190u, 200u, 210u, 220u, 231u,
495 232u, 240u, 250u, 260u, 265u };
496 bool isCharacterHit06[] = { false, true, true, true, true, false,
497 false, true, true, true, true, false,
498 false, true, true, true, true, false,
499 false, true, true, true, true, false,
500 false, true, true, true, true, false,
501 false, true, true, true, false };
503 float visualX07[] = { 395.f };
504 float visualY07[] = { 12.f };
505 CharacterHitTest::Mode mode07[] = { CharacterHitTest::TAP };
506 CharacterIndex logicalIndex07[] = { 1u };
507 bool isCharacterHit07[] = { true };
509 float visualX08[] = { 7.f };
510 float visualY08[] = { 12.f };
511 CharacterHitTest::Mode mode08[] = { CharacterHitTest::TAP };
512 CharacterIndex logicalIndex08[] = { 1u };
513 bool isCharacterHit08[] = { true };
515 struct GetClosestCursorIndexData data[] =
529 "Hello world שלום עולם",
538 "Single line with ligatures",
539 "different الأربعاء",
548 "Multiline. Single line paragraphs",
551 "different الأربعاء\n",
560 "Multiline. Single bidirectional paragraph, starts LTR, wrapped lines",
561 "abcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuדאוvwxה"
562 "סתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqrפרףstuד"
563 "אוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmnoצמםpqr"
564 "פרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjklחלךmno"
565 "צמםpqrפרףstuדאוvwxהסתyzטזץabcשנבdefגקכghiעיןjkl"
566 "חלךmnoצמםpqrפרףstuדאוvwxהסתyzטזץ",
575 "Multiline. Single bidirectional paragraph, starts RTL, wrapped lines",
576 "שנבabcגקכdefעיןghiחלךjklצמםmnoפרףpqrדאוstuהסתv"
577 "wxטזץyzשנבabcגקכdefעיןghiחלךjklצמםmnoפרףpqrדאוs"
578 "tuהסתvwxטזץyzשנבabcגקכdefעיןghiחלךjklצמםmnoפרף"
579 "pqrדאוstuהסתvwxטזץyzשנבabcגקכdefעיןghiחלךjklצמם"
580 "mnoפרףpqrדאוstuהסתvwxטזץyzשנבabcגקכdefעיןghiחל"
581 "ךjklצמםmnoפרףpqrדאוstuהסתvwxטזץyz",
590 "Testing complex characters. Arabic ligatures",
591 "الأَبْجَدِيَّة العَرَبِيَّة",
600 "Testing complex characters. Latin ligatures",
610 const unsigned int numberOfTests = 8u;
612 for( unsigned int index = 0; index < numberOfTests; ++index )
614 ToolkitTestApplication application;
615 if( !GetClosestCursorIndexTest( data[index] ) )
617 tet_result(TET_FAIL);
621 tet_result(TET_PASS);
625 int UtcDaliGetCursorPosition(void)
627 tet_infoline(" UtcDaliGetCursorPosition");
629 float visualX08[] = { 5.f };
630 float visualY08[] = { 0.f };
631 CharacterIndex logicalIndex08[] = { 1u };
633 struct GetCursorPositionData data[] =
636 "Testing complex characters. Latin ligatures",
644 const unsigned int numberOfTests = 1u;
646 for( unsigned int index = 0; index < numberOfTests; ++index )
648 ToolkitTestApplication application;
649 if( !GetCursorPositionTest( data[index] ) )
651 tet_result(TET_FAIL);
655 tet_result(TET_PASS);
659 int UtcDaliFindSelectionIndices(void)
661 tet_infoline(" UtcDaliFindSelectionIndices");
663 float visualX01[] = { -100.f };
664 float visualY01[] = { -100.f };
665 bool found01[] = { false };
666 CharacterIndex startIndex01[] = { 0 };
667 CharacterIndex endIndex01[] = { 0 };
668 CharacterIndex noHitText01[] = { 0 };
670 float visualX02[] = { -100.f, 1000.f, 1000.f };
671 float visualY02[] = { -100.f, 12.f, 1000.f };
672 bool found02[] = { false, false, false };
673 CharacterIndex startIndex02[] = { 0, 6u, 6u };
674 CharacterIndex endIndex02[] = { 5u, 11u, 11u };
675 CharacterIndex noHitText02[] = { 0, 11u, 11u };
677 float visualX03[] = { 70.f };
678 float visualY03[] = { 12.f };
679 bool found03[] = { true };
680 CharacterIndex startIndex03[] = { 6u };
681 CharacterIndex endIndex03[] = { 11u };
682 CharacterIndex noHitText03[] = { 0u };
684 float visualX04[] = { 132.f };
685 float visualY04[] = { 12.f };
686 bool found04[] = { true };
687 CharacterIndex startIndex04[] = { 12u };
688 CharacterIndex endIndex04[] = { 16u };
689 CharacterIndex noHitText04[] = { 0u };
691 float visualX05[] = { 1.f };
692 float visualY05[] = { 12.f };
693 bool found05[] = { true };
694 CharacterIndex startIndex05[] = { 0 };
695 CharacterIndex endIndex05[] = { 1u };
696 CharacterIndex noHitText05[] = { 0 };
698 float visualX06[] = { 10.f };
699 float visualY06[] = { 12.f };
700 bool found06[] = { true };
701 CharacterIndex startIndex06[] = { 0 };
702 CharacterIndex endIndex06[] = { 1u };
703 CharacterIndex noHitText06[] = { 0u };
705 struct FindSelectionIndicesData data[] =
719 "touch out of text's boundaries",
741 "touch on the new paragraph character at the end of line",
742 "Hello world demo\n",
752 "touch on a white space character. is the unique character of the line",
763 "touch on a white space character. is between two words",
774 const unsigned int numberOfTests = 6u;
776 for( unsigned int index = 0; index < numberOfTests; ++index )
778 ToolkitTestApplication application;
779 if( !FindSelectionIndicesTest( data[index] ) )
781 tet_result(TET_FAIL);
785 tet_result(TET_PASS);