X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-Text-Ellipsis.cpp;h=a0a27c9052e94a357cd036037ca0881c51c4bb48;hb=8bb7e3b2a7ae71aba865d5d552a767a7889fd4ee;hp=872e85e91b96cf54a8f8f19c381dd4cb5414f38d;hpb=bd04df1ac18ac7446e95192724272d6a95f8e0eb;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp index 872e85e..a0a27c9 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include @@ -74,7 +74,7 @@ namespace ControllerPtr controller = Controller::New(); // Tests the rendering controller has been created. - TypesetterPtr typesetter = Typesetter::New( controller->GetTextModel() ); + TypesetterPtr typesetter = Typesetter::New(controller->GetTextModel()); DALI_TEST_CHECK(typesetter); // Tests the view model has been created. @@ -91,7 +91,7 @@ namespace controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) ); controller->SetEllipsisPosition( data.ellipsisPosition ); - controller->SetText( data.text ); + controller->SetText(data.text); controller->Relayout( data.size ); // Elide the glyphs. @@ -118,6 +118,21 @@ namespace const GlyphIndex firstMiddleIndexOfGlyphs = model->GetFirstMiddleIndexOfElidedGlyphs(); + //Test total height of lines is fit inside Controller's size + Length heightOfLines = 0; + for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++) + { + const LineRun& tempLine = *( model->GetLines() + lineIndex); + heightOfLines+= (tempLine.ascender - tempLine.descender); + } + + if(heightOfLines > data.size.height) + { + std::cout << "The heightOfLines should be less than height of controller."; + std::cout << " The heightOfLines is "<< heightOfLines << "and the height of controller is "<< data.size.height <GetFirstMiddleIndexOfElidedGlyphs(); const GlyphIndex secondMiddleIndexOfGlyphs = textModel->GetSecondMiddleIndexOfElidedGlyphs(); + //Test total height of lines is fit inside Controller's size + Length heightOfLines = 0; + for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++) + { + const LineRun& tempLine = *( textModel->GetLines() + lineIndex); + heightOfLines+= (tempLine.ascender - tempLine.descender); + } + + if(heightOfLines > data.size.height) + { + std::cout << "The heightOfLines should be less than height of controller."; + std::cout << " The heightOfLines is "<< heightOfLines << "and the height of controller is "<< data.size.height <