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-TextLabel.cpp;h=9f9ce5faa46a0783199bb0f27838df0055c09aa1;hp=d8c5f70e4cc545776848e399e1a74502ddee7e2d;hb=1af4cb78028c7aae2f0df9efd0c52d6cd9bbabaa;hpb=b19cf78f1600ffa505de264f465865d18063dd5d diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp index d8c5f70..9f9ce5f 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include using namespace Dali; @@ -1535,3 +1536,48 @@ int UtcDaliToolkitTextlabelTextFit(void) END_TEST; } + +int UtcDaliToolkitTextlabelMaxTextureSet(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliToolkitTextlabelMaxTextureSet"); + + DevelText::BitmapFontDescription fontDescription; + fontDescription.name = "Digits"; + fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0030.png", ":", 200.f, 0.f } ); + + TextAbstraction::BitmapFont bitmapFont; + DevelText::CreateBitmapFont( fontDescription, bitmapFont ); + + TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get(); + fontClient.GetFontId( bitmapFont ); + + TextLabel label = TextLabel::New(); + label.SetProperty( TextLabel::Property::FONT_FAMILY, "Digits" ); + label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true ); + label.SetProperty( TextLabel::Property::TEXT, ":This is a long sample text made to allow max texture size to be exceeded." ); + label.SetProperty( TextLabel::Property::POINT_SIZE, 200.f ); + label.SetProperty( TextLabel::Property::MULTI_LINE, true ); + + Property::Map underlineMapSet; + underlineMapSet.Clear(); + underlineMapSet.Insert( "enable", true ); + underlineMapSet.Insert( "color", Color::RED ); + underlineMapSet.Insert( "height", 1 ); + label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet ); + label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLUE ); + + Stage::GetCurrent().Add( label ); + + application.SendNotification(); + application.Render(); + + const int maxTextureSize = Dali::GetMaxTextureSize(); + // Whether the rendered text is greater than maxTextureSize + DALI_TEST_CHECK( label.GetCurrentSize().height > maxTextureSize ); + + // Check if the number of renderers is greater than 1. + DALI_TEST_CHECK( label.GetRendererCount() > 1u ); + + END_TEST; +}