Print some critical warning message as error to print at release mode 62/322162/5
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 4 Apr 2025 04:10:40 +0000 (13:10 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Wed, 9 Apr 2025 05:34:31 +0000 (05:34 +0000)
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 <eunkiki.hong@samsung.com>
automated-tests/src/dali/utc-Dali-TapGestureRecognizer.cpp
automated-tests/src/dali/utc-Dali-TypeRegistry.cpp
dali/integration-api/debug.h
dali/internal/event/common/type-info-impl.cpp
dali/internal/event/common/type-registry-impl.cpp
dali/internal/event/events/tap-gesture/tap-gesture-processor.cpp
dali/internal/event/images/pixel-data-impl.cpp
dali/public-api/object/base-object.cpp

index 70b1291e8ebc71dc9c16e358b61ab78877c297da..5508dfaca3076e4cbdb1dfcf013a7e44d0dfb4df 100644 (file)
@@ -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(...)
   {
index 3e1eb862fa7121844603370c499a01ad87997c76..add5879837c6b15e9af6bab9c205c660edde7b35 100644 (file)
@@ -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;
 }
 
index 687c4f559f5050194fde7e53664f9a0cba324547..dfb113596eb2c653181148e7d7d0fbad7d58d952 100644 (file)
@@ -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__)
 
index 434473956f31dc9301c44538f41e651bdbbb1e1a..35f6152271d4c5398556ebc42db4abcef0375fdc 100644 (file)
@@ -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());
     }
   }
 }
index 12cc1ca6750dc07a3be31fc65da121612c78fbbe..123ba8a5954cdf82353723068393a7874166797c 100644 (file)
@@ -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;
   }
index 30a2dbd84cc93fe93a1351f1aaff10d585bf39df..3dbba249cdba360696151e6ccda7217deee07148 100644 (file)
@@ -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;
   }
 
index b97494f6997ea6584516c3f9370ba988bb6b580a..fc5d2ac829a85edb2a76da964aef81a7b8181cf4 100644 (file)
@@ -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;
 }
index c779f4f1c059025e7b1d9519a8d58ecd9bde84d7..46afc6e0cf100b3f5992ac1fc158521b70fda6d8 100644 (file)
@@ -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;
 }