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-TextEditor.cpp;h=fac21a0dc59a87f342ec888d228566eeea6244d6;hp=b95f6c75d2626c626c40b54dc308f5da98f91c2e;hb=9d379104c45c7979f7dcd1ef2f9df84e8cc902c1;hpb=9f3c9647cddba461622be260d251487e586fdde4 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp index b95f6c7..fac21a0 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -5124,6 +5124,44 @@ int utcDaliTextEditorGeometryOneGlyph(void) END_TEST; } +int utcDaliTextEditorGeometryNullPtr(void) +{ + ToolkitTestApplication application; + tet_infoline("utcDaliTextEditorGeometryNullPtr"); + + TextEditor editor = TextEditor::New(); + DALI_TEST_CHECK(editor); + + application.GetScene().Add(editor); + + editor.SetProperty(TextEditor::Property::POINT_SIZE, 7.f); + editor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f)); + editor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT); + editor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + editor.SetProperty(TextEditor::Property::ENABLE_MARKUP, true); + editor.SetProperty(TextEditor::Property::TEXT, ""); + + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE); + + unsigned int expectedCount = 0; + unsigned int startIndex = 0; + unsigned int endIndex = 0; + + Vector positionsList = DevelTextEditor::GetTextPosition(editor, startIndex, endIndex); + Vector sizeList = DevelTextEditor::GetTextSize(editor, startIndex, endIndex); + + // Render and notify + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS(positionsList.Size(), expectedCount, TEST_LOCATION); + DALI_TEST_EQUALS(sizeList.Size(), expectedCount, TEST_LOCATION); + + END_TEST; +} + + int utcDaliTextEditorSelectionClearedSignal(void) { ToolkitTestApplication application;