From 9a379652687bacab9a162d89c83829fff411340b Mon Sep 17 00:00:00 2001 From: Jacqueline Molz Date: Wed, 22 Aug 2018 17:26:53 +0200 Subject: Notifying observers of sound properties only by value changes. Fix infinite loop in CAmDltWrapper by logging out enum values exceeding the boundaries. Minor changes: Pull request 36 changed implementation to database macros (review comments) added option "WITH_DATABASE_CHANGE_CHECK" to audiomanagerconfig.h.in whitespace cleanup in test/AmMapHandlerTest/CAmMapHandlerTest.cpp additional cast to uint in DB_UPDATE call in function removeMainConnectionDB to solve error in macro expansion --- AudioManagerUtilities/include/CAmDltWrapper.h | 55 +++++++++++++++------------ 1 file changed, 31 insertions(+), 24 deletions(-) (limited to 'AudioManagerUtilities/include/CAmDltWrapper.h') diff --git a/AudioManagerUtilities/include/CAmDltWrapper.h b/AudioManagerUtilities/include/CAmDltWrapper.h index b6772d9..a86b4dc 100644 --- a/AudioManagerUtilities/include/CAmDltWrapper.h +++ b/AudioManagerUtilities/include/CAmDltWrapper.h @@ -163,14 +163,11 @@ public: { #ifdef WITH_DLT # ifdef DLT_IS_LOG_LEVEL_ENABLED - if (mlogDestination == logDestination::DAEMON) - { - return (dlt_user_is_logLevel_enabled(&mDltContext, logLevel) == DLT_RETURN_TRUE); - } + return (dlt_user_is_logLevel_enabled(&mDltContext, logLevel) == DLT_RETURN_TRUE); # else (void)logLevel; -# endif // ifdef DLT_IS_LOG_LEVEL_ENABLED return true; +# endif #else // ifdef WITH_DLT return (logLevel <= mDltContext.log_level_user); #endif // ifdef WITH_DLT @@ -234,8 +231,9 @@ public: { if (static_cast(value) >= mStr_error.size()) { - append("value for am_Error_e out of bounds!"); - append(static_cast(value)); + std::ostringstream ss; + ss << "value for am_Error_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -248,8 +246,9 @@ public: { if (static_cast(value) >= mStr_sourceState.size()) { - append("value for am_SourceState_e out of bounds!"); - append(static_cast(value)); + std::ostringstream ss; + ss << "value for am_SourceState_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -261,8 +260,9 @@ public: { if (static_cast(value) >= mStr_MuteState.size()) { - append("value for am_MuteState_e out of bounds!"); - append(static_cast(value)); + std::ostringstream ss; + ss << "value for am_MuteState_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -274,8 +274,10 @@ public: { if (static_cast(value) >= mStr_DomainState.size()) { - append("value for am_DomainState_e out of bounds!"); - append(static_cast(value)); + std::ostringstream ss; + ss << "value for am_DomainState_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); + return; } @@ -287,8 +289,9 @@ public: { if (static_cast(value) >= mStr_ConnectionState.size()) { - append("value for am_ConnectionState_e out of bounds!"); - append(static_cast(value)); + std::ostringstream ss; + ss << "value for am_ConnectionState_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -300,8 +303,9 @@ public: { if (static_cast(value) >= mStr_Availability.size()) { - append("value for am_Availability_e out of bounds!"); - append(static_cast(value)); + std::ostringstream ss; + ss << "value for am_Availability_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -313,8 +317,9 @@ public: { if (static_cast(value) >= mStr_Interrupt.size()) { - append("value for am_InterruptState_e out of bounds!"); - append(static_cast(value)); + std::ostringstream ss; + ss << "value for am_InterruptState_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -326,8 +331,9 @@ public: { if (static_cast(value) >= mStr_Handle.size()) { - append("value for am_Handle_e out of bounds!"); - append(static_cast(value)); + std::ostringstream ss; + ss << "value for am_Handle_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -346,8 +352,9 @@ public: { if (static_cast(value) >= mStr_NotificationStatus.size()) { - append("value for am_NotificationStatus_e out of bounds!"); - append(static_cast(value)); + std::ostringstream ss; + ss << "value for am_NotificationStatus_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -368,7 +375,7 @@ public: void append(T value) { std::ostringstream ss; - ss << std::dec << value; + ss << std::dec << static_cast(value); append(ss.str().c_str()); } -- cgit v1.2.1