Updates for const->constexpr
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-LogicalModel.cpp
index 67c7e24..7cbbe90 100755 (executable)
@@ -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<ParagraphRun>& 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<ParagraphRunIndex> 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] );