Exclude more coverage check which can't be covered by this module
[platform/core/api/audio-io.git] / src / cpp / CAudioIO.cpp
index e8b6ab7..1d44607 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 
-#include <mm.h>
 #include <pthread.h>
 #include <assert.h>
 #include "CAudioIODef.h"
@@ -28,6 +27,7 @@ using namespace tizen_media_audio;
 /**
  * class CAudioIO
  */
+//LCOV_EXCL_START
 CAudioIO::CAudioIO() :
     mpPulseAudioClient(NULL),
     __mMutex(PTHREAD_MUTEX_INITIALIZER),
@@ -39,6 +39,7 @@ CAudioIO::CAudioIO() :
     mStatePrev = CAudioInfo::EAudioIOState::AUDIO_IO_STATE_NONE;
     mByPolicy = false;
 }
+//LCOV_EXCL_STOP
 
 CAudioIO::CAudioIO(CAudioInfo& audioInfo) :
     mpPulseAudioClient(NULL),
@@ -74,7 +75,7 @@ void CAudioIO::internalLock() {
         THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO");
 
     if (pthread_mutex_lock(&__mMutex) != 0)
-        THROW_ERROR_MSG(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pthread_mutex_lock()");
+        THROW_ERROR_MSG(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pthread_mutex_lock()"); //LCOV_EXCL_LINE
 
 #ifdef _AUDIO_IO_DEBUG_TIMING_
     AUDIO_IO_LOGD(COLOR_RED "%p LOCKED" COLOR_END, &__mMutex);
@@ -86,7 +87,7 @@ void CAudioIO::internalUnlock() {
         THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO");
 
     if (pthread_mutex_unlock(&__mMutex) != 0)
-        THROW_ERROR_MSG(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pthread_mutex_lock()");
+        THROW_ERROR_MSG(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pthread_mutex_lock()"); //LCOV_EXCL_LINE
 
 #ifdef _AUDIO_IO_DEBUG_TIMING_
     AUDIO_IO_LOGD(COLOR_GREEN "%p UNLOCKED" COLOR_END, &__mMutex);
@@ -127,11 +128,11 @@ void CAudioIO::initialize() {
 
     int ret = pthread_mutex_init(&__mMutex, NULL);
     if (ret != 0)
-        THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pthread_mutex_init()");
+        THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pthread_mutex_init()"); //LCOV_EXCL_LINE
 
     ret = pthread_cond_init(&__mCond, NULL);
     if (ret != 0)
-        THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pthread_cond_init()");
+        THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pthread_cond_init()"); //LCOV_EXCL_LINE
 
     __mIsInit = true;
 }
@@ -145,20 +146,24 @@ void CAudioIO::finalize() {
     bool error_occured = false;
     int ret = pthread_mutex_destroy(&__mMutex);
     if (ret != 0) {
-        AUDIO_IO_LOGE("Failed pthread_mutex_destroy(%p) errno:%d", &__mMutex, ret);
+        AUDIO_IO_LOGE("Failed pthread_mutex_destroy(%p) errno:%d", &__mMutex, ret); //LCOV_EXCL_LINE
         error_occured = true;
     }
 
     ret = pthread_mutex_destroy(&__mCondMutex);
     if (ret != 0) {
+//LCOV_EXCL_START
         AUDIO_IO_LOGE("Failed cond pthread_mutex_destroy(%p) errno:%d", &__mCondMutex, ret);
         error_occured = true;
+//LCOV_EXCL_STOP
     }
 
     ret = pthread_cond_destroy(&__mCond);
     if (ret != 0) {
+//LCOV_EXCL_START
         AUDIO_IO_LOGE("Failed pthread_cond_destroy(%p) errno:%d", &__mCond, ret);
         error_occured = true;
+//LCOV_EXCL_STOP
     }
 
     if (error_occured)
@@ -348,7 +353,7 @@ void CAudioIO::setStreamInfo(sound_stream_info_h stream_info) {
             THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_SUPPORTED_TYPE, "Input stream is not supported");
 
         if ((errorCode = sound_manager_get_type_from_stream_information(stream_info, &type)) != SOUND_MANAGER_ERROR_NONE)
-            THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info->stream_type is invalid [ret:%d]", errorCode);
+            THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info->stream_type is invalid [ret:%d]", errorCode); //LCOV_EXCL_LINE
         if (mDirection == CAudioInfo::EAudioDirection::AUDIO_DIRECTION_IN)
             getAudioInfo().convertInputStreamType2AudioType(type, &audioType);
         else
@@ -356,7 +361,7 @@ void CAudioIO::setStreamInfo(sound_stream_info_h stream_info) {
         getAudioInfo().setAudioType(audioType);
 
         if ((errorCode = sound_manager_get_index_from_stream_information(stream_info, &index)) != SOUND_MANAGER_ERROR_NONE)
-            THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info->index is invalid [ret:%d]", errorCode);
+            THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info->index is invalid [ret:%d]", errorCode); //LCOV_EXCL_LINE
         getAudioInfo().setAudioIndex(index);
 
     } catch (CAudioError& e) {