projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[dali_1.0.14] Merge branch 'tizen'
[platform/core/uifw/dali-toolkit.git]
/
automated-tests
/
src
/
dali-toolkit-internal
/
utc-Dali-TextView-Processor.cpp
diff --git
a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextView-Processor.cpp
b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextView-Processor.cpp
index
2fb823f
..
8fef857
100644
(file)
--- a/
automated-tests/src/dali-toolkit-internal/utc-Dali-TextView-Processor.cpp
+++ b/
automated-tests/src/dali-toolkit-internal/utc-Dali-TextView-Processor.cpp
@@
-22,6
+22,7
@@
// Internal headers are allowed here
#include <dali-toolkit/internal/controls/text-view/text-processor.h>
// Internal headers are allowed here
#include <dali-toolkit/internal/controls/text-view/text-processor.h>
+#include <dali-toolkit/internal/controls/text-view/text-processor-bidirectional-info.h>
using namespace Dali;
using namespace Dali::Toolkit;
using namespace Dali;
using namespace Dali::Toolkit;
@@
-53,11
+54,10
@@
struct BeginsRightToLeftCharacterTest
bool TestBeginsRightToLeftCharacter( const std::string& description, const std::string& input, const bool result, const char* location )
{
bool TestBeginsRightToLeftCharacter( const std::string& description, const std::string& input, const bool result, const char* location )
{
- // Creates a styled text with the markup or plain string.
- MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( input, styledText, true );
+ // Creates a text with the string.
+ Text text( input );
- const bool ret = ( result == TextProcessor::BeginsRightToLeftCharacter(
styledT
ext ) );
+ const bool ret = ( result == TextProcessor::BeginsRightToLeftCharacter(
t
ext ) );
if( !ret )
{
if( !ret )
{
@@
-79,11
+79,10
@@
struct ContainsRightToLeftCharacterTest
bool TestContainsRightToLeftCharacter( const std::string& description, const std::string& input, const bool result, const char* location )
{
bool TestContainsRightToLeftCharacter( const std::string& description, const std::string& input, const bool result, const char* location )
{
- // Creates a styled text with the markup or plain string.
- MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( input, styledText, true );
+ // Creates a text with the string.
+ Text text( input );
- const bool ret = ( result == TextProcessor::ContainsRightToLeftCharacter(
styledT
ext ) );
+ const bool ret = ( result == TextProcessor::ContainsRightToLeftCharacter(
t
ext ) );
if( !ret )
{
if( !ret )
{
@@
-141,10
+140,12
@@
bool TestSplitInParagraphs( const SplitInParagraphsTest& test, const char* locat
MarkupProcessor::StyledTextArray styledText;
MarkupProcessor::GetStyledTextArray( test.inputText, styledText, true );
MarkupProcessor::StyledTextArray styledText;
MarkupProcessor::GetStyledTextArray( test.inputText, styledText, true );
- std::vector<MarkupProcessor::StyledTextArray> paragraphs;
+ std::vector<Text> paragraphs;
+ std::vector< Vector<TextStyle*> > styles;
TextProcessor::SplitInParagraphs( styledText,
TextProcessor::SplitInParagraphs( styledText,
- paragraphs );
+ paragraphs,
+ styles );
if( paragraphs.size() != test.resultNumberOfParagraphs )
{
if( paragraphs.size() != test.resultNumberOfParagraphs )
{
@@
-163,24
+164,23
@@
struct SplitInWordsTest
{
std::string inputText;
{
std::string inputText;
- std::size_t resultNumberOf
Word
s;
+ std::size_t resultNumberOf
Separator
s;
};
bool TestSplitInWords( const SplitInWordsTest& test, const char* location )
{
};
bool TestSplitInWords( const SplitInWordsTest& test, const char* location )
{
- // Creates a styled text with the markup or plain string.
- MarkupProcessor::StyledTextArray styledText;
- MarkupProcessor::GetStyledTextArray( test.inputText, styledText, true );
+ // Creates a text with the string.
+ Text text( test.inputText );
-
std::vector<MarkupProcessor::StyledTextArray> word
s;
+
Vector<std::size_t> position
s;
- TextProcessor::SplitInWords(
styledT
ext,
-
word
s );
+ TextProcessor::SplitInWords(
t
ext,
+
position
s );
- if(
words.size() != test.resultNumberOfWord
s )
+ if(
positions.Count() != test.resultNumberOfSeparator
s )
{
tet_printf( "Fail. %s", location );
{
tet_printf( "Fail. %s", location );
- tet_printf( "Different number of
words, result %d, expected result %d", words.size(), test.resultNumberOfWord
s );
+ tet_printf( "Different number of
separators, result %d, expected result %d", positions.Count(), test.resultNumberOfSeparator
s );
return false;
}
return false;
}
@@
-236,10
+236,14
@@
int UtcDaliTextViewSplitInWords(void)
{
{
std::string( "Hello world, hello word!" ),
{
{
std::string( "Hello world, hello word!" ),
- 7
+ 3u
},
},
+ {
+ std::string( "Hello world\n" ),
+ 2u
+ }
};
};
- const std::size_t numberOfTests(
1
);
+ const std::size_t numberOfTests(
2u
);
for( std::size_t index = 0; index < numberOfTests; ++index )
{
for( std::size_t index = 0; index < numberOfTests; ++index )
{