X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-LogicalModel.cpp;h=7cbbe90d7c5e19faca50a937ae2923b7d22c3c0a;hp=67c7e243865af1b28cde2afd9ec83ea7b2762ea1;hb=610495b8647d1a25c98bf0773ccc0dd6d1996263;hpb=81529cb3b54f998306def4db0ba3f5f5a65c0c30 diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-LogicalModel.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-LogicalModel.cpp index 67c7e24..7cbbe90 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-LogicalModel.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-LogicalModel.cpp @@ -104,8 +104,7 @@ struct GetLogicalCursorIndexData bool CreateParagraphTest( const CreateParagraphData& data ) { // 1) Create the model. - LogicalModelPtr logicalModel; - VisualModelPtr visualModel; + ModelPtr textModel; MetricsPtr metrics; Size textArea(100.f, 60.f); Size layoutSize; @@ -117,11 +116,13 @@ bool CreateParagraphTest( const CreateParagraphData& data ) fontDescriptionRuns, options, layoutSize, - logicalModel, - visualModel, + textModel, metrics, false ); + LogicalModelPtr logicalModel = textModel->mLogicalModel; + VisualModelPtr visualModel = textModel->mVisualModel; + // 2) Clear the paragraphs. Vector& paragraphs = logicalModel->mParagraphInfo; ClearCharacterRuns( data.index, @@ -165,8 +166,7 @@ bool CreateParagraphTest( const CreateParagraphData& data ) bool FindParagraphTest( const FindParagraphData& data ) { // 1) Create the model. - LogicalModelPtr logicalModel; - VisualModelPtr visualModel; + ModelPtr textModel; MetricsPtr metrics; Size textArea(100.f, 60.f); Size layoutSize; @@ -178,11 +178,13 @@ bool FindParagraphTest( const FindParagraphData& data ) fontDescriptionRuns, options, layoutSize, - logicalModel, - visualModel, + textModel, metrics, false ); + LogicalModelPtr logicalModel = textModel->mLogicalModel; + VisualModelPtr visualModel = textModel->mVisualModel; + // 2) Find the paragraphs. Vector paragraphs; logicalModel->FindParagraphs( data.index, data.numberOfCharacters, paragraphs ); @@ -214,8 +216,7 @@ bool FetchBidirectionalLineInfoTest( const FetchBidirectionalLineInfoData& data { std::cout << " testing : " << data.description << std::endl; // Create the model. - LogicalModelPtr logicalModel; - VisualModelPtr visualModel; + ModelPtr textModel; MetricsPtr metrics; Size textArea( 100.f, 300.f ); Size layoutSize; @@ -228,11 +229,13 @@ bool FetchBidirectionalLineInfoTest( const FetchBidirectionalLineInfoData& data fontDescriptions, options, layoutSize, - logicalModel, - visualModel, + textModel, metrics, false ); + LogicalModelPtr logicalModel = textModel->mLogicalModel; + VisualModelPtr visualModel = textModel->mVisualModel; + for( unsigned int index = 0; index < data.numberOfTests; ++index ) { const bool fetched = logicalModel->FetchBidirectionalLineInfo( data.characterIndex[index] ); @@ -260,8 +263,7 @@ bool GetLogicalCharacterIndexTest( const GetLogicalCharacterIndexData& data ) { std::cout << " testing : " << data.description << std::endl; // Create the model. - LogicalModelPtr logicalModel; - VisualModelPtr visualModel; + ModelPtr textModel; MetricsPtr metrics; Size layoutSize; @@ -273,11 +275,13 @@ bool GetLogicalCharacterIndexTest( const GetLogicalCharacterIndexData& data ) fontDescriptions, options, layoutSize, - logicalModel, - visualModel, + textModel, metrics, false ); + LogicalModelPtr logicalModel = textModel->mLogicalModel; + VisualModelPtr visualModel = textModel->mVisualModel; + for( unsigned int index = 0u; index < data.numberOfIndices; ++index ) { // Check the current cached bidi line index. (Check it before call the GetLogicalCharacterIndex() method ) @@ -315,8 +319,7 @@ bool GetLogicalCursorIndexTest( const GetLogicalCursorIndexData& data ) fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" ); // Create the model. - LogicalModelPtr logicalModel; - VisualModelPtr visualModel; + ModelPtr textModel; MetricsPtr metrics; Size layoutSize; @@ -335,11 +338,13 @@ bool GetLogicalCursorIndexTest( const GetLogicalCursorIndexData& data ) fontDescriptionRuns, options, layoutSize, - logicalModel, - visualModel, + textModel, metrics, false ); + LogicalModelPtr logicalModel = textModel->mLogicalModel; + VisualModelPtr visualModel = textModel->mVisualModel; + for( unsigned int index = 0u; index < data.numberOfIndices; ++index ) { const bool fetched = logicalModel->FetchBidirectionalLineInfo( data.characterIndex[index] );