From: Eunki, Hong Date: Fri, 4 Apr 2025 04:10:40 +0000 (+0900) Subject: Print some critical warning message as error to print at release mode X-Git-Tag: dali_2.4.14~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e97dfa00ec8d2aba224b62f161b7a73e8115e968;p=platform%2Fcore%2Fuifw%2Fdali-core.git Print some critical warning message as error to print at release mode Since DALI_LOG_WARNING didn't print any logs at release mode, several critical errors didn't print any infomations. To make ensure those are real error, let we change the log level as 'ERROR' and allow to print at release mode binary. Change-Id: Ib74c21979799a53d4288d87feb849360fd3f9072 Signed-off-by: Eunki, Hong --- diff --git a/automated-tests/src/dali/utc-Dali-TapGestureRecognizer.cpp b/automated-tests/src/dali/utc-Dali-TapGestureRecognizer.cpp index 70b1291e8..5508dfaca 100644 --- a/automated-tests/src/dali/utc-Dali-TapGestureRecognizer.cpp +++ b/automated-tests/src/dali/utc-Dali-TapGestureRecognizer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 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. @@ -705,7 +705,7 @@ int UtcDaliTapGestureSetMaximumMotionAllowedDistance(void) try { - Integration::SetTapMaximumMotionAllowedDistance(0); + Integration::SetTapMaximumMotionAllowedDistance(-1.0f); } catch(...) { diff --git a/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp b/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp index 3e1eb862f..add587983 100644 --- a/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp +++ b/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 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. @@ -949,6 +949,22 @@ int UtcDaliTypeRegistrySignalConnectorTypeN(void) DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 0, TEST_LOCATION); customHandle.GetCustomSignal().Emit(); DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 0 /*never called*/, TEST_LOCATION); + + // Test for connect by SignalConnectorType struct who has duplicated name. + try + { + SignalConnectorType invalidSignalConnector(customType1, "sig1", DoConnectSignalCustom); + } + catch(...) + { + DALI_TEST_CHECK(false); // Should not come here. + } + + // Should be a NOOP + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 0, TEST_LOCATION); + customHandle.GetCustomSignal().Emit(); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 0 /*never called*/, TEST_LOCATION); + END_TEST; } @@ -986,6 +1002,16 @@ int UtcDaliTypeRegistryTypeActionN(void) Property::Map attributes; DALI_TEST_CHECK(!handle.DoAction("unknownAction", attributes)); + // Test for connect by TypeAction struct who has duplicated name. + try + { + TypeAction invalidAction(customType1, "act1", DoActionCustom); + } + catch(...) + { + DALI_TEST_CHECK(false); // Should not come here. + } + END_TEST; } diff --git a/dali/integration-api/debug.h b/dali/integration-api/debug.h index 687c4f559..dfb113596 100644 --- a/dali/integration-api/debug.h +++ b/dali/integration-api/debug.h @@ -2,7 +2,7 @@ #define DALI_INTEGRATION_DEBUG_H /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 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. @@ -171,7 +171,7 @@ DALI_CORE_API void UninstallLogFunction(); #define DALI_LOG_RELEASE_INFO(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::INFO, format, ##__VA_ARGS__) /** - * Provides unfiltered logging for debuf information + * Provides unfiltered logging for debug information */ #define DALI_LOG_DEBUG_INFO(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::DEBUG, format, ##__VA_ARGS__) diff --git a/dali/internal/event/common/type-info-impl.cpp b/dali/internal/event/common/type-info-impl.cpp index 434473956..35f615227 100644 --- a/dali/internal/event/common/type-info-impl.cpp +++ b/dali/internal/event/common/type-info-impl.cpp @@ -446,7 +446,7 @@ void TypeInfo::AddActionFunction(std::string actionName, Dali::TypeInfo::ActionF { if(DALI_UNLIKELY(!mActions.Register(ConstString(actionName), function))) { - DALI_LOG_WARNING("Action already exists in TypeRegistry Type\n", actionName.c_str()); + DALI_LOG_ERROR("Action already exists in TypeRegistry Type\n", actionName.c_str()); } } } @@ -461,7 +461,7 @@ void TypeInfo::AddConnectorFunction(std::string signalName, Dali::TypeInfo::Sign { if(DALI_UNLIKELY(!mSignalConnectors.Register(ConstString(signalName), function))) { - DALI_LOG_WARNING("Signal name already exists in TypeRegistry Type for signal connector function\n", signalName.c_str()); + DALI_LOG_ERROR("Signal name already exists in TypeRegistry Type for signal connector function\n", signalName.c_str()); } } } diff --git a/dali/internal/event/common/type-registry-impl.cpp b/dali/internal/event/common/type-registry-impl.cpp index 12cc1ca67..123ba8a59 100644 --- a/dali/internal/event/common/type-registry-impl.cpp +++ b/dali/internal/event/common/type-registry-impl.cpp @@ -123,7 +123,7 @@ std::string TypeRegistry::Register(std::string uniqueTypeName if(!mRegistryLut.Register(ConstString(uniqueTypeName), new Internal::TypeInfo(uniqueTypeName, baseTypeName, createInstance, defaultProperties, defaultPropertyCount))) { - DALI_LOG_WARNING("Duplicate name in TypeRegistry for '%s'\n", +uniqueTypeName.c_str()); + DALI_LOG_ERROR("Duplicate name in TypeRegistry for '%s'\n", +uniqueTypeName.c_str()); DALI_ASSERT_ALWAYS(!"Duplicate type name in Type Registration"); return uniqueTypeName; // never actually happening due to the assert } @@ -143,7 +143,7 @@ void TypeRegistry::Register(std::string uniqueTypeName, const std::type_info& ba if(!mRegistryLut.Register(ConstString(uniqueTypeName), TypeRegistry::TypeInfoPointer(new Internal::TypeInfo(uniqueTypeName, baseTypeName, createInstance)))) { - DALI_LOG_WARNING("Duplicate name in TypeRegistry for '%s'\n", +uniqueTypeName.c_str()); + DALI_LOG_ERROR("Duplicate name in TypeRegistry for '%s'\n", +uniqueTypeName.c_str()); DALI_ASSERT_ALWAYS(!"Duplicate type name in Type Registration"); return; // never actually happening due to the assert } @@ -270,7 +270,7 @@ bool TypeRegistry::DoActionTo(BaseObject* const object, const std::string& actio if(!done) { - DALI_LOG_WARNING("Type '%s' cannot do action '%s'\n", type->GetName().c_str(), actionName.c_str()); + DALI_LOG_ERROR("Type '%s' cannot do action '%s'\n", type->GetName().c_str(), actionName.c_str()); } return done; @@ -287,7 +287,7 @@ bool TypeRegistry::ConnectSignal(BaseObject* object, ConnectionTrackerInterface* if(!connected) { - DALI_LOG_WARNING("Type '%s' signal '%s' connection failed \n", type->GetName().c_str(), signalName.c_str()); + DALI_LOG_ERROR("Type '%s' signal '%s' connection failed \n", type->GetName().c_str(), signalName.c_str()); // Ownership of functor was not passed to Dali::CallbackBase, so clean-up now delete functor; } diff --git a/dali/internal/event/events/tap-gesture/tap-gesture-processor.cpp b/dali/internal/event/events/tap-gesture/tap-gesture-processor.cpp index 30a2dbd84..3dbba249c 100644 --- a/dali/internal/event/events/tap-gesture/tap-gesture-processor.cpp +++ b/dali/internal/event/events/tap-gesture/tap-gesture-processor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 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. @@ -241,7 +241,7 @@ void TapGestureProcessor::SetMaximumAllowedTime(uint32_t time) { if(time == 0u) { - DALI_LOG_WARNING("MaximumAllowedTime must be greater than zero."); + DALI_LOG_ERROR("MaximumAllowedTime must be greater than zero."); return; } if(mMaximumAllowedTime != time) @@ -268,7 +268,7 @@ void TapGestureProcessor::SetRecognizerTime(uint32_t time) { if(time == 0u) { - DALI_LOG_WARNING("RecognizerTime must be greater than zero."); + DALI_LOG_ERROR("RecognizerTime must be greater than zero."); return; } if(mRecognizerTime != time) @@ -295,7 +295,7 @@ void TapGestureProcessor::SetMaximumMotionAllowedDistance(float distance) { if(distance < 0.0f) { - DALI_LOG_WARNING("distance must be greater than zero."); + DALI_LOG_ERROR("distance must be greater than zero."); return; } diff --git a/dali/internal/event/images/pixel-data-impl.cpp b/dali/internal/event/images/pixel-data-impl.cpp index b97494f69..fc5d2ac82 100644 --- a/dali/internal/event/images/pixel-data-impl.cpp +++ b/dali/internal/event/images/pixel-data-impl.cpp @@ -133,7 +133,7 @@ uint32_t PixelData::GetStride() const } if(DALI_UNLIKELY(mStrideBytes % bytesPerPixel != 0u)) { - DALI_LOG_WARNING("StrideByte value [%u] cannot divide by bpp [%u]!\n", mStrideBytes, bytesPerPixel); + DALI_LOG_ERROR("StrideByte value [%u] cannot divide by bpp [%u]!\n", mStrideBytes, bytesPerPixel); } return mStrideBytes / bytesPerPixel; } diff --git a/dali/public-api/object/base-object.cpp b/dali/public-api/object/base-object.cpp index c779f4f1c..46afc6e0c 100644 --- a/dali/public-api/object/base-object.cpp +++ b/dali/public-api/object/base-object.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 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. @@ -90,7 +90,7 @@ const std::string& BaseObject::GetTypeName() const } // Return an empty string if type-name not found. - DALI_LOG_WARNING("TypeName Not Found\n"); + DALI_LOG_ERROR("TypeName Not Found\n"); static std::string empty; return empty; }