+
+int UtcDaliGetCursorPosition(void)
+{
+ tet_infoline(" UtcDaliGetCursorPosition");
+
+ float visualX08[] = { 5.f };
+ float visualY08[] = { 0.f };
+ CharacterIndex logicalIndex08[] = { 1u };
+
+ struct GetCursorPositionData data[] =
+ {
+ {
+ "Testing complex characters. Latin ligatures",
+ "fi ligature",
+ 1u,
+ logicalIndex08,
+ visualX08,
+ visualY08,
+ }
+ };
+ const unsigned int numberOfTests = 1u;
+
+ for( unsigned int index = 0; index < numberOfTests; ++index )
+ {
+ ToolkitTestApplication application;
+ if( !GetCursorPositionTest( data[index] ) )
+ {
+ tet_result(TET_FAIL);
+ }
+ }
+
+ tet_result(TET_PASS);
+ END_TEST;
+}
+
+int UtcDaliFindSelectionIndices(void)
+{
+ tet_infoline(" UtcDaliFindSelectionIndices");
+
+ float visualX01[] = { -100.f };
+ float visualY01[] = { -100.f };
+ bool found01[] = { false };
+ CharacterIndex startIndex01[] = { 0 };
+ CharacterIndex endIndex01[] = { 0 };
+ CharacterIndex noHitText01[] = { 0 };
+
+ float visualX02[] = { -100.f, 1000.f, 1000.f };
+ float visualY02[] = { -100.f, 12.f, 1000.f };
+ bool found02[] = { false, false, false };
+ CharacterIndex startIndex02[] = { 0, 6u, 6u };
+ CharacterIndex endIndex02[] = { 5u, 11u, 11u };
+ CharacterIndex noHitText02[] = { 0, 11u, 11u };
+
+ float visualX03[] = { 70.f };
+ float visualY03[] = { 12.f };
+ bool found03[] = { true };
+ CharacterIndex startIndex03[] = { 6u };
+ CharacterIndex endIndex03[] = { 11u };
+ CharacterIndex noHitText03[] = { 0u };
+
+ float visualX04[] = { 132.f };
+ float visualY04[] = { 12.f };
+ bool found04[] = { true };
+ CharacterIndex startIndex04[] = { 12u };
+ CharacterIndex endIndex04[] = { 16u };
+ CharacterIndex noHitText04[] = { 0u };
+
+ float visualX05[] = { 1.f };
+ float visualY05[] = { 12.f };
+ bool found05[] = { true };
+ CharacterIndex startIndex05[] = { 0 };
+ CharacterIndex endIndex05[] = { 1u };
+ CharacterIndex noHitText05[] = { 0 };
+
+ float visualX06[] = { 10.f };
+ float visualY06[] = { 12.f };
+ bool found06[] = { true };
+ CharacterIndex startIndex06[] = { 0 };
+ CharacterIndex endIndex06[] = { 1u };
+ CharacterIndex noHitText06[] = { 0u };
+
+ struct FindSelectionIndicesData data[] =
+ {
+ {
+ "void text",
+ "",
+ 1u,
+ visualX01,
+ visualY01,
+ found01,
+ startIndex01,
+ endIndex01,
+ noHitText01
+ },
+ {
+ "touch out of text's boundaries",
+ "Hello world",
+ 3u,
+ visualX02,
+ visualY02,
+ found02,
+ startIndex02,
+ endIndex02,
+ noHitText02
+ },
+ {
+ "touch on the text",
+ "Hello world demo",
+ 1u,
+ visualX03,
+ visualY03,
+ found03,
+ startIndex03,
+ endIndex03,
+ noHitText03
+ },
+ {
+ "touch on the new paragraph character at the end of line",
+ "Hello world demo\n",
+ 1u,
+ visualX04,
+ visualY04,
+ found04,
+ startIndex04,
+ endIndex04,
+ noHitText04
+ },
+ {
+ "touch on a white space character. is the unique character of the line",
+ " ",
+ 1u,
+ visualX05,
+ visualY05,
+ found05,
+ startIndex05,
+ endIndex05,
+ noHitText05
+ },
+ {
+ "touch on a white space character. is between two words",
+ "h ello",
+ 1u,
+ visualX06,
+ visualY06,
+ found06,
+ startIndex06,
+ endIndex06,
+ noHitText06
+ },
+ };
+ const unsigned int numberOfTests = 6u;
+
+ for( unsigned int index = 0; index < numberOfTests; ++index )
+ {
+ ToolkitTestApplication application;
+ if( !FindSelectionIndicesTest( data[index] ) )
+ {
+ tet_result(TET_FAIL);
+ }
+ }
+
+ tet_result(TET_PASS);
+ END_TEST;
+}