From 03f2bd35450c2e98c4b561284a38cc335556c514 Mon Sep 17 00:00:00 2001 From: Seungbae Shin Date: Tue, 22 Oct 2019 16:18:42 +0900 Subject: [PATCH] Update coverage exception macros Change-Id: I265dcfdf90fab8960ebbb8a718834738b72d1c59 --- include/CAudioError.h | 1 - src/audio_io_deprecated.c | 3 +- src/cpp/CAudioError.cpp | 11 +------ src/cpp/CAudioIO.cpp | 44 +++++++++++++-------------- src/cpp/CAudioInput.cpp | 56 ++++++++++++++++++++-------------- src/cpp/CAudioOutput.cpp | 46 ++++++++++++++++------------ src/cpp/CPulseAudioClient.cpp | 62 +++++++++++++++++++++++--------------- src/cpp/cpp_audio_in_privilege.cpp | 8 +++-- src/cpp/cpp_audio_io.cpp | 4 +-- 9 files changed, 130 insertions(+), 105 deletions(-) diff --git a/include/CAudioError.h b/include/CAudioError.h index 960bd7d..e6c98eb 100644 --- a/include/CAudioError.h +++ b/include/CAudioError.h @@ -65,7 +65,6 @@ class CAudioError : public std::exception { static constexpr unsigned int MSG_LENGTH = 512; /* Constructor & Destructor */ - explicit CAudioError(EError err); CAudioError(EError err, const char* msg, const char* file, const char* func, int line); ~CAudioError() = default; diff --git a/src/audio_io_deprecated.c b/src/audio_io_deprecated.c index 6c8c1cc..7262db5 100644 --- a/src/audio_io_deprecated.c +++ b/src/audio_io_deprecated.c @@ -44,6 +44,7 @@ typedef void (*audio_io_interrupted_cb)(audio_io_interrupted_code_e code, void * LOGW("DEPRECATION WARNING: %s() is deprecated. Use %s() instead.", __func__, msg); \ } while (0) +//LCOV_EXCL_START int audio_out_create(int sample_rate, audio_channel_e channel, audio_sample_type_e type, sound_type_e sound_type, audio_out_h* output) { DEPRECATED_WARN_INSTEAD("audio_out_create_new"); @@ -59,5 +60,5 @@ int audio_out_set_interrupted_cb(audio_out_h output, audio_io_interrupted_cb cal /* dummy, do nothing */ return AUDIO_IO_ERROR_NONE; } - +//LCOV_EXCL_STOP diff --git a/src/cpp/CAudioError.cpp b/src/cpp/CAudioError.cpp index cfd3422..5776d32 100644 --- a/src/cpp/CAudioError.cpp +++ b/src/cpp/CAudioError.cpp @@ -36,17 +36,8 @@ CAudioError::CAudioError(EError err, const char* msg, const char* file, const ch __mFullMsg = __mErrorMsg; } -CAudioError::CAudioError(EError err) : - __mError(err), - __mMsg(nullptr) { - char __mErrorMsg[MSG_LENGTH] = { 0, }; - snprintf(__mErrorMsg, MSG_LENGTH, "[%s]", __convertErrorToString(__mError)); - - __mFullMsg = __mErrorMsg; -} - const char* CAudioError::getErrorMsg() const noexcept { - return __mFullMsg.c_str(); + return what(); } const CAudioError::EError CAudioError::getError() const noexcept { diff --git a/src/cpp/CAudioIO.cpp b/src/cpp/CAudioIO.cpp index a1786c2..b1a278c 100644 --- a/src/cpp/CAudioIO.cpp +++ b/src/cpp/CAudioIO.cpp @@ -69,7 +69,7 @@ bool CAudioIO::IsReady() { void CAudioIO::internalLock() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE if (pthread_mutex_lock(&__mMutex) != 0) THROW_ERROR_MSG(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pthread_mutex_lock()"); //LCOV_EXCL_LINE @@ -81,7 +81,7 @@ void CAudioIO::internalLock() { void CAudioIO::internalUnlock() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE if (pthread_mutex_unlock(&__mMutex) != 0) THROW_ERROR_MSG(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pthread_mutex_lock()"); //LCOV_EXCL_LINE @@ -93,7 +93,7 @@ void CAudioIO::internalUnlock() { void CAudioIO::internalWait() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE #ifdef _AUDIO_IO_DEBUG_TIMING_ AUDIO_IO_LOGD(COLOR_RED "WAIT" COLOR_END); @@ -106,7 +106,7 @@ void CAudioIO::internalWait() { void CAudioIO::internalSignal() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE #ifdef _AUDIO_IO_DEBUG_TIMING_ AUDIO_IO_LOGD(COLOR_GREEN "SIGNAL" COLOR_END); @@ -218,17 +218,17 @@ CAudioInfo::EAudioIOState CAudioIO::getState() noexcept { void CAudioIO::prepare() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE } void CAudioIO::unprepare() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE } void CAudioIO::pause() { if (!__mIsInit || !IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize or prepare CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize or prepare CAudioIO"); //LCOV_EXCL_LINE try { internalLock(); @@ -243,7 +243,7 @@ void CAudioIO::pause() { void CAudioIO::resume() { if (!__mIsInit || !IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize or prepare CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize or prepare CAudioIO"); //LCOV_EXCL_LINE try { internalLock(); @@ -258,7 +258,7 @@ void CAudioIO::resume() { void CAudioIO::drain() { if (!__mIsInit || !IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize or prepare CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize or prepare CAudioIO"); //LCOV_EXCL_LINE try { if (mpPulseAudioClient->isInThread()) { @@ -277,7 +277,7 @@ void CAudioIO::drain() { void CAudioIO::flush() { if (!__mIsInit || !IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize or prepare CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize or prepare CAudioIO"); //LCOV_EXCL_LINE try { if (mpPulseAudioClient->isInThread()) { @@ -296,48 +296,48 @@ void CAudioIO::flush() { CAudioInfo& CAudioIO::getAudioInfo() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE return mAudioInfo; } void CAudioIO::setStreamCallback(SStreamCallback callback) { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE mStreamCallback = callback; } CAudioIO::SStreamCallback CAudioIO::getStreamCallback() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE return mStreamCallback; } void CAudioIO::setStateChangedCallback(SStateChangedCallback callback) { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE mStateChangedCallback = callback; } CAudioIO::SStateChangedCallback CAudioIO::getStateChangedCallback() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE return mStateChangedCallback; } void CAudioIO::setStreamInfo(sound_stream_info_h stream_info) { if (!stream_info) - THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_ARGUMENT, "stream_info is NULL"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_ARGUMENT, "stream_info is NULL"); //LCOV_EXCL_LINE if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Doesn't initialize CAudioIO"); //LCOV_EXCL_LINE if (mState != CAudioInfo::EAudioIOState::AUDIO_IO_STATE_IDLE) - THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_STATE, "it is not permitted while started"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_STATE, "it is not permitted while started"); //LCOV_EXCL_LINE int errorCode = SOUND_MANAGER_ERROR_NONE; char *type = nullptr; @@ -345,18 +345,18 @@ void CAudioIO::setStreamInfo(sound_stream_info_h stream_info) { bool avail = false; if ((errorCode = sound_manager_is_available_stream_information(stream_info, NATIVE_API_AUDIO_IO, &avail)) != SOUND_MANAGER_ERROR_NONE) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info is invalid [ret:%d]", errorCode); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info is invalid [ret:%d]", errorCode); //LCOV_EXCL_LINE if (!avail) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_SUPPORTED_TYPE, "Input stream is not supported"); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_SUPPORTED_TYPE, "Input stream is not supported"); //LCOV_EXCL_LINE 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().setAudioTypeByInputStreamType(type); else getAudioInfo().setAudioTypeByOutputStreamType(type); 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); } diff --git a/src/cpp/CAudioInput.cpp b/src/cpp/CAudioInput.cpp index d930137..8b6633f 100644 --- a/src/cpp/CAudioInput.cpp +++ b/src/cpp/CAudioInput.cpp @@ -83,8 +83,10 @@ void CAudioInput::initialize() { CAudioIO::initialize(); __setInit(true); } catch (const CAudioError& e) { +//LCOV_EXCL_START finalize(); throw; +//LCOV_EXCL_STOP } CAudioIO::onStateChanged(CAudioInfo::EAudioIOState::AUDIO_IO_STATE_IDLE); @@ -92,8 +94,10 @@ void CAudioInput::initialize() { void CAudioInput::finalize() { if (!__IsInit()) { +//LCOV_EXCL_START AUDIO_IO_LOGD("Did not initialize"); return; +//LCOV_EXCL_STOP } CAudioIO::finalize(); @@ -103,7 +107,7 @@ void CAudioInput::finalize() { void CAudioInput::prepare() { if (!__IsInit()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CAudioInput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CAudioInput"); //LCOV_EXCL_LINE if (__IsReady()) { AUDIO_IO_LOGD("Already prepared CAudioInput"); @@ -139,10 +143,12 @@ void CAudioInput::prepare() { CAudioIO::prepare(); } catch (const CAudioError& e) { +//LCOV_EXCL_START SAFE_FINALIZE(mpPulseAudioClient); SAFE_DELETE(mpPulseAudioClient); internalUnlock(); throw; +//LCOV_EXCL_STOP } catch (const std::bad_alloc&) { //LCOV_EXCL_START internalUnlock(); @@ -153,8 +159,8 @@ void CAudioInput::prepare() { void CAudioInput::unprepare() { if (!__IsInit()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize CAudioInput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize CAudioInput"); //LCOV_EXCL_LINE if (!__IsReady()) { AUDIO_IO_LOGD("Already unprepared"); @@ -171,8 +177,10 @@ void CAudioInput::unprepare() { SAFE_DELETE(mpPulseAudioClient); internalUnlock(); } catch (const CAudioError& e) { +//LCOV_EXCL_START internalUnlock(); throw; +//LCOV_EXCL_STOP } CAudioIO::onStateChanged(CAudioInfo::EAudioIOState::AUDIO_IO_STATE_IDLE); @@ -180,15 +188,15 @@ void CAudioInput::unprepare() { void CAudioInput::pause() { if (!__IsInit() || !__IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioInput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioInput"); //LCOV_EXCL_LINE if (CAudioIO::getState() != CAudioInfo::EAudioIOState::AUDIO_IO_STATE_RUNNING) THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_STATE, "Can't pause if not in Running state"); if (mpPulseAudioClient->isInThread()) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_OPERATION, "Can't pause in thread"); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_OPERATION, "Can't pause in thread"); //LCOV_EXCL_LINE CAudioIO::pause(); CAudioIO::onStateChanged(CAudioInfo::EAudioIOState::AUDIO_IO_STATE_PAUSED); @@ -196,15 +204,15 @@ void CAudioInput::pause() { void CAudioInput::resume() { if (!__IsInit() || !__IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioInput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioInput"); //LCOV_EXCL_LINE if (CAudioIO::getState() != CAudioInfo::EAudioIOState::AUDIO_IO_STATE_PAUSED) THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_STATE, "Can't resume if not in Paused state"); if (mpPulseAudioClient->isInThread()) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_OPERATION, "Can't resume in thread"); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_OPERATION, "Can't resume in thread"); //LCOV_EXCL_LINE CAudioIO::resume(); CAudioIO::onStateChanged(CAudioInfo::EAudioIOState::AUDIO_IO_STATE_RUNNING); @@ -212,15 +220,15 @@ void CAudioInput::resume() { void CAudioInput::flush() { if (!__IsInit() || !__IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioInput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioInput"); //LCOV_EXCL_LINE CAudioIO::flush(); } int CAudioInput::getBufferSize() { if (!__IsInit()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CAudioInput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CAudioInput"); //LCOV_EXCL_LINE /* FIXME : return calculated size here to satisfy backward compatibility */ return (mAudioInfo.getSampleRate() * DEFAULT_PERIOD_SIZE) / 1000 * mAudioInfo.getSampleSize(); @@ -228,7 +236,7 @@ int CAudioInput::getBufferSize() { void CAudioInput::setStreamCallback(SStreamCallback callback) { if (!__IsInit()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CAudioInput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CAudioInput"); //LCOV_EXCL_LINE __mIsUsedSyncRead = (callback.onStream == nullptr); @@ -239,8 +247,8 @@ void CAudioInput::setStreamCallback(SStreamCallback callback) { size_t CAudioInput::read(void* buffer, size_t length) { if (!__IsInit() || !__IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioInput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioInput"); //LCOV_EXCL_LINE if (!buffer) THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, @@ -262,8 +270,8 @@ size_t CAudioInput::read(void* buffer, size_t length) { // If another thread did call unprepare, do not read if (!mpPulseAudioClient) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize CPulseAudioClient"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize CPulseAudioClient"); //LCOV_EXCL_LINE // Block until read done ret = mpPulseAudioClient->read(buffer, length); @@ -271,8 +279,10 @@ size_t CAudioInput::read(void* buffer, size_t length) { sched_yield(); } catch (const CAudioError& e) { +//LCOV_EXCL_START internalUnlock(); throw; +//LCOV_EXCL_STOP } return ret; @@ -280,12 +290,12 @@ size_t CAudioInput::read(void* buffer, size_t length) { int CAudioInput::peek(const void** buffer, size_t* length) { if (!__IsInit() || !__IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioInput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioInput"); //LCOV_EXCL_LINE if (buffer == nullptr || length == nullptr) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, - "Parameters are NULL buffer:%p, length:%p", buffer, length); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, //LCOV_EXCL_LINE + "Parameters are NULL buffer:%p, length:%p", buffer, length); //LCOV_EXCL_LINE /* Checks synchronous flag */ if (__mIsUsedSyncRead) @@ -297,8 +307,8 @@ int CAudioInput::peek(const void** buffer, size_t* length) { int CAudioInput::drop() { if (!__IsInit() || !__IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioInput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioInput"); //LCOV_EXCL_LINE /* Checks synchronous flag */ if (__mIsUsedSyncRead) diff --git a/src/cpp/CAudioOutput.cpp b/src/cpp/CAudioOutput.cpp index 8308d4f..8a84f29 100644 --- a/src/cpp/CAudioOutput.cpp +++ b/src/cpp/CAudioOutput.cpp @@ -78,8 +78,10 @@ void CAudioOutput::initialize() { CAudioIO::initialize(); __setInit(true); } catch (const CAudioError& e) { +//LCOV_EXCL_START finalize(); throw; +//LCOV_EXCL_STOP } CAudioIO::onStateChanged(CAudioInfo::EAudioIOState::AUDIO_IO_STATE_IDLE); @@ -98,12 +100,14 @@ void CAudioOutput::finalize() { void CAudioOutput::prepare() { if (!__IsInit()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CAudioOutput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CAudioOutput"); //LCOV_EXCL_LINE if (__IsReady()) { +//LCOV_EXCL_START AUDIO_IO_LOGD("Already prepared CAudioOutput"); CAudioIO::prepare(); return; +//LCOV_EXCL_STOP } /* Check invalid AudioType */ @@ -144,10 +148,12 @@ void CAudioOutput::prepare() { CAudioIO::prepare(); } catch (const CAudioError& e) { +//LCOV_EXCL_START SAFE_FINALIZE(mpPulseAudioClient); SAFE_DELETE(mpPulseAudioClient); internalUnlock(); throw; +//LCOV_EXCL_STOP } catch (const std::bad_alloc&) { //LCOV_EXCL_START internalUnlock(); @@ -158,8 +164,8 @@ void CAudioOutput::prepare() { void CAudioOutput::unprepare() { if (!__IsInit()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize CAudioOutput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize CAudioOutput"); //LCOV_EXCL_LINE if (!__IsReady()) { AUDIO_IO_LOGD("Already unprepared"); @@ -176,8 +182,10 @@ void CAudioOutput::unprepare() { SAFE_DELETE(mpPulseAudioClient); internalUnlock(); } catch (const CAudioError& e) { +//LCOV_EXCL_START internalUnlock(); throw; +//LCOV_EXCL_STOP } CAudioIO::onStateChanged(CAudioInfo::EAudioIOState::AUDIO_IO_STATE_IDLE); @@ -185,15 +193,15 @@ void CAudioOutput::unprepare() { void CAudioOutput::pause() { if (!__IsInit() || !__IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioOutput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioOutput"); //LCOV_EXCL_LINE if (CAudioIO::getState() != CAudioInfo::EAudioIOState::AUDIO_IO_STATE_RUNNING) THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_STATE, "Can't pause if not in Running state"); if (mpPulseAudioClient->isInThread() ) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_OPERATION, "Can't pause in thread"); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_OPERATION, "Can't pause in thread"); //LCOV_EXCL_LINE CAudioIO::pause(); CAudioIO::onStateChanged(CAudioInfo::EAudioIOState::AUDIO_IO_STATE_PAUSED); @@ -201,15 +209,15 @@ void CAudioOutput::pause() { void CAudioOutput::resume() { if (!__IsInit() || !__IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioOutput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioOutput"); //LCOV_EXCL_LINE if (CAudioIO::getState() != CAudioInfo::EAudioIOState::AUDIO_IO_STATE_PAUSED) THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_STATE, "Can't resume if not in Paused state"); if (mpPulseAudioClient->isInThread()) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_OPERATION, "Can't resume in thread"); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_OPERATION, "Can't resume in thread"); //LCOV_EXCL_LINE CAudioIO::resume(); CAudioIO::onStateChanged(CAudioInfo::EAudioIOState::AUDIO_IO_STATE_RUNNING); @@ -217,8 +225,8 @@ void CAudioOutput::resume() { void CAudioOutput::drain() { if (!__IsInit() || !__IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioOutput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioOutput"); //LCOV_EXCL_LINE if (mStreamCallback.onStream) THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_OPERATION, "async type don't support drain"); @@ -228,16 +236,16 @@ void CAudioOutput::drain() { void CAudioOutput::flush() { if (!__IsInit() || !__IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioOutput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioOutput"); //LCOV_EXCL_LINE CAudioIO::flush(); } int CAudioOutput::getBufferSize() { if (!__IsInit()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioOutput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioOutput"); //LCOV_EXCL_LINE /* FIXME : return calculated size here to satisfy backward compatibility */ return (mAudioInfo.getSampleRate() * DEFAULT_PERIOD_SIZE) / 1000 * mAudioInfo.getSampleSize(); @@ -245,8 +253,8 @@ int CAudioOutput::getBufferSize() { size_t CAudioOutput::write(const void* buffer, size_t length) { if (!__IsInit() || !__IsReady()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize or prepare CAudioOutput"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize or prepare CAudioOutput"); //LCOV_EXCL_LINE if (!buffer) THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, @@ -274,8 +282,8 @@ size_t CAudioOutput::write(const void* buffer, size_t length) { // If another thread did call unprepare, do not write if (!mpPulseAudioClient) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, - "Did not initialize CPulseAudioClient"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, //LCOV_EXCL_LINE + "Did not initialize CPulseAudioClient"); //LCOV_EXCL_LINE // Sets synchronous flag __mIsUsedSyncWrite = true; diff --git a/src/cpp/CPulseAudioClient.cpp b/src/cpp/CPulseAudioClient.cpp index ef7ddb3..c3f68c9 100644 --- a/src/cpp/CPulseAudioClient.cpp +++ b/src/cpp/CPulseAudioClient.cpp @@ -125,8 +125,8 @@ void CPulseAudioClient::__streamStateChangeCb(pa_stream* s, void* user_data) { pa_threaded_mainloop_signal(pClient->__mpMainloop, 0); break; - case PA_STREAM_FAILED: //LCOV_EXCL_START + case PA_STREAM_FAILED: AUDIO_IO_LOGD("The stream is failed"); pClient->__mpListener->onStateChanged(CAudioInfo::EAudioIOState::AUDIO_IO_STATE_IDLE, __is_microphone_restricted()); @@ -328,8 +328,10 @@ void CPulseAudioClient::initialize() { // Start mainloop if (pa_threaded_mainloop_start(__mpMainloop) < 0) { +//LCOV_EXCL_START pa_threaded_mainloop_unlock(__mpMainloop); - THROW_ERROR_MSG(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_threaded_mainloop_start()"); //LCOV_EXCL_LINE + THROW_ERROR_MSG(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_threaded_mainloop_start()"); +//LCOV_EXCL_STOP } // Connection process is asynchronously @@ -435,8 +437,10 @@ void CPulseAudioClient::initialize() { // __mIsInit = true; // Moved to __streamStateChangeCb() } catch (const CAudioError& e) { +//LCOV_EXCL_START finalize(); throw; +//LCOV_EXCL_END } } @@ -498,15 +502,15 @@ void CPulseAudioClient::finalize() { int CPulseAudioClient::read(void* buffer, size_t length) { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); //LCOV_EXCL_LINE checkRunningState(); if (!buffer) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "The parameter is invalid : buffer[%p]", buffer); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "The parameter is invalid : buffer[%p]", buffer); //LCOV_EXCL_LINE if (__mDirection == EStreamDirection::STREAM_DIRECTION_PLAYBACK) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "The Playback client couldn't use this function"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "The Playback client couldn't use this function"); //LCOV_EXCL_LINE size_t lengthIter = length; int ret = 0; @@ -522,7 +526,7 @@ int CPulseAudioClient::read(void* buffer, size_t length) { while (!__mpSyncReadDataPtr) { ret = pa_stream_peek(__mpStream, &__mpSyncReadDataPtr, &__mSyncReadLength); if (ret != 0) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pa_stream_peek() : ret[%d]", ret); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pa_stream_peek() : ret[%d]", ret); //LCOV_EXCL_LINE if (__mSyncReadLength <= 0) { #ifdef _AUDIO_IO_DEBUG_TIMING_ @@ -530,10 +534,12 @@ int CPulseAudioClient::read(void* buffer, size_t length) { #endif pa_threaded_mainloop_wait(__mpMainloop); } else if (!__mpSyncReadDataPtr) { +// LCOV_EXCL_START // Data peeked, but it doesn't have any data ret = pa_stream_drop(__mpStream); if (ret != 0) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pa_stream_drop() : ret[%d]", ret); //LCOV_EXCL_LINE + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pa_stream_drop() : ret[%d]", ret); +//LCOV_EXCL_STOP } else { __mSyncReadIndex = 0; } @@ -573,9 +579,11 @@ int CPulseAudioClient::read(void* buffer, size_t length) { pa_threaded_mainloop_unlock(__mpMainloop); __mIsUsedSyncRead = false; } catch (const CAudioError& e) { +// LCOV_EXCL_START pa_threaded_mainloop_unlock(__mpMainloop); __mIsUsedSyncRead = false; throw; +// LCOV_EXCL_STOP } return length; @@ -583,15 +591,16 @@ int CPulseAudioClient::read(void* buffer, size_t length) { int CPulseAudioClient::peek(const void** buffer, size_t* length) { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); // LCOV_EXCL_LINE checkRunningState(); if (!buffer || !length) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "The parameter is invalid : buffer[%p], length[%p]", buffer, length); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, // LCOV_EXCL_LINE + "The parameter is invalid : buffer[%p], length[%p]", buffer, length); // LCOV_EXCL_LINE if (__mDirection == EStreamDirection::STREAM_DIRECTION_PLAYBACK) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "The Playback client couldn't use this function"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "The Playback client couldn't use this function"); // LCOV_EXCL_LINE int ret = 0; @@ -615,7 +624,7 @@ int CPulseAudioClient::peek(const void** buffer, size_t* length) { int CPulseAudioClient::drop() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); // LCOV_EXCL_LINE #ifdef _AUDIO_IO_DEBUG_TIMING_ AUDIO_IO_LOGD(""); @@ -624,7 +633,7 @@ int CPulseAudioClient::drop() { checkRunningState(); if (__mDirection == EStreamDirection::STREAM_DIRECTION_PLAYBACK) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "The Playback client couldn't use this function"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "The Playback client couldn't use this function"); // LCOV_EXCL_LINE int ret = 0; @@ -644,10 +653,10 @@ int CPulseAudioClient::drop() { int CPulseAudioClient::write(const void* data, size_t length) { if (!data) - THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_ARGUMENT, "The parameter is invalid"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_ARGUMENT, "The parameter is invalid"); // LCOV_EXCL_LINE if (__mDirection == EStreamDirection::STREAM_DIRECTION_RECORD) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "The Playback client couldn't use this function"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "The Playback client couldn't use this function"); // LCOV_EXCL_LINE int ret = 0; @@ -665,6 +674,7 @@ int CPulseAudioClient::write(const void* data, size_t length) { ret = pa_stream_write(__mpStream, data, length, NULL, 0LL, PA_SEEK_RELATIVE); pa_threaded_mainloop_unlock(__mpMainloop); } else { +// LCOV_EXCL_START if (pa_stream_is_corked(__mpStream)) { AUDIO_IO_LOGW("stream is corked...do uncork here first!!!!"); pa_operation_unref(pa_stream_cork(__mpStream, 0, NULL, this)); @@ -686,6 +696,7 @@ int CPulseAudioClient::write(const void* data, size_t length) { length, prebuf, (length < prebuf) ? prebuf - length : 0); } ret = pa_stream_write(__mpStream, data, length, NULL, 0LL, PA_SEEK_RELATIVE); +// LCOV_EXCL_STOP } if (ret < 0) @@ -698,10 +709,10 @@ void CPulseAudioClient::cork(bool cork) { AUDIO_IO_LOGD("cork[%d]", cork); if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); // LCOV_EXCL_LINE if (isInThread()) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "This operation is not supported in callback"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "This operation is not supported in callback"); // LCOV_EXCL_LINE checkRunningState(); @@ -720,7 +731,7 @@ void CPulseAudioClient::cork(bool cork) { bool CPulseAudioClient::isCorked() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); // LCOV_EXCL_LINE checkRunningState(); @@ -742,7 +753,7 @@ bool CPulseAudioClient::isCorked() { bool CPulseAudioClient::drain() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); // LCOV_EXCL_LINE checkRunningState(); @@ -783,7 +794,7 @@ bool CPulseAudioClient::drain() { bool CPulseAudioClient::flush() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); // LCOV_EXCL_LINE checkRunningState(); @@ -802,12 +813,12 @@ bool CPulseAudioClient::flush() { size_t CPulseAudioClient::getWritableSize() { if (!__mIsInit) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient"); // LCOV_EXCL_LINE checkRunningState(); if (__mDirection != EStreamDirection::STREAM_DIRECTION_PLAYBACK) - THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "This client is used for Playback"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_SUPPORTED, "This client is used for Playback"); // LCOV_EXCL_LINE size_t ret = 0; @@ -824,13 +835,16 @@ size_t CPulseAudioClient::getWritableSize() { void CPulseAudioClient::checkRunningState() { if (!__mpContext || !PA_CONTEXT_IS_GOOD(pa_context_get_state(__mpContext))) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_INITIALIZED, "The context[%p] is not created or not good state", __mpContext); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_INITIALIZED, // LCOV_EXCL_LINE + "The context[%p] is not created or not good state", __mpContext); // LCOV_EXCL_LINE if (!__mpStream || !PA_STREAM_IS_GOOD(pa_stream_get_state(__mpStream))) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_INITIALIZED, "The stream[%p] is not created or not good state", __mpStream); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_INITIALIZED, // LCOV_EXCL_LINE + "The stream[%p] is not created or not good state", __mpStream); // LCOV_EXCL_LINE if (pa_context_get_state(__mpContext) != PA_CONTEXT_READY || pa_stream_get_state(__mpStream) != PA_STREAM_READY) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_INITIALIZED, "The context[%p] or stream[%p] state is not ready", __mpContext, __mpStream); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_INITIALIZED, // LCOV_EXCL_LINE + "The context[%p] or stream[%p] state is not ready", __mpContext, __mpStream); // LCOV_EXCL_LINE #ifdef _AUDIO_IO_DEBUG_TIMING_ AUDIO_IO_LOGD("This client is running"); diff --git a/src/cpp/cpp_audio_in_privilege.cpp b/src/cpp/cpp_audio_in_privilege.cpp index 9efc812..e79283a 100644 --- a/src/cpp/cpp_audio_in_privilege.cpp +++ b/src/cpp/cpp_audio_in_privilege.cpp @@ -75,11 +75,11 @@ bool cpp_audio_in_has_record_privilege(void) { prData.paMainloop = pa_threaded_mainloop_new(); if (!prData.paMainloop) - THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_threaded_mainloop_new()"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_threaded_mainloop_new()"); // LCOV_EXCL_LINE c = pa_context_new(pa_threaded_mainloop_get_api(prData.paMainloop), CLIENT_NAME); if (!c) - THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_context_new()"); + THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_context_new()"); // LCOV_EXCL_LINE pa_context_set_state_callback(c, __contextStateChangeCb, prData.paMainloop); @@ -89,8 +89,10 @@ bool cpp_audio_in_has_record_privilege(void) { pa_threaded_mainloop_lock(prData.paMainloop); if (pa_threaded_mainloop_start(prData.paMainloop) < 0) { +// LCOV_EXCL_START pa_threaded_mainloop_unlock(prData.paMainloop); - THROW_ERROR_MSG(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_threaded_mainloop_start()"); //LCOV_EXCL_LINE + THROW_ERROR_MSG(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_threaded_mainloop_start()"); +// LCOV_EXCL_STOP } while (true) { diff --git a/src/cpp/cpp_audio_io.cpp b/src/cpp/cpp_audio_io.cpp index 4d4e2b3..d4fe6f3 100644 --- a/src/cpp/cpp_audio_io.cpp +++ b/src/cpp/cpp_audio_io.cpp @@ -702,7 +702,7 @@ int cpp_audio_in_peek(audio_in_h input, const void **buffer, unsigned int *lengt auto inputHandle = static_cast(handle->audioIoHandle); if (!inputHandle) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_HANDLE, "Handle is NULL"); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_HANDLE, "Handle is NULL"); // LCOV_EXCL_LINE inputHandle->peek(buffer, &_length); } catch (const CAudioError& e) { @@ -724,7 +724,7 @@ int cpp_audio_in_drop(audio_in_h input) { auto inputHandle = static_cast(handle->audioIoHandle); if (!inputHandle) - THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_HANDLE, "Handle is NULL"); + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_HANDLE, "Handle is NULL"); // LCOV_EXCL_LINE inputHandle->drop(); } catch (const CAudioError& e) { -- 2.7.4