X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-Text-Ellipsis.cpp;h=75d8bb47d0e0c28b7be138d7a146fb2bd3f97cc1;hb=refs%2Fchanges%2F95%2F275895%2F6;hp=e5b8a8818ff33b79c9a9d9a775fedea00d5c1fd2;hpb=5247947358fb8bd9a1b27a6f0f347d6836b6e4f0;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 e5b8a88..75d8bb4 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 @@ -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 <