Patch for coverage
[platform/core/api/audio-io.git] / src / cpp / cpp_audio_io.cpp
index 8df8dde..182d929 100644 (file)
@@ -390,10 +390,12 @@ int cpp_audio_in_create(int sample_rate, audio_channel_e channel, audio_sample_t
         __handle_safe_free(handle, (void *)input, false);
         return __convert_CAudioError(e);
     } catch (const std::bad_alloc&) {
+//LCOV_EXCL_START
         CAudioError e = CAudioError::EError::ERROR_OUT_OF_MEMORY;
         AUDIO_IO_LOGE("Failed to allocate handle");
         __handle_safe_free(handle, (void *)input, false);
         return __convert_CAudioError(e);
+//LCOV_EXCL_STOP
     }
 
     return AUDIO_IO_ERROR_NONE;
@@ -530,6 +532,7 @@ int cpp_audio_in_resume(audio_in_h input) {
     return AUDIO_IO_ERROR_NONE;
 }
 
+//LCOV_EXCL_START
 int cpp_audio_in_drain(audio_in_h input) {
     audio_io_s* handle = static_cast<audio_io_s*>(input);
 
@@ -550,6 +553,7 @@ int cpp_audio_in_drain(audio_in_h input) {
 
     return AUDIO_IO_ERROR_NONE;
 }
+//LCOV_EXCL_STOP
 
 int cpp_audio_in_flush(audio_in_h input) {
     audio_io_s* handle = static_cast<audio_io_s*>(input);
@@ -692,6 +696,7 @@ static void __stream_cb_internal(size_t nbytes, void *user_data) {
         audioIo->stream_callback.onStream(audioIo, nbytes, audioIo->stream_callback.user_data);
 }
 
+//LCOV_EXCL_START
 static void __state_changed_cb_internal(CAudioInfo::EAudioIOState state,
                                         CAudioInfo::EAudioIOState state_prev,
                                         bool by_policy,
@@ -704,6 +709,7 @@ static void __state_changed_cb_internal(CAudioInfo::EAudioIOState state,
                                                        __convert_state_type(state), by_policy,
                                                        audioIo->state_changed_callback.user_data);
 }
+//LCOV_EXCL_STOP
 
 int cpp_audio_in_set_stream_cb(audio_in_h input, audio_in_stream_cb callback, void* user_data) {
     audio_io_s* handle = static_cast<audio_io_s*>(input);
@@ -889,10 +895,12 @@ int cpp_audio_out_create_new(int sample_rate, audio_channel_e channel, audio_sam
         __handle_safe_free(handle, (void *)output, true);
         return __convert_CAudioError(e);
     } catch (const std::bad_alloc&) {
+//LCOV_EXCL_START
         CAudioError e = CAudioError::EError::ERROR_OUT_OF_MEMORY;
         AUDIO_IO_LOGE("Failed to allocate handle");
         __handle_safe_free(handle, (void *)output, true);
         return __convert_CAudioError(e);
+//LCOV_EXCL_STOP
     }
 
     return AUDIO_IO_ERROR_NONE;