X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-Visual.cpp;h=4e259e166f8529135875955ac3160fac2388ef4a;hb=ff5648f97fac481394ea81164e947f19e2a0e50a;hp=301685b29d99df2c0f9ff87e847aa18887de23da;hpb=f558388c388bcdf4939ca7af098cbcfc1631ad89;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
index 301685b..4e259e1 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
@@ -370,18 +370,29 @@ int UtcDaliVisualSize(void)
fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
+ // Create a TextVisual with a font size of 12 first
propertyMap.Clear();
propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::TEXT );
propertyMap.Insert( TextVisual::Property::ENABLE_MARKUP, true );
- propertyMap.Insert( TextVisual::Property::TEXT, "Hello world" );
+ propertyMap.Insert( TextVisual::Property::TEXT, "Hello world" );
propertyMap.Insert( TextVisual::Property::MULTI_LINE, true );
- Visual::Base textVisual = factory.CreateVisual( propertyMap );
- textVisual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Size( 86.f, 20.f ), TEST_LOCATION );
+ Visual::Base smallTextVisual = factory.CreateVisual( propertyMap );
+ Vector2 smallTextVisualNaturalSize;
+ smallTextVisual.GetNaturalSize( smallTextVisualNaturalSize );
+
+ // Then create a TextVisual with a font size of 20
+ propertyMap[ TextVisual::Property::TEXT ] = "Hello world";
+ Visual::Base largeTextVisual = factory.CreateVisual( propertyMap );
+ Vector2 largeTextVisualNaturalSize;
+ largeTextVisual.GetNaturalSize( largeTextVisualNaturalSize );
+
+ // Compare the sizes of the two text visuals, the second one should be bigger as it has a larger point size in the markup.
+ DALI_TEST_CHECK( smallTextVisualNaturalSize.width < largeTextVisualNaturalSize.width &&
+ smallTextVisualNaturalSize.height < largeTextVisualNaturalSize.height );
- const float height = textVisual.GetHeightForWidth( 40.f );
- DALI_TEST_EQUALS( height, 57.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ // The height returned for a particular width should also be greater for the large text visual
+ DALI_TEST_CHECK( smallTextVisual.GetHeightForWidth( 40.f ) < largeTextVisual.GetHeightForWidth( 40.f ) );
//AnimatedImageVisual
Visual::Base animatedImageVisual = factory.CreateVisual( TEST_GIF_FILE_NAME, ImageDimensions() );
@@ -1182,7 +1193,7 @@ int UtcDaliVisualGetPropertyMap10(void)
propertyMap.Insert( "shadow", shadowMapSet.Add("color", Color::RED).Add("offset", Vector2(2.0f, 2.0f)).Add("blurRadius", 3.0f) );
Property::Map underlineMapSet;
- propertyMap.Insert( "underline", underlineMapSet.Add("enable", "true").Add("color", "green").Add("height", "1") );
+ propertyMap.Insert( "underline", underlineMapSet.Add("enable", true).Add("color", Color::GREEN).Add("height", 1) );
Property::Map outlineMapSet;
propertyMap.Insert( "outline", outlineMapSet.Add("color", Color::YELLOW).Add("width", 1) );