From: Adeel Kazmi Date: Wed, 13 Jul 2022 10:41:13 +0000 (+0000) Subject: Merge "(Vector) Fix occasional tc failure" into devel/master X-Git-Tag: dali_2.1.31~4 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=65d548a5d199385f6992cb2bae88e014a6b85042;hp=e8954068388a568c9d89de31ae033fe94d0ce20d Merge "(Vector) Fix occasional tc failure" into devel/master --- diff --git a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h index e44aa56..d3f4e25 100644 --- a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h +++ b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h @@ -125,6 +125,8 @@ struct DBusWrapper virtual ObjectPtr eldbus_object_get_impl( const ConnectionPtr &conn, const std::string &bus, const std::string &path ) = 0; virtual ProxyPtr eldbus_proxy_get_impl( const ObjectPtr &obj, const std::string &interface ) = 0; virtual ProxyPtr eldbus_proxy_copy_impl( const ProxyPtr &ptr) = 0; + virtual void eldbus_name_request_impl(const ConnectionPtr&, const std::string&) {} // no-op + virtual void eldbus_name_release_impl(const ConnectionPtr&, const std::string&) {} // no-op class StringStorage { diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-compare-types.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-compare-types.h index d917107..fcadd6f 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-compare-types.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-compare-types.h @@ -2,7 +2,7 @@ #define DALI_TEST_COMPARE_TYPES_H /* - * Copyright (c) 2020 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. @@ -111,109 +111,4 @@ inline bool CompareType(Extents extents1, Extents extents2, float epsil (extents1.bottom == extents2.bottom); } -template<> -inline bool CompareType(Property::Value q1, Property::Value q2, float epsilon) -{ - Property::Type type = q1.GetType(); - if(type != q2.GetType()) - { - return false; - } - - bool result = false; - switch(type) - { - case Property::BOOLEAN: - { - bool a, b; - q1.Get(a); - q2.Get(b); - result = a == b; - break; - } - case Property::INTEGER: - { - int a, b; - q1.Get(a); - q2.Get(b); - result = a == b; - break; - } - case Property::FLOAT: - { - float a, b; - q1.Get(a); - q2.Get(b); - result = CompareType(a, b, epsilon); - break; - } - case Property::VECTOR2: - { - Vector2 a, b; - q1.Get(a); - q2.Get(b); - result = CompareType(a, b, epsilon); - break; - } - case Property::VECTOR3: - { - Vector3 a, b; - q1.Get(a); - q2.Get(b); - result = CompareType(a, b, epsilon); - break; - } - case Property::RECTANGLE: - case Property::VECTOR4: - { - Vector4 a, b; - q1.Get(a); - q2.Get(b); - result = CompareType(a, b, epsilon); - break; - } - case Property::ROTATION: - { - Quaternion a, b; - q1.Get(a); - q2.Get(b); - result = CompareType(a, b, epsilon); - break; - } - case Property::STRING: - { - std::string a, b; - q1.Get(a); - q2.Get(b); - result = (a.compare(b) == 0); - break; - } - case Property::MATRIX: - case Property::MATRIX3: - case Property::ARRAY: - case Property::MAP: - { - //TODO: Implement this? - DALI_ASSERT_ALWAYS(0 && "Not implemented"); - result = false; - break; - } - case Property::EXTENTS: - { - Extents a, b; - q1.Get(a); - q2.Get(b); - result = CompareType(a, b, epsilon); - break; - } - case Property::NONE: - { - result = false; - break; - } - } - - return result; -} - #endif diff --git a/dali-toolkit/internal/text/text-controller-text-updater.cpp b/dali-toolkit/internal/text/text-controller-text-updater.cpp index 35408da..4d0ba8f 100644 --- a/dali-toolkit/internal/text/text-controller-text-updater.cpp +++ b/dali-toolkit/internal/text/text-controller-text-updater.cpp @@ -473,6 +473,7 @@ bool Controller::TextUpdater::RemoveText( UpdateInputStyleType type) { bool removed = false; + bool removeAll = false; Controller::Impl& impl = *controller.mImpl; EventData*& eventData = impl.mEventData; @@ -526,9 +527,14 @@ bool Controller::TextUpdater::RemoveText( numberOfCharacters = currentText.Count() - cursorIndex; } + if((cursorIndex == 0) && (currentText.Count() - numberOfCharacters == 0)) + { + removeAll = true; + } + TextUpdateInfo& textUpdateInfo = impl.mTextUpdateInfo; - if(eventData->mPreEditFlag || // If the preedit flag is enabled, it means two (or more) of them came together i.e. when two keys have been pressed at the same time. + if(eventData->mPreEditFlag || removeAll || // If the preedit flag is enabled, it means two (or more) of them came together i.e. when two keys have been pressed at the same time. ((cursorIndex + numberOfCharacters) <= textUpdateInfo.mPreviousNumberOfCharacters)) { // Mark the paragraphs to be updated. @@ -574,7 +580,7 @@ bool Controller::TextUpdater::RemoveText( // If the number of current text and the number of characters to be deleted are same, // it means all texts should be removed and all Preedit variables should be initialized. - if((currentText.Count() - numberOfCharacters == 0) && (cursorIndex == 0)) + if(removeAll) { impl.ClearPreEditFlag(); textUpdateInfo.mNumberOfCharactersToAdd = 0; @@ -617,6 +623,7 @@ bool Controller::TextUpdater::RemoveText( } DALI_LOG_INFO(gLogFilter, Debug::General, "Controller::RemoveText %p removed %d\n", &controller, numberOfCharacters); + removeAll = false; removed = true; } }