X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-Visual.cpp;h=c4df7010ead48f4e9ee4e4a925bf65701ee9c886;hp=301685b29d99df2c0f9ff87e847aa18887de23da;hb=6554dcac017d05a786b1607807b6468ba7c0d666;hpb=a76ab01e4bdaf91bbf3b2588e1a8c628a152bc6a
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
index 301685b..c4df701 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() );