X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-Text-ViewModel.cpp;h=f243f0830783da8d6ab6ba65d41a382aea210d5d;hb=5c92fa2ed90f9e35771ebca16002d60e1185a5b4;hp=fc87193348314b617e1656dcbf7e35585d83c60a;hpb=d384f7a748c6f5bb6c9363cf0dc859ebc8bd8270;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git
diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp
index fc87193..f243f08 100755
--- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp
+++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,14 +49,14 @@ const char* LOREM_IPSUM = "Lorem ipsum dolor sit amet, aeque definiebas ea mei,
"Aliquip sanctůs delicáta quà Äá, et natum aliquam est?\n"
"Asšúm sapÄret usu ůť.\n"
"SÃÅ¥ ut apeirián laboramúš percipitur, sůas haÅum Ãn éos?\n";
-const Vector2 LOREM_SCROLL_POSITION( 0.f, -208.f );
-const Length LOREM_NUMBER_OF_LINES = 32u;
+const Vector2 LOREM_SCROLL_POSITION( 0.f, -284.f );
+const Length LOREM_NUMBER_OF_LINES = 36u;
const Length LOREM_NUMBER_OF_LINES_ELIDED = 21u;
const Length LOREM_NUMBER_OF_GLYPHS = 632;
-const Length LOREM_NUMBER_OF_GLYPHS_ELIDED = 397u;
+const Length LOREM_NUMBER_OF_GLYPHS_ELIDED = 373u;
// The expected layout size for UtcDaliTextViewModelGetLayoutSize
-const Size LAYOUT_SIZE( 190.f, 48.f );
+const Size LAYOUT_SIZE( 182.f, 45.f );
// The expected color indices for UtcDaliTextViewModelGetColors
const ColorIndex COLOR_INDICES[] = { 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 2u, 2u, 2u, 2u, 2u, 1u, 1u, 1u, 1u, 1u, 3u, 1u, 1u, 1u, 0u, 0u, 0u, 0u };
@@ -71,7 +71,6 @@ struct ElideData
unsigned int numberOfLines;
unsigned int numberOfGlyphs;
float* positions;
- unsigned int ignoreOfGlyphs;
};
bool ElideTest( const ElideData& data )
@@ -131,18 +130,18 @@ bool ElideTest( const ElideData& data )
if( numberOfLines != 0u )
{
const LineRun& lastLine = *( model->GetLines() + numberOfLines - 1u );
- const Length numberOfLastLineGlyphs = data.numberOfGlyphs - lastLine.glyphRun.glyphIndex + data.ignoreOfGlyphs;
+ const Length numberOfLastLineGlyphs = data.numberOfGlyphs - lastLine.glyphRun.glyphIndex;
- std::cout << " last line alignment offset : " << lastLine.alignmentOffset << std::endl;
+ std::cout << " last line alignment offset : " << floor(lastLine.alignmentOffset) << std::endl;
for( unsigned int index = 0u; index < numberOfLastLineGlyphs; ++index )
{
- if( *( data.positions + index ) != ( lastLine.alignmentOffset + ( *( layoutBuffer + lastLine.glyphRun.glyphIndex + index ) ).x ) )
+ if( *( data.positions + index ) != floor(lastLine.alignmentOffset + ( *( layoutBuffer + lastLine.glyphRun.glyphIndex + index ) ).x ) )
{
std::cout << " different layout :";
for( unsigned int i = 0; i < numberOfLastLineGlyphs; ++i )
{
- std::cout << " " << ( lastLine.alignmentOffset + ( *( layoutBuffer + lastLine.glyphRun.glyphIndex + i ) ).x );
+ std::cout << " " << floor( lastLine.alignmentOffset + ( *( layoutBuffer + lastLine.glyphRun.glyphIndex + i ) ).x );
}
std::cout << std::endl;
std::cout << " expected :";
@@ -584,20 +583,17 @@ int UtcDaliTextViewModelElideText02(void)
Size textSize00( 100.f, 100.f );
Size textSize01( 80.f, 100.f );
- float positions01[] = { 0.f, 9.f, 17.f, 27.f, 35.f, 37.f, 46.f, 56.f };
+ float positions01[] = { 0.f, 8.f, 16.f, 26.f, 34.f, 43.f, 47.f, 58.f, 64.0f };
Size textSize02( 80.f, 100.f );
- float positions02[] = { 72.f, 63.f, 54.f, 50.f, 43.f, 38.f, 30.f, 11.f };
+ float positions02[] = { 69.f, 63.f, 58.f, 50.f, 45.f, 41.f, 32.f, 23.f, 9.f };
Size textSize03( 80.f, 100.f );
- float positions03[] = { 77.f, 76.f, 71.f, 62.f, 59.f, 52.f, 47.f, 42.f, 39.f, 35.f, 32.f, 13.f };
+ float positions03[] = { 54.f, 47.f, 44.f, 41.f, 36.f, 29.f, 25.f, 20.f, 13.f, 8.f, 4.f, 6.f };
Size textSize04( 80.f, 10.f );
float positions04[] = { 2.f };
- Size textSize05( 180.f, 100.f );
- float positions05[] = { 0.f, 0.f };
-
struct ElideData data[] =
{
{
@@ -606,35 +602,31 @@ int UtcDaliTextViewModelElideText02(void)
textSize00,
0u,
0u,
- NULL,
- 0u
+ NULL
},
{
"Latin script",
"Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum.",
textSize01,
5u,
- 42u,
- positions01,
- 0u
+ 36u,
+ positions01
},
{
"Hebrew script",
"×¦×¢× ×¢× ×ש×× ×××צת ×××ר×× ×, ×× ×××× ×©× ××¨× ×¡×¨××× ×××¢, ×§×¨× ×ת שפ×ת ××פ××.",
textSize02,
5u,
- 49u,
- positions02,
- 0u
+ 44u,
+ positions02
},
{
"Arabic script",
"ع٠اÙÙÙØ· دÙسÙ
بر اÙØ¥Ù
داد باÙ, بÙÙ Ùتر٠شعار ÙÙ. ÙÙ
Ù Ù
٠اÙÙ
برÙ
Ø© اÙÙÙØ· باÙسÙطرة, Ø£Ù
ÙتÙ
تØرÙÙ Ùبغطاء, عدÙ
ÙÙ Ùإعادة ÙØ¥ÙاÙ
Ø© رجÙعÙÙ
.",
textSize03,
5u,
- 79u,
- positions03,
- 0u
+ 62u,
+ positions03
},
{
"Small control size, no line fits.",
@@ -642,20 +634,10 @@ int UtcDaliTextViewModelElideText02(void)
textSize04,
1u,
1u,
- positions04,
- 0u
- },
- {
- "Include newline character",
- "yesterday\n all\n my troubles\n seemed so far\n\n away now it looks",
- textSize05,
- 5u,
- 40,
- positions05,
- 5u
- },
+ positions04
+ }
};
- const unsigned int numberOfTests = 6u;
+ const unsigned int numberOfTests = 5u;
for( unsigned int index = 0u; index < numberOfTests; ++index )
{