Add text wrapping hyphen mode support
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-Text-Layout.cpp
index 763a5ac..8bdecaa 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -108,7 +108,8 @@ bool LayoutTextTest( const LayoutTextData& data )
                    layoutSize,
                    textModel,
                    metrics,
-                   false );
+                   false,
+                   LineWrap::WORD );
 
   LogicalModelPtr logicalModel = textModel->mLogicalModel;
   VisualModelPtr visualModel = textModel->mVisualModel;
@@ -199,7 +200,7 @@ bool LayoutTextTest( const LayoutTextData& data )
   {
     const Vector2& position = *( glyphPositions.Begin() + index );
 
-    if( fabsf( position.x - *( data.positions + 2u * index ) ) > Math::MACHINE_EPSILON_1000 )
+    if( fabsf( std::round( position.x ) - *( data.positions + 2u * index ) ) > Math::MACHINE_EPSILON_1000 )
     {
       std::cout << "  Different position for glyph " << index << " x : " << position.x << ", expected : " << *( data.positions + 2u * index ) << std::endl;
       return false;
@@ -363,7 +364,8 @@ bool AlignTest( const AlignData& data )
                    layoutSize,
                    textModel,
                    metrics,
-                   false );
+                   false,
+                   LineWrap::WORD );
 
   LogicalModelPtr logicalModel = textModel->mLogicalModel;
   VisualModelPtr visualModel = textModel->mVisualModel;