Modify UtcDaliTextControllerMaxLengthSetText() 11/224011/2
authorJoogab Yun <joogab.yun@samsung.com>
Wed, 5 Feb 2020 11:05:01 +0000 (20:05 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Wed, 5 Feb 2020 11:43:55 +0000 (20:43 +0900)
It takes too long to create a string of maxLength. Improve this.

Change-Id: Ic2bb10cc37d5b58c4c246307de336829a32a9bb4

automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp

index a76ccb9..7275618 100755 (executable)
@@ -1159,26 +1159,18 @@ int UtcDaliTextControllerMaxLengthSetText(void)
   // Creates a text controller.
   ControllerPtr controller = Controller::New();
 
-  ConfigureTextLabel(controller);
+  ConfigureTextLabel( controller );
 
   const Length MAX_TEXT_LENGTH = 1024u * 32u;
 
   // make over length world
-  int maxLength = (1024u * 32u) + 10u;
-  char world[maxLength];
-  for( int i = 0; i < maxLength; i++ )
-  {
-    world[i] = 'a';
-  }
+  int maxLength = ( 1024u * 32u ) + 10u;
+  char world[maxLength] = { 'a' };
 
   // Set the text
-  std::string text(world);
+  std::string text( world, maxLength );
   controller->SetText( text );
 
-  // Perform a relayout
-  const Size size( Dali::Stage::GetCurrent().GetSize() );
-  controller->Relayout(size);
-
   // check text length
   controller->GetText( text );
   Length textSize = text.size();