-int UtcDaliTextViewMergeGroup01(void)
-{
- ToolkitTestApplication application;
-
- tet_infoline("UtcDaliTextViewMergeGroup01 : ");
-
- struct MergeWordGroupsTest mergeWordGroupssTests[] =
- {
- {
- std::string( "Merge a void first group." ),
- std::string( "" ),
- std::string( "Hello world" ),
- std::string( "Hello world" ),
- },
- {
- std::string( "Merge a void last group." ),
- std::string( "Hello world" ),
- std::string( "" ),
- std::string( "Hello world" ),
- },
- {
- std::string( "Merge groups and merge last and first words." ),
- std::string( "Hello wor" ),
- std::string( "ld, hello world" ),
- std::string( "Hello world, hello world" ),
- },
- {
- std::string( "Merge groups and don't merge last and first words." ),
- std::string( "Hello world, " ),
- std::string( "hello world" ),
- std::string( "Hello world, hello world" )
- },
- };
- const std::size_t numberOfTests( 4 );
-
- for( std::size_t index = 0; index < numberOfTests; ++index )
- {
- const MergeWordGroupsTest& test = mergeWordGroupssTests[index];
-
- if( !TestMergeGroupsOfWords( test.description, test.inputFirst, test.inputLast, test.result, TEST_LOCATION ) )
- {
- tet_result( TET_FAIL );
- }
- }
-
- tet_result(TET_PASS);
- END_TEST;
-}
-
-int UtcDaliTextViewMergeGroup02(void)
-{
- ToolkitTestApplication application;
-
- tet_infoline("UtcDaliTextViewMergeGroup02 : ");
-
- Toolkit::Internal::TextView::RelayoutData relayoutData01;
- Toolkit::Internal::TextView::RelayoutData relayoutData02;
- Toolkit::Internal::TextView::RelayoutData relayoutData03;
- TextViewProcessor::TextLayoutInfo& textLayoutInfo01( relayoutData01.mTextLayoutInfo );
- TextViewProcessor::TextLayoutInfo& textLayoutInfo02( relayoutData02.mTextLayoutInfo );
- TextViewProcessor::TextLayoutInfo& textLayoutInfo03( relayoutData03.mTextLayoutInfo );
-
- std::string text01( "Hello \n" );
- std::string text02( "world" );
- std::string text03( "السلام عليكم" );
- MarkupProcessor::StyledTextArray styledText01;
- MarkupProcessor::StyledTextArray styledText02;
- MarkupProcessor::StyledTextArray styledText03;
- MarkupProcessor::GetStyledTextArray( text01, styledText01, true );
- MarkupProcessor::GetStyledTextArray( text02, styledText02, true );
- MarkupProcessor::GetStyledTextArray( text03, styledText03, true );
-
- TextViewProcessor::CreateTextInfo( styledText01,
- DEFAULT_LAYOUT_PARAMETERS,
- relayoutData01 );
-
- TextViewProcessor::WordGroupLayoutInfo wordGroupLayoutInfo01;
-
- wordGroupLayoutInfo01 = *( *textLayoutInfo01.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-
- TextViewProcessor::CreateTextInfo( styledText02,
- DEFAULT_LAYOUT_PARAMETERS,
- relayoutData02 );
-
- TextViewProcessor::WordGroupLayoutInfo wordGroupLayoutInfo02;
-
- wordGroupLayoutInfo02 = *( *textLayoutInfo02.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-
- TextViewProcessor::CreateTextInfo( styledText03,
- DEFAULT_LAYOUT_PARAMETERS,
- relayoutData03 );
-
- TextViewProcessor::WordGroupLayoutInfo wordGroupLayoutInfo03;
-
- wordGroupLayoutInfo03 = *( *textLayoutInfo03.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-
- bool assert1 = false;
- bool assert2 = false;
-
- try
- {
- MergeWordGroup( wordGroupLayoutInfo01,
- wordGroupLayoutInfo02 );
- }
- catch( Dali::DaliException& e )
- {
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWordGroup(). ERROR: A group of words can't be merged to another group which finishes with a new line character.\"", TEST_LOCATION );
- assert1 = true;
- }
-
- try
- {
- MergeWordGroup( wordGroupLayoutInfo03,
- wordGroupLayoutInfo02 );
- }
- catch( Dali::DaliException& e )
- {
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWordGroup(). ERROR: groups with different direction can't be merged.\"", TEST_LOCATION );
- assert2 = true;
- }
-
- if( assert1 && assert2 )
- {
- tet_result( TET_PASS );
- }
- else
- {
- tet_result( TET_FAIL );
- }
- END_TEST;
-}
-
-int UtcDaliTextViewMergeLine01(void)