Updates for const->constexpr
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-VisualModel.cpp
index 115a0d1..df247e0 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
-#include <toolkit-text-model.h>
+#include <toolkit-text-utils.h>
 
 
 using namespace Dali;
@@ -65,8 +65,8 @@ struct SetCharacterToGlyphData
 bool SetGlyphsPerCharacterTest( const SetGlyphsPerCharacterData& data )
 {
   // 1) Create the model.
-  LogicalModelPtr logicalModel = LogicalModel::New();
-  VisualModelPtr visualModel = VisualModel::New();
+  ModelPtr textModel;
+  MetricsPtr metrics;
   Size textArea(100.f, 60.f);
   Size layoutSize;
 
@@ -77,8 +77,12 @@ bool SetGlyphsPerCharacterTest( const SetGlyphsPerCharacterData& data )
                    fontDescriptions,
                    options,
                    layoutSize,
-                   logicalModel,
-                   visualModel );
+                   textModel,
+                   metrics,
+                   false );
+
+  LogicalModelPtr logicalModel = textModel->mLogicalModel;
+  VisualModelPtr visualModel = textModel->mVisualModel;
 
   Vector<GlyphIndex>& charactersToGlyph = visualModel->mCharactersToGlyph;
   Vector<Length>& glyphsPerCharacter = visualModel->mGlyphsPerCharacter;
@@ -145,8 +149,8 @@ bool SetGlyphsPerCharacterTest( const SetGlyphsPerCharacterData& data )
 bool SetCharacterToGlyphTest( const SetCharacterToGlyphData& data )
 {
   // 1) Create the model.
-  LogicalModelPtr logicalModel = LogicalModel::New();
-  VisualModelPtr visualModel = VisualModel::New();
+  ModelPtr textModel;
+  MetricsPtr metrics;
   Size textArea(100.f, 60.f);
   Size layoutSize;
 
@@ -157,8 +161,12 @@ bool SetCharacterToGlyphTest( const SetCharacterToGlyphData& data )
                    fontDescriptions,
                    options,
                    layoutSize,
-                   logicalModel,
-                   visualModel );
+                   textModel,
+                   metrics,
+                   false );
+
+  LogicalModelPtr logicalModel = textModel->mLogicalModel;
+  VisualModelPtr visualModel = textModel->mVisualModel;
 
   Vector<GlyphIndex>& charactersToGlyph = visualModel->mCharactersToGlyph;
   Vector<Length>& glyphsPerCharacter = visualModel->mGlyphsPerCharacter;
@@ -226,7 +234,6 @@ bool SetCharacterToGlyphTest( const SetCharacterToGlyphData& data )
 
 int UtcDaliSetGlyphsPerCharacter(void)
 {
-  ToolkitTestApplication application;
   tet_infoline(" UtcDaliSetGlyphsPerCharacter");
 
   Length glyphsPerCharacter02[] = { 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u };
@@ -293,6 +300,7 @@ int UtcDaliSetGlyphsPerCharacter(void)
 
   for( unsigned int index = 0u; index < numberOfTests; ++index )
   {
+    ToolkitTestApplication application;
     if( !SetGlyphsPerCharacterTest( data[index] ) )
     {
       tet_result(TET_FAIL);
@@ -305,7 +313,6 @@ int UtcDaliSetGlyphsPerCharacter(void)
 
 int UtcDaliSetCharacterToGlyph(void)
 {
-  ToolkitTestApplication application;
   tet_infoline(" UtcDaliSetGlyphsPerCharacter");
 
   GlyphIndex glyphIndices02[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u };
@@ -370,6 +377,7 @@ int UtcDaliSetCharacterToGlyph(void)
 
   for( unsigned int index = 0u; index < numberOfTests; ++index )
   {
+    ToolkitTestApplication application;
     if( !SetCharacterToGlyphTest( data[index] ) )
     {
       tet_result(TET_FAIL);