diff --git a/daemon/src/audio/alsa/alsalayer.cpp b/daemon/src/audio/alsa/alsalayer.cpp index 6acb6f8ed8f597e6f44347b221911d61d79159aa..4c9d344bf697b86499ba749814626b449f6f850c 100644 --- a/daemon/src/audio/alsa/alsalayer.cpp +++ b/daemon/src/audio/alsa/alsalayer.cpp @@ -113,7 +113,7 @@ bool AlsaLayer::openDevice(snd_pcm_t **pcm, const std::string &dev, snd_pcm_stre } if (err < 0) { - _error("Alsa: couldn't open device %s : %s", dev.c_str(), + ERROR("Alsa: couldn't open device %s : %s", dev.c_str(), snd_strerror(err)); return false; } @@ -218,7 +218,7 @@ AlsaLayer::stopStream() #define ALSA_CALL(call, error) ({ \ int err_code = call; \ if (err_code < 0) \ - _error("ALSA: "error": %s", snd_strerror(err_code)); \ + ERROR("ALSA: "error": %s", snd_strerror(err_code)); \ err_code; \ }) @@ -320,7 +320,7 @@ bool AlsaLayer::alsa_set_params(snd_pcm_t *pcm_handle) TRY(snd_pcm_hw_params(HW), "hwparams"); #undef HW - _debug("ALSA: %s using sampling rate %dHz", + DEBUG("ALSA: %s using sampling rate %dHz", (snd_pcm_stream(pcm_handle) == SND_PCM_STREAM_PLAYBACK) ? "playback" : "capture", audioSampleRate_); @@ -369,7 +369,7 @@ AlsaLayer::write(void* buffer, int length, snd_pcm_t * handle) } default: - _error("ALSA: unknown write error, dropping frames: %s", snd_strerror(err)); + ERROR("ALSA: unknown write error, dropping frames: %s", snd_strerror(err)); stopPlaybackStream(); break; } @@ -404,12 +404,12 @@ AlsaLayer::read(void* buffer, int toCopy) startCaptureStream(); } - _error("ALSA: XRUN capture ignored (%s)", snd_strerror(err)); + ERROR("ALSA: XRUN capture ignored (%s)", snd_strerror(err)); break; } case EPERM: - _error("ALSA: Can't capture, EPERM (%s)", snd_strerror(err)); + ERROR("ALSA: Can't capture, EPERM (%s)", snd_strerror(err)); prepareCaptureStream(); startCaptureStream(); break; @@ -459,9 +459,9 @@ AlsaLayer::getSoundCardsInfo(int stream) snd_pcm_info_set_stream(pcminfo, (stream == SFL_PCM_CAPTURE) ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK); if (snd_ctl_pcm_info(handle ,pcminfo) < 0) - _debug(" Cannot get info"); + DEBUG(" Cannot get info"); else { - _debug("card %i : %s [%s]", + DEBUG("card %i : %s [%s]", numCard, snd_ctl_card_info_get_id(info), snd_ctl_card_info_get_name(info)); @@ -531,7 +531,7 @@ void AlsaLayer::capture() int toGetSamples = snd_pcm_avail_update(captureHandle_); if (toGetSamples < 0) - _error("Audio: Mic error: %s", snd_strerror(toGetSamples)); + ERROR("Audio: Mic error: %s", snd_strerror(toGetSamples)); if (toGetSamples <= 0) return; @@ -545,7 +545,7 @@ void AlsaLayer::capture() SFLDataFormat* in = (SFLDataFormat*) malloc(toGetBytes); if (read(in, toGetBytes) != toGetBytes) { - _error("ALSA MIC : Couldn't read!"); + ERROR("ALSA MIC : Couldn't read!"); goto end; } diff --git a/daemon/src/audio/audioloop.cpp b/daemon/src/audio/audioloop.cpp index 99c44101be742483a61a237c4d6daac5587abdd4..7e1d41d4e1a389a667fde5ca899f7ec50e5924b1 100644 --- a/daemon/src/audio/audioloop.cpp +++ b/daemon/src/audio/audioloop.cpp @@ -52,7 +52,7 @@ AudioLoop::getNext(SFLDataFormat* output, size_t total_samples, short volume) size_t pos = pos_; if (size_ == 0) { - _error("AudioLoop: Error: Audio loop size is 0"); + ERROR("AudioLoop: Error: Audio loop size is 0"); return; } diff --git a/daemon/src/audio/audiorecord.cpp b/daemon/src/audio/audiorecord.cpp index f32a0e305b12fa1bbda6452e26d4f6836e2a5ad1..0df3f9101498bb9e2e9836a0b5ace02a4386b4d4 100644 --- a/daemon/src/audio/audiorecord.cpp +++ b/daemon/src/audio/audiorecord.cpp @@ -100,12 +100,12 @@ void AudioRecord::initFileName(std::string peerNumber) if (fileType_ == FILE_RAW) { if (strstr(fileName_, ".raw") == NULL) { - _debug("AudioRecord: concatenate .raw file extension: name : %s", fileName_); + DEBUG("AudioRecord: concatenate .raw file extension: name : %s", fileName_); fName.append(".raw"); } } else if (fileType_ == FILE_WAV) { if (strstr(fileName_, ".wav") == NULL) { - _debug("AudioRecord: concatenate .wav file extension: name : %s", fileName_); + DEBUG("AudioRecord: concatenate .wav file extension: name : %s", fileName_); fName.append(".wav"); } } @@ -122,10 +122,10 @@ bool AudioRecord::openFile() { bool result = false; - _debug("AudioRecord: Open file()"); + DEBUG("AudioRecord: Open file()"); if (not fileExists()) { - _debug("AudioRecord: Filename does not exist, creating one"); + DEBUG("AudioRecord: Filename does not exist, creating one"); byteCounter_ = 0; if (fileType_ == FILE_RAW) @@ -133,7 +133,7 @@ bool AudioRecord::openFile() else if (fileType_ == FILE_WAV) result = setWavFile(); } else { - _debug("AudioRecord: Filename already exists, opening it"); + DEBUG("AudioRecord: Filename already exists, opening it"); if (fileType_ == FILE_RAW) result = openExistingRawFile(); else if (fileType_ == FILE_WAV) @@ -163,7 +163,7 @@ bool AudioRecord::isOpenFile() bool AudioRecord::fileExists() { - _info("AudioRecord: Trying to open %s ", fileName_); + INFO("AudioRecord: Trying to open %s ", fileName_); return fopen(fileName_,"rb") != 0; } @@ -177,10 +177,10 @@ bool AudioRecord::setRecording() { if (isOpenFile()) { if (!recordingEnabled_) { - _info("AudioRecording: Start recording"); + INFO("AudioRecording: Start recording"); recordingEnabled_ = true; } else { - _info("AudioRecording: Stop recording"); + INFO("AudioRecording: Stop recording"); recordingEnabled_ = false; } } else { @@ -195,7 +195,7 @@ bool AudioRecord::setRecording() void AudioRecord::stopRecording() { - _info("AudioRecording: Stop recording"); + INFO("AudioRecording: Stop recording"); recordingEnabled_ = false; } @@ -249,7 +249,7 @@ void AudioRecord::createFilename() // fileName_ = out.str(); strncpy(fileName_, out.str().c_str(), 8192); - _info("AudioRecord: create filename for this call %s ", fileName_); + INFO("AudioRecord: create filename for this call %s ", fileName_); } bool AudioRecord::setRawFile() @@ -257,11 +257,11 @@ bool AudioRecord::setRawFile() fileHandle_ = fopen(savePath_.c_str(), "wb"); if (!fileHandle_) { - _warn("AudioRecord: Could not create RAW file!"); + WARN("AudioRecord: Could not create RAW file!"); return false; } - _debug("AudioRecord:setRawFile() : created RAW file."); + DEBUG("AudioRecord:setRawFile() : created RAW file."); return true; } @@ -269,12 +269,12 @@ bool AudioRecord::setRawFile() bool AudioRecord::setWavFile() { - _debug("AudioRecord: Create new wave file %s, sampling rate: %d", savePath_.c_str(), sndSmplRate_); + DEBUG("AudioRecord: Create new wave file %s, sampling rate: %d", savePath_.c_str(), sndSmplRate_); fileHandle_ = fopen(savePath_.c_str(), "wb"); if (!fileHandle_) { - _warn("AudioRecord: Error: could not create WAV file."); + WARN("AudioRecord: Error: could not create WAV file."); return false; } @@ -300,11 +300,11 @@ bool AudioRecord::setWavFile() if (fwrite(&hdr, 4, 11, fileHandle_) != 11) { - _warn("AudioRecord: Error: could not write WAV header for file. "); + WARN("AudioRecord: Error: could not write WAV header for file. "); return false; } - _debug("AudioRecord: created WAV file successfully."); + DEBUG("AudioRecord: created WAV file successfully."); return true; } @@ -315,7 +315,7 @@ bool AudioRecord::openExistingRawFile() fileHandle_ = fopen(fileName_, "ab+"); if (!fileHandle_) { - _warn("AudioRecord: could not create RAW file!"); + WARN("AudioRecord: could not create RAW file!"); return false; } @@ -325,37 +325,37 @@ bool AudioRecord::openExistingRawFile() bool AudioRecord::openExistingWavFile() { - _info("%s(%s)\n", __PRETTY_FUNCTION__, fileName_); + INFO("%s(%s)\n", __PRETTY_FUNCTION__, fileName_); fileHandle_ = fopen(fileName_, "rb+"); if (!fileHandle_) { - _warn("AudioRecord: Error: could not open WAV file!"); + WARN("AudioRecord: Error: could not open WAV file!"); return false; } if (fseek(fileHandle_, 40, SEEK_SET) != 0) // jump to data length - _warn("AudioRecord: Error: Couldn't seek offset 40 in the file "); + WARN("AudioRecord: Error: Couldn't seek offset 40 in the file "); if (fread(&byteCounter_, 4, 1, fileHandle_)) - _warn("AudioRecord: Error: bytecounter Read successfully "); + WARN("AudioRecord: Error: bytecounter Read successfully "); if (fseek(fileHandle_, 0 , SEEK_END) != 0) - _warn("AudioRecord: Error: Couldn't seek at the en of the file "); + WARN("AudioRecord: Error: Couldn't seek at the en of the file "); if (fclose(fileHandle_) != 0) - _warn("AudioRecord: Error: Can't close file r+ "); + WARN("AudioRecord: Error: Can't close file r+ "); fileHandle_ = fopen(fileName_, "ab+"); if (!fileHandle_) { - _warn("AudioRecord: Error: Could not createopen WAV file ab+!"); + WARN("AudioRecord: Error: Could not createopen WAV file ab+!"); return false; } if (fseek(fileHandle_, 4 , SEEK_END) != 0) - _warn("AudioRecord: Error: Couldn't seek at the en of the file "); + WARN("AudioRecord: Error: Couldn't seek at the en of the file "); return true; @@ -364,38 +364,38 @@ bool AudioRecord::openExistingWavFile() void AudioRecord::closeWavFile() { if (fileHandle_ == 0) { - _debug("AudioRecord: Can't closeWavFile, a file has not yet been opened!"); + DEBUG("AudioRecord: Can't closeWavFile, a file has not yet been opened!"); return; } - _debug("AudioRecord: Close wave file"); + DEBUG("AudioRecord: Close wave file"); SINT32 bytes = byteCounter_ * channels_; fseek(fileHandle_, 40, SEEK_SET); // jump to data length if (ferror(fileHandle_)) - _warn("AudioRecord: Error: can't reach offset 40 while closing"); + WARN("AudioRecord: Error: can't reach offset 40 while closing"); fwrite(&bytes, sizeof(SINT32), 1, fileHandle_); if (ferror(fileHandle_)) - _warn("AudioRecord: Error: can't write bytes for data length "); + WARN("AudioRecord: Error: can't write bytes for data length "); bytes = byteCounter_ * channels_ + 44; // + 44 for the wave header fseek(fileHandle_, 4, SEEK_SET); // jump to file size if (ferror(fileHandle_)) - _warn("AudioRecord: Error: can't reach offset 4"); + WARN("AudioRecord: Error: can't reach offset 4"); fwrite(&bytes, 4, 1, fileHandle_); if (ferror(fileHandle_)) - _warn("AudioRecord: Error: can't reach offset 4"); + WARN("AudioRecord: Error: can't reach offset 4"); if (fclose(fileHandle_) != 0) - _warn("AudioRecord: Error: can't close file"); + WARN("AudioRecord: Error: can't close file"); } void AudioRecord::recSpkrData(SFLDataFormat* buffer, int nSamples) @@ -425,12 +425,12 @@ void AudioRecord::recData(SFLDataFormat* buffer, int nSamples) { if (recordingEnabled_) { if (fileHandle_ == 0) { - _debug("AudioRecord: Can't record data, a file has not yet been opened!"); + DEBUG("AudioRecord: Can't record data, a file has not yet been opened!"); return; } if (fwrite(buffer, sizeof(SFLDataFormat), nSamples, fileHandle_) != (unsigned int) nSamples) - _warn("AudioRecord: Could not record data! "); + WARN("AudioRecord: Could not record data! "); else { fflush(fileHandle_); byteCounter_ += (unsigned long)(nSamples*sizeof(SFLDataFormat)); @@ -444,7 +444,7 @@ void AudioRecord::recData(SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, { if (recordingEnabled_) { if (fileHandle_ == 0) { - _debug("AudioRecord: Can't record data, a file has not yet been opened!"); + DEBUG("AudioRecord: Can't record data, a file has not yet been opened!"); return; } @@ -452,7 +452,7 @@ void AudioRecord::recData(SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, mixBuffer_[k] = (buffer_1[k]+buffer_2[k]); if (fwrite(&mixBuffer_[k], 2, 1, fileHandle_) != 1) - _warn("AudioRecord: Could not record data!"); + WARN("AudioRecord: Could not record data!"); else fflush(fileHandle_); } diff --git a/daemon/src/audio/audiortp/audio_rtp_record_handler.cpp b/daemon/src/audio/audiortp/audio_rtp_record_handler.cpp index cec3366e4fce78ab19113da5792fdbfa74144416..20409a0d06500e492a8359e9c89731f3c165c14b 100644 --- a/daemon/src/audio/audiortp/audio_rtp_record_handler.cpp +++ b/daemon/src/audio/audiortp/audio_rtp_record_handler.cpp @@ -125,7 +125,7 @@ int AudioRtpRecordHandler::processDataEncode() int bytes = Manager::instance().getMainBuffer()->getData(micData, bytesToGet, id_); if (bytes != bytesToGet) { - _error("%s : asked %d bytes from mainbuffer, got %d", __PRETTY_FUNCTION__, bytesToGet, bytes); + ERROR("%s : asked %d bytes from mainbuffer, got %d", __PRETTY_FUNCTION__, bytesToGet, bytes); return 0; } diff --git a/daemon/src/audio/audiortp/audio_rtp_session.cpp b/daemon/src/audio/audiortp/audio_rtp_session.cpp index 201731872caa08e3ddebd5d3f51043bfa32de183..24206571631eef9e804c7ea3a62e5e62695ed682 100644 --- a/daemon/src/audio/audiortp/audio_rtp_session.cpp +++ b/daemon/src/audio/audiortp/audio_rtp_session.cpp @@ -72,7 +72,7 @@ void AudioRtpSession::updateSessionMedia(AudioCodec *audioCodec) Manager::instance().audioSamplingRateChanged(audioRtpRecord_.codecSampleRate_); if (lastSamplingRate != audioRtpRecord_.codecSampleRate_) { - _debug("AudioRtpSession: Update noise suppressor with sampling rate %d and frame size %d", getCodecSampleRate(), getCodecFrameSize()); + DEBUG("AudioRtpSession: Update noise suppressor with sampling rate %d and frame size %d", getCodecSampleRate(), getCodecFrameSize()); initNoiseSuppress(); } @@ -94,20 +94,20 @@ void AudioRtpSession::setSessionMedia(AudioCodec *audioCodec) else timestampIncrement_ = frameSize; - _debug("AudioRptSession: Codec payload: %d", payloadType); - _debug("AudioSymmetricRtpSession: Codec sampling rate: %d", smplRate); - _debug("AudioSymmetricRtpSession: Codec frame size: %d", frameSize); - _debug("AudioSymmetricRtpSession: RTP timestamp increment: %d", timestampIncrement_); + DEBUG("AudioRptSession: Codec payload: %d", payloadType); + DEBUG("AudioSymmetricRtpSession: Codec sampling rate: %d", smplRate); + DEBUG("AudioSymmetricRtpSession: Codec frame size: %d", frameSize); + DEBUG("AudioSymmetricRtpSession: RTP timestamp increment: %d", timestampIncrement_); if (payloadType == g722PayloadType) { - _debug("AudioSymmetricRtpSession: Setting G722 payload format"); + DEBUG("AudioSymmetricRtpSession: Setting G722 payload format"); queue_->setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) payloadType, g722RtpClockRate)); } else { if (dynamic) { - _debug("AudioSymmetricRtpSession: Setting dynamic payload format"); + DEBUG("AudioSymmetricRtpSession: Setting dynamic payload format"); queue_->setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) payloadType, smplRate)); } else { - _debug("AudioSymmetricRtpSession: Setting static payload format"); + DEBUG("AudioSymmetricRtpSession: Setting static payload format"); queue_->setPayloadFormat(ost::StaticPayloadFormat((ost::StaticPayloadType) payloadType)); } } @@ -127,7 +127,7 @@ void AudioRtpSession::sendDtmfEvent() audioRtpRecord_.dtmfQueue_.pop_front(); - _debug("AudioRtpSession: Send RTP Dtmf (%d)", payload.event); + DEBUG("AudioRtpSession: Send RTP Dtmf (%d)", payload.event); timestamp_ += (type_ == Zrtp) ? 160 : timestampIncrement_; @@ -186,7 +186,7 @@ void AudioRtpSession::sendMicData() void AudioRtpSession::setSessionTimeouts() { - _debug("AudioRtpSession: Set session scheduling timeout (%d) and expireTimeout (%d)", sfl::schedulingTimeout, sfl::expireTimeout); + DEBUG("AudioRtpSession: Set session scheduling timeout (%d) and expireTimeout (%d)", sfl::schedulingTimeout, sfl::expireTimeout); queue_->setSchedulingTimeout(sfl::schedulingTimeout); queue_->setExpireTimeout(sfl::expireTimeout); @@ -194,13 +194,13 @@ void AudioRtpSession::setSessionTimeouts() void AudioRtpSession::setDestinationIpAddress() { - _info("AudioRtpSession: Setting IP address for the RTP session"); + INFO("AudioRtpSession: Setting IP address for the RTP session"); // Store remote ip in case we would need to forget current destination remote_ip_ = ost::InetHostAddress(ca_->getLocalSDP()->getRemoteIP().c_str()); if (!remote_ip_) { - _warn("AudioRtpSession: Target IP address (%s) is not correct!", + WARN("AudioRtpSession: Target IP address (%s) is not correct!", ca_->getLocalSDP()->getRemoteIP().data()); return; } @@ -208,24 +208,24 @@ void AudioRtpSession::setDestinationIpAddress() // Store remote port in case we would need to forget current destination remote_port_ = (unsigned short) ca_->getLocalSDP()->getRemoteAudioPort(); - _info("AudioRtpSession: New remote address for session: %s:%d", + INFO("AudioRtpSession: New remote address for session: %s:%d", ca_->getLocalSDP()->getRemoteIP().data(), remote_port_); if (!queue_->addDestination(remote_ip_, remote_port_)) { - _warn("AudioRtpSession: Can't add new destination to session!"); + WARN("AudioRtpSession: Can't add new destination to session!"); return; } } void AudioRtpSession::updateDestinationIpAddress() { - _debug("AudioRtpSession: Update destination ip address"); + DEBUG("AudioRtpSession: Update destination ip address"); // Destination address are stored in a list in ccrtp // This method remove the current destination entry if (!queue_->forgetDestination(remote_ip_, remote_port_, remote_port_ + 1)) - _debug("AudioRtpSession: Did not remove previous destination"); + DEBUG("AudioRtpSession: Did not remove previous destination"); // new destination is stored in call // we just need to recall this method @@ -238,7 +238,7 @@ int AudioRtpSession::startRtpThread(AudioCodec* audiocodec) if (isStarted_) return 0; - _debug("AudioSymmetricRtpSession: Starting main thread"); + DEBUG("AudioSymmetricRtpSession: Starting main thread"); isStarted_ = true; setSessionTimeouts(); diff --git a/daemon/src/audio/audiortp/audio_srtp_session.cpp b/daemon/src/audio/audiortp/audio_srtp_session.cpp index 54e4131fa514554169b92eb599cac0985f99f8e8..0f3bf23c0983d40b6461602b4997a2a5feef7490 100644 --- a/daemon/src/audio/audiortp/audio_srtp_session.cpp +++ b/daemon/src/audio/audiortp/audio_srtp_session.cpp @@ -61,12 +61,12 @@ AudioSrtpSession::AudioSrtpSession(SIPCall * sipcall) : AudioSrtpSession::~AudioSrtpSession() { - _debug("AudioSrtp: Destroy audio srtp session"); + DEBUG("AudioSrtp: Destroy audio srtp session"); } void AudioSrtpSession::initLocalCryptoInfo() { - _debug("AudioSrtp: Set cryptographic info for this rtp session"); + DEBUG("AudioSrtp: Set cryptographic info for this rtp session"); // Initialize local Crypto context initializeLocalMasterKey(); @@ -82,7 +82,7 @@ void AudioSrtpSession::initLocalCryptoInfo() std::vector<std::string> AudioSrtpSession::getLocalCryptoInfo() { - _debug("AudioSrtp: Get Cryptographic info from this rtp session"); + DEBUG("AudioSrtp: Get Cryptographic info from this rtp session"); std::vector<std::string> crypto_vector; @@ -104,7 +104,7 @@ std::vector<std::string> AudioSrtpSession::getLocalCryptoInfo() crypto_attr += crypto_suite.append(" "); crypto_attr += srtp_keys; - _debug("%s", crypto_attr.c_str()); + DEBUG("%s", crypto_attr.c_str()); crypto_vector.push_back(crypto_attr); @@ -114,7 +114,7 @@ std::vector<std::string> AudioSrtpSession::getLocalCryptoInfo() void AudioSrtpSession::setRemoteCryptoInfo(sfl::SdesNegotiator& nego) { if (not remoteOfferIsSet_) { - _debug("%s", nego.getKeyInfo().c_str()); + DEBUG("%s", nego.getKeyInfo().c_str()); // Use second crypto suite if key length is 32 bit, default is 80; @@ -137,12 +137,12 @@ void AudioSrtpSession::setRemoteCryptoInfo(sfl::SdesNegotiator& nego) void AudioSrtpSession::initializeLocalMasterKey() { - _debug("AudioSrtp: Init local master key"); + DEBUG("AudioSrtp: Init local master key"); // @TODO key may have different length depending on cipher suite localMasterKeyLength_ = sfl::CryptoSuites[localCryptoSuite_].masterKeyLength / 8; - _debug("AudioSrtp: Local master key length %d", localMasterKeyLength_); + DEBUG("AudioSrtp: Local master key length %d", localMasterKeyLength_); // Allocate memory for key unsigned char *random_key = new unsigned char[localMasterKeyLength_]; @@ -151,7 +151,7 @@ void AudioSrtpSession::initializeLocalMasterKey() int err; if ((err = RAND_bytes(random_key, localMasterKeyLength_)) != 1) - _debug("Error occured while generating cryptographically strong pseudo-random key"); + DEBUG("Error occured while generating cryptographically strong pseudo-random key"); memcpy(localMasterKey_, random_key, localMasterKeyLength_); } @@ -164,27 +164,27 @@ void AudioSrtpSession::initializeLocalMasterSalt() // Allocate memory for key unsigned char *random_key = new unsigned char[localMasterSaltLength_]; - _debug("AudioSrtp: Local master salt length %d", localMasterSaltLength_); + DEBUG("AudioSrtp: Local master salt length %d", localMasterSaltLength_); // Generate ryptographically strong pseudo-random bytes int err; if ((err = RAND_bytes(random_key, localMasterSaltLength_)) != 1) - _debug("Error occured while generating cryptographically strong pseudo-random key"); + DEBUG("Error occured while generating cryptographically strong pseudo-random key"); memcpy(localMasterSalt_, random_key, localMasterSaltLength_); } std::string AudioSrtpSession::getBase64ConcatenatedKeys() { - _debug("AudioSrtp: Get base64 concatenated keys"); + DEBUG("AudioSrtp: Get base64 concatenated keys"); // compute concatenated master and salt length int concatLength = localMasterKeyLength_ + localMasterSaltLength_; uint8 concatKeys[concatLength]; - _debug("AudioSrtp: Concatenated length %d", concatLength); + DEBUG("AudioSrtp: Concatenated length %d", concatLength); // concatenate keys memcpy((void*) concatKeys, (void*) localMasterKey_, localMasterKeyLength_); @@ -214,7 +214,7 @@ void AudioSrtpSession::unBase64ConcatenatedKeys(std::string base64keys) void AudioSrtpSession::initializeRemoteCryptoContext() { - _debug("AudioSrtp: Initialize remote crypto context"); + DEBUG("AudioSrtp: Initialize remote crypto context"); CryptoSuiteDefinition crypto = sfl::CryptoSuites[remoteCryptoSuite_]; @@ -241,7 +241,7 @@ void AudioSrtpSession::initializeRemoteCryptoContext() void AudioSrtpSession::initializeLocalCryptoContext() { - _debug("AudioSrtp: Initialize local crypto context"); + DEBUG("AudioSrtp: Initialize local crypto context"); CryptoSuiteDefinition crypto = sfl::CryptoSuites[localCryptoSuite_]; diff --git a/daemon/src/audio/audiortp/audio_symmetric_rtp_session.cpp b/daemon/src/audio/audiortp/audio_symmetric_rtp_session.cpp index 71ad81f6ea1fee8e434018105181d606f9691f16..9fbd639f38be6c51c684801175df24c58f920425 100644 --- a/daemon/src/audio/audiortp/audio_symmetric_rtp_session.cpp +++ b/daemon/src/audio/audiortp/audio_symmetric_rtp_session.cpp @@ -46,7 +46,7 @@ AudioSymmetricRtpSession::AudioSymmetricRtpSession(SIPCall * sipcall) : , AudioRtpSession(sipcall, Symmetric, this, this) , rtpThread_(new AudioRtpThread(this)) { - _info("AudioSymmetricRtpSession: Setting new RTP session with destination %s:%d", ca_->getLocalIp().c_str(), ca_->getLocalAudioPort()); + INFO("AudioSymmetricRtpSession: Setting new RTP session with destination %s:%d", ca_->getLocalIp().c_str(), ca_->getLocalAudioPort()); audioRtpRecord_.callId_ = ca_->getCallId(); } @@ -65,7 +65,7 @@ void AudioSymmetricRtpSession::AudioRtpThread::run() TimerPort::setTimer(threadSleep); - _debug("AudioRtpThread: Entering Audio rtp thread main loop"); + DEBUG("AudioRtpThread: Entering Audio rtp thread main loop"); while (running) { // Send session @@ -79,7 +79,7 @@ void AudioSymmetricRtpSession::AudioRtpThread::run() TimerPort::incTimer(threadSleep); } - _debug("AudioRtpThread: Leaving audio rtp thread loop"); + DEBUG("AudioRtpThread: Leaving audio rtp thread loop"); } } diff --git a/daemon/src/audio/audiortp/audio_zrtp_session.cpp b/daemon/src/audio/audiortp/audio_zrtp_session.cpp index 6dbc9751c95cf6fb2053851fb28aa652e65c441d..2f38308487c656b45081690be1a0961f466a1d34 100644 --- a/daemon/src/audio/audiortp/audio_zrtp_session.cpp +++ b/daemon/src/audio/audiortp/audio_zrtp_session.cpp @@ -58,12 +58,12 @@ AudioZrtpSession::AudioZrtpSession(SIPCall * sipcall, const std::string& zidFile ost::defaultApplication()), zidFilename_(zidFilename) { - _debug("AudioZrtpSession initialized"); + DEBUG("AudioZrtpSession initialized"); initializeZid(); setCancel(cancelDefault); - _info("AudioZrtpSession: Setting new RTP session with destination %s:%d", ca_->getLocalIp().c_str(), ca_->getLocalAudioPort()); + INFO("AudioZrtpSession: Setting new RTP session with destination %s:%d", ca_->getLocalIp().c_str(), ca_->getLocalAudioPort()); } AudioZrtpSession::~AudioZrtpSession() @@ -93,24 +93,24 @@ void AudioZrtpSession::initializeZid() std::string xdg_config = std::string(HOMEDIR) + DIR_SEPARATOR_STR + ".cache" + DIR_SEPARATOR_STR + PACKAGE + "/" + zidFilename_; - _debug(" xdg_config %s", xdg_config.c_str()); + DEBUG(" xdg_config %s", xdg_config.c_str()); if (XDG_CACHE_HOME != NULL) { std::string xdg_env = std::string(XDG_CACHE_HOME) + zidFilename_; - _debug(" xdg_env %s", xdg_env.c_str()); + DEBUG(" xdg_env %s", xdg_env.c_str()); (xdg_env.length() > 0) ? zidCompleteFilename = xdg_env : zidCompleteFilename = xdg_config; } else zidCompleteFilename = xdg_config; if (initialize(zidCompleteFilename.c_str()) >= 0) { - _debug("Register callbacks"); + DEBUG("Register callbacks"); setEnableZrtp(true); setUserCallback(new ZrtpSessionCallback(ca_)); return; } - _debug("Initialization from ZID file failed. Trying to remove..."); + DEBUG("Initialization from ZID file failed. Trying to remove..."); if (remove(zidCompleteFilename.c_str()) != 0) throw ZrtpZidException("zid file deletion failed"); @@ -125,7 +125,7 @@ void AudioZrtpSession::run() { // Set recording sampling rate ca_->setRecordingSmplRate(getCodecSampleRate()); - _debug("AudioZrtpSession: Entering mainloop for call %s", ca_->getCallId().c_str()); + DEBUG("AudioZrtpSession: Entering mainloop for call %s", ca_->getCallId().c_str()); uint32 timeout = 0; @@ -167,7 +167,6 @@ void AudioZrtpSession::run() } } - _debug("AudioZrtpSession: Left main loop for call %s", ca_->getCallId().c_str()); + DEBUG("AudioZrtpSession: Left main loop for call %s", ca_->getCallId().c_str()); } - } diff --git a/daemon/src/audio/audiortp/zrtp_session_callback.cpp b/daemon/src/audio/audiortp/zrtp_session_callback.cpp index 7ae5ab9e715ea52efbc42b935855de88f65afe85..7afde913b0307b3d5862259db1955ce957b1bc8a 100644 --- a/daemon/src/audio/audiortp/zrtp_session_callback.cpp +++ b/daemon/src/audio/audiortp/zrtp_session_callback.cpp @@ -56,7 +56,7 @@ ZrtpSessionCallback::ZrtpSessionCallback(SIPCall *sipcall) : if (not infoMap_.empty()) return; - _info("Zrtp: Initialize callbacks"); + INFO("Zrtp: Initialize callbacks"); // Information Map infoMap_[InfoHelloReceived] = "Hello received, preparing a Commit"; @@ -112,21 +112,21 @@ ZrtpSessionCallback::ZrtpSessionCallback(SIPCall *sipcall) : void ZrtpSessionCallback::secureOn(std::string cipher) { - _debug("Zrtp: Secure mode is on with cipher %s", cipher.c_str()); + DEBUG("Zrtp: Secure mode is on with cipher %s", cipher.c_str()); Manager::instance().getDbusManager()->getCallManager()->secureZrtpOn(sipcall_->getCallId(), cipher); } void ZrtpSessionCallback::secureOff() { - _debug("Zrtp: Secure mode is off"); + DEBUG("Zrtp: Secure mode is off"); Manager::instance().getDbusManager()->getCallManager()->secureZrtpOff(sipcall_->getCallId()); } void ZrtpSessionCallback::showSAS(std::string sas, bool verified) { - _debug("Zrtp: SAS is: %s", sas.c_str()); + DEBUG("Zrtp: SAS is: %s", sas.c_str()); Manager::instance().getDbusManager()->getCallManager()->showSAS(sipcall_->getCallId(), sas, verified); } @@ -134,7 +134,7 @@ ZrtpSessionCallback::showSAS(std::string sas, bool verified) void ZrtpSessionCallback::zrtpNotSuppOther() { - _debug("Zrtp: Callee does not support ZRTP"); + DEBUG("Zrtp: Callee does not support ZRTP"); Manager::instance().getDbusManager()->getCallManager()->zrtpNotSuppOther(sipcall_->getCallId()); } @@ -145,9 +145,9 @@ ZrtpSessionCallback::showMessage(GnuZrtpCodes::MessageSeverity sev, int32_t subC if (sev == ZrtpError) { if (subCode < 0) { // received an error packet from peer subCode *= -1; - _debug("Received an error packet from peer:"); + DEBUG("Received an error packet from peer:"); } else - _debug("Sent error packet to peer:"); + DEBUG("Sent error packet to peer:"); } } @@ -157,19 +157,19 @@ ZrtpSessionCallback::zrtpNegotiationFailed(MessageSeverity severity, int subCode if (severity == ZrtpError) { if (subCode < 0) { // received an error packet from peer subCode *= -1; - _debug("Zrtp: Received error packet: "); + DEBUG("Zrtp: Received error packet: "); } else - _debug("Zrtp: Sent error packet: "); + DEBUG("Zrtp: Sent error packet: "); std::map<int32, std::string>::const_iterator iter = zrtpMap_.find(subCode); if (iter != zrtpMap_.end()) { - _debug("%s", iter->second.c_str()); + DEBUG("%s", iter->second.c_str()); Manager::instance().getDbusManager()->getCallManager()->zrtpNegotiationFailed(sipcall_->getCallId(), iter->second, "ZRTP"); } } else { std::map<int32, std::string>::const_iterator iter = severeMap_.find(subCode); if (iter != severeMap_.end()) { - _debug("%s", iter->second.c_str()); + DEBUG("%s", iter->second.c_str()); Manager::instance().getDbusManager()->getCallManager()->zrtpNegotiationFailed(sipcall_->getCallId(), iter->second, "severe"); } } @@ -178,7 +178,7 @@ ZrtpSessionCallback::zrtpNegotiationFailed(MessageSeverity severity, int subCode void ZrtpSessionCallback::confirmGoClear() { - _debug("Zrtp: Received go clear message. Until confirmation, ZRTP won't send any data"); + DEBUG("Zrtp: Received go clear message. Until confirmation, ZRTP won't send any data"); Manager::instance().getDbusManager()->getCallManager()->zrtpNotSuppOther(sipcall_->getCallId()); } diff --git a/daemon/src/audio/codecs/audiocodecfactory.cpp b/daemon/src/audio/codecs/audiocodecfactory.cpp index 517b8be8704ca876a57467f06fa326536a9250b7..0574123e8daebf75f2dc8bf7354fb96ef000d6fd 100644 --- a/daemon/src/audio/codecs/audiocodecfactory.cpp +++ b/daemon/src/audio/codecs/audiocodecfactory.cpp @@ -43,12 +43,12 @@ AudioCodecFactory::AudioCodecFactory() : codecsMap_() CodecVector codecDynamicList(scanCodecDirectory()); if (codecDynamicList.empty()) - _error("Error - No codecs available"); + ERROR("Error - No codecs available"); else { for (CodecVector::const_iterator iter = codecDynamicList.begin(); iter != codecDynamicList.end() ; ++iter) { codecsMap_[(int)(*iter)->getPayloadType()] = *iter; - _debug("Loaded codec %s" , (*iter)->getMimeSubtype().c_str()); + DEBUG("Loaded codec %s" , (*iter)->getMimeSubtype().c_str()); } } } @@ -93,7 +93,7 @@ AudioCodecFactory::getCodec(int payload) const if (iter != codecsMap_.end()) return iter->second; else { - _error("CodecDescriptor: cannot find codec %i", payload); + ERROR("CodecDescriptor: cannot find codec %i", payload); return NULL; } } @@ -160,7 +160,7 @@ std::vector<sfl::Codec*> AudioCodecFactory::scanCodecDirectory() for (size_t i = 0 ; i < dirToScan.size() ; i++) { std::string dirStr = dirToScan[i]; - _debug("CodecDescriptor: Scanning %s to find audio codecs....", dirStr.c_str()); + DEBUG("CodecDescriptor: Scanning %s to find audio codecs....", dirStr.c_str()); DIR *dir = opendir(dirStr.c_str()); @@ -196,7 +196,7 @@ sfl::Codec* AudioCodecFactory::loadCodec(const std::string &path) void * codecHandle = dlopen(path.c_str() , RTLD_LAZY); if (!codecHandle) { - _error("%s\n", dlerror()); + ERROR("%s\n", dlerror()); return NULL; } @@ -206,7 +206,7 @@ sfl::Codec* AudioCodecFactory::loadCodec(const std::string &path) char *error = dlerror(); if (error) { - _error("%s\n", error); + ERROR("%s\n", error); return NULL; } @@ -225,7 +225,7 @@ void AudioCodecFactory::unloadCodec(CodecHandlePointer p) char *error = dlerror(); if (error) { - _error("%s\n", error); + ERROR("%s\n", error); return; } @@ -245,7 +245,7 @@ sfl::Codec* AudioCodecFactory::instantiateCodec(int payload) const char *error = dlerror(); if (error) - _error("%s\n", error); + ERROR("%s\n", error); else return createCodec(); } diff --git a/daemon/src/audio/echosuppress.cpp b/daemon/src/audio/echosuppress.cpp index d1e4c6dfa1ea467759b111ed5df941cb2ba78590..e5bb739971e510e0dc2de74488d5726ade26a89e 100644 --- a/daemon/src/audio/echosuppress.cpp +++ b/daemon/src/audio/echosuppress.cpp @@ -31,7 +31,7 @@ void EchoSuppress::putData(SFLDataFormat *inputData, int samples) assert(sizeof(SFLDataFormat) == sizeof(pj_int16_t)); if (pjmedia_echo_playback(echoState, reinterpret_cast<pj_int16_t *>(inputData)) != PJ_SUCCESS) - _warn("EchoCancel: Problem while putting input data"); + WARN("EchoCancel: Problem while putting input data"); } void EchoSuppress::getData(SFLDataFormat *outputData) @@ -39,5 +39,5 @@ void EchoSuppress::getData(SFLDataFormat *outputData) assert(sizeof(SFLDataFormat) == sizeof(pj_int16_t)); if (pjmedia_echo_capture(echoState, reinterpret_cast<pj_int16_t *>(outputData), 0) != PJ_SUCCESS) - _warn("EchoCancel: Problem while getting output data"); + WARN("EchoCancel: Problem while getting output data"); } diff --git a/daemon/src/audio/gaincontrol.cpp b/daemon/src/audio/gaincontrol.cpp index f9df37193a72ffc41cb0524f08b53b0a29506fcf..336d99870cd5ebb93b69b451ac7c85c380da0982 100644 --- a/daemon/src/audio/gaincontrol.cpp +++ b/daemon/src/audio/gaincontrol.cpp @@ -22,7 +22,7 @@ GainControl::GainControl(double sr, double target) : averager_(sr, SFL_GAIN_ATTA , maxIncreaseStep_(exp(0.11513 * 12. * 160 / 8000)) // Computed on 12 frames (240 ms) , maxDecreaseStep_(exp(-0.11513 * 40. * 160 / 8000))// Computed on 40 frames (800 ms) { - _debug("GainControl: Target gain %f dB (%f linear)", targetLeveldB_, targetLevelLinear_); + DEBUG("GainControl: Target gain %f dB (%f linear)", targetLeveldB_, targetLevelLinear_); } void GainControl::process(SFLDataFormat *buf, int samples) diff --git a/daemon/src/audio/mainbuffer.cpp b/daemon/src/audio/mainbuffer.cpp index e8c80e4d7c43ad1865bed6d235fc8e54f018e900..74cd86e3553fa140ae91be8c0609b69ed15e2fc4 100644 --- a/daemon/src/audio/mainbuffer.cpp +++ b/daemon/src/audio/mainbuffer.cpp @@ -67,12 +67,12 @@ bool MainBuffer::removeCallIDSet(const std::string & set_id) CallIDSet* callid_set = getCallIDSet(set_id); if (!callid_set) { - _debug("removeCallIDSet error callid set %s does not exist!", set_id.c_str()); + DEBUG("removeCallIDSet error callid set %s does not exist!", set_id.c_str()); return false; } if (callIDMap_.erase(set_id) == 0) { - _debug("removeCallIDSet error while removing callid set %s!", set_id.c_str()); + DEBUG("removeCallIDSet error while removing callid set %s!", set_id.c_str()); return false; } @@ -92,9 +92,9 @@ void MainBuffer::removeCallIDfromSet(const std::string & set_id, const std::stri CallIDSet* callid_set = getCallIDSet(set_id); if (callid_set == NULL) - _error("removeCallIDfromSet error callid set %s does not exist!", set_id.c_str()); + ERROR("removeCallIDfromSet error callid set %s does not exist!", set_id.c_str()); else if (callid_set->erase(call_id) == 0) - _error("removeCallIDfromSet error while removing callid %s from set %s!", call_id.c_str(), set_id.c_str()); + ERROR("removeCallIDfromSet error while removing callid %s from set %s!", call_id.c_str(), set_id.c_str()); } RingBuffer* MainBuffer::getRingBuffer(const std::string & call_id) @@ -119,11 +119,11 @@ bool MainBuffer::removeRingBuffer(const std::string & call_id) delete ring_buffer; return true; } else { - _error("BufferManager: Error: Fail to delete ringbuffer %s!", call_id.c_str()); + ERROR("BufferManager: Error: Fail to delete ringbuffer %s!", call_id.c_str()); return false; } } else { - _debug("BufferManager: Error: Ringbuffer %s does not exist!", call_id.c_str()); + DEBUG("BufferManager: Error: Ringbuffer %s does not exist!", call_id.c_str()); return true; } } @@ -214,7 +214,7 @@ void MainBuffer::unBindHalfDuplexOut(const std::string & process_id, const std:: removeRingBuffer(call_id); } } else { - _debug("Error: did not found ringbuffer %s", process_id.c_str()); + DEBUG("Error: did not found ringbuffer %s", process_id.c_str()); removeCallIDSet(process_id); } @@ -320,7 +320,7 @@ int MainBuffer::availForGet(const std::string & call_id) CallIDSet::iterator iter_id = callid_set->begin(); if ((call_id != Call::DEFAULT_ID) && (*iter_id == call_id)) - _debug("This problem should not occur since we have %i element", (int) callid_set->size()); + DEBUG("This problem should not occur since we have %i element", (int) callid_set->size()); return availForGetByID(*iter_id, call_id); @@ -346,12 +346,12 @@ int MainBuffer::availForGet(const std::string & call_id) int MainBuffer::availForGetByID(const std::string & call_id, const std::string & reader_id) { if ((call_id != Call::DEFAULT_ID) and (reader_id == call_id)) - _error("MainBuffer: Error: RingBuffer has a readpointer on tiself"); + ERROR("MainBuffer: Error: RingBuffer has a readpointer on tiself"); RingBuffer* ringbuffer = getRingBuffer(call_id); if (ringbuffer == NULL) { - _error("MainBuffer: Error: RingBuffer does not exist"); + ERROR("MainBuffer: Error: RingBuffer does not exist"); return 0; } else return ringbuffer->AvailForGet(reader_id); @@ -451,7 +451,7 @@ void MainBuffer::stateInfo() dbg_str.append(", "); } - _debug("%s", dbg_str.c_str()); + DEBUG("%s", dbg_str.c_str()); } // Print ringbuffers ids and readpointers @@ -473,6 +473,6 @@ void MainBuffer::stateInfo() dbg_str.append(", "); } } - _debug("%s", dbg_str.c_str()); + DEBUG("%s", dbg_str.c_str()); } } diff --git a/daemon/src/audio/pulseaudio/audiostream.cpp b/daemon/src/audio/pulseaudio/audiostream.cpp index 530784d291d90f1d3d32c837e0aa7fe867d5ce9a..07cd9c325db51d6a80d69b8fd5ec6038195c2a66 100644 --- a/daemon/src/audio/pulseaudio/audiostream.cpp +++ b/daemon/src/audio/pulseaudio/audiostream.cpp @@ -51,7 +51,7 @@ AudioStream::AudioStream(pa_context *c, pa_threaded_mainloop *m, const char *des audiostream_ = pa_stream_new(c, desc, &sample_spec, &channel_map); if (!audiostream_) { - _error("Pulse: %s: pa_stream_new() failed : %s" , desc, pa_strerror(pa_context_errno(c))); + ERROR("Pulse: %s: pa_stream_new() failed : %s" , desc, pa_strerror(pa_context_errno(c))); throw std::runtime_error("Pulse : could not create stream\n"); } @@ -100,30 +100,30 @@ AudioStream::stream_state_callback(pa_stream* s, void* user_data UNUSED) switch (pa_stream_get_state(s)) { case PA_STREAM_CREATING: - _info("Pulse: Stream is creating..."); + INFO("Pulse: Stream is creating..."); break; case PA_STREAM_TERMINATED: - _info("Pulse: Stream is terminating..."); + INFO("Pulse: Stream is terminating..."); break; case PA_STREAM_READY: - _info("Pulse: Stream successfully created, connected to %s", pa_stream_get_device_name(s)); - _debug("Pulse: maxlength %u", pa_stream_get_buffer_attr(s)->maxlength); - _debug("Pulse: tlength %u", pa_stream_get_buffer_attr(s)->tlength); - _debug("Pulse: prebuf %u", pa_stream_get_buffer_attr(s)->prebuf); - _debug("Pulse: minreq %u", pa_stream_get_buffer_attr(s)->minreq); - _debug("Pulse: fragsize %u", pa_stream_get_buffer_attr(s)->fragsize); - _debug("Pulse: samplespec %s", pa_sample_spec_snprint(str, sizeof(str), pa_stream_get_sample_spec(s))); + INFO("Pulse: Stream successfully created, connected to %s", pa_stream_get_device_name(s)); + DEBUG("Pulse: maxlength %u", pa_stream_get_buffer_attr(s)->maxlength); + DEBUG("Pulse: tlength %u", pa_stream_get_buffer_attr(s)->tlength); + DEBUG("Pulse: prebuf %u", pa_stream_get_buffer_attr(s)->prebuf); + DEBUG("Pulse: minreq %u", pa_stream_get_buffer_attr(s)->minreq); + DEBUG("Pulse: fragsize %u", pa_stream_get_buffer_attr(s)->fragsize); + DEBUG("Pulse: samplespec %s", pa_sample_spec_snprint(str, sizeof(str), pa_stream_get_sample_spec(s))); break; case PA_STREAM_UNCONNECTED: - _info("Pulse: Stream unconnected"); + INFO("Pulse: Stream unconnected"); break; case PA_STREAM_FAILED: default: - _error("Pulse: Sink/Source doesn't exists: %s" , pa_strerror(pa_context_errno(pa_stream_get_context(s)))); + ERROR("Pulse: Sink/Source doesn't exists: %s" , pa_strerror(pa_context_errno(pa_stream_get_context(s)))); break; } } diff --git a/daemon/src/audio/pulseaudio/pulselayer.cpp b/daemon/src/audio/pulseaudio/pulselayer.cpp index bbfb3fbbe0d374ee164ba9840152a24dca518701..2a9a350bdda9d1ecdb5e1b2f06169d41fe8acdde 100644 --- a/daemon/src/audio/pulseaudio/pulselayer.cpp +++ b/daemon/src/audio/pulseaudio/pulselayer.cpp @@ -60,7 +60,7 @@ void ringtone_callback(pa_stream* s, size_t bytes, void* userdata) void stream_moved_callback(pa_stream *s, void *userdata UNUSED) { - _debug("stream_moved_callback: stream %d to %d", pa_stream_get_index(s), pa_stream_get_device_index(s)); + DEBUG("stream_moved_callback: stream %d to %d", pa_stream_get_index(s), pa_stream_get_device_index(s)); } void sink_input_info_callback(pa_context *c UNUSED, const pa_sink_info *i, int eol, void *userdata) @@ -70,7 +70,7 @@ void sink_input_info_callback(pa_context *c UNUSED, const pa_sink_info *i, int e if (eol) return; - _debug("Sink %u\n" + DEBUG("Sink %u\n" " Name: %s\n" " Driver: %s\n" " Description: %s\n" @@ -105,7 +105,7 @@ void source_input_info_callback(pa_context *c UNUSED, const pa_source_info *i, i if (!eol) return; - _debug("Sink %u\n" + DEBUG("Sink %u\n" " Name: %s\n" " Driver: %s\n" " Description: %s\n" @@ -138,54 +138,54 @@ void context_changed_callback(pa_context* c, pa_subscription_event_type_t t, uin switch (t) { case PA_SUBSCRIPTION_EVENT_SINK: - _debug("Audio: PA_SUBSCRIPTION_EVENT_SINK"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_SINK"); ((PulseLayer *) userdata)->getSinkList()->clear(); pa_context_get_sink_info_list(c, sink_input_info_callback, userdata); break; case PA_SUBSCRIPTION_EVENT_SOURCE: - _debug("Audio: PA_SUBSCRIPTION_EVENT_SOURCE"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_SOURCE"); ((PulseLayer *) userdata)->getSourceList()->clear(); pa_context_get_source_info_list(c, source_input_info_callback, userdata); break; case PA_SUBSCRIPTION_EVENT_SINK_INPUT: - _debug("Audio: PA_SUBSCRIPTION_EVENT_SINK_INPUT"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_SINK_INPUT"); break; case PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT: - _debug("Audio: PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT"); break; case PA_SUBSCRIPTION_EVENT_MODULE: - _debug("Audio: PA_SUBSCRIPTION_EVENT_MODULE"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_MODULE"); break; case PA_SUBSCRIPTION_EVENT_CLIENT: - _debug("Audio: PA_SUBSCRIPTION_EVENT_CLIENT"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_CLIENT"); break; case PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE: - _debug("Audio: PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE"); break; case PA_SUBSCRIPTION_EVENT_SERVER: - _debug("Audio: PA_SUBSCRIPTION_EVENT_SERVER"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_SERVER"); break; case PA_SUBSCRIPTION_EVENT_CARD: - _debug("Audio: PA_SUBSCRIPTION_EVENT_CARD"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_CARD"); break; case PA_SUBSCRIPTION_EVENT_FACILITY_MASK: - _debug("Audio: PA_SUBSCRIPTION_EVENT_FACILITY_MASK"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_FACILITY_MASK"); break; case PA_SUBSCRIPTION_EVENT_CHANGE: - _debug("Audio: PA_SUBSCRIPTION_EVENT_CHANGE"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_CHANGE"); break; case PA_SUBSCRIPTION_EVENT_REMOVE: - _debug("Audio: PA_SUBSCRIPTION_EVENT_REMOVE"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_REMOVE"); ((PulseLayer *) userdata)->getSinkList()->clear(); ((PulseLayer *) userdata)->getSourceList()->clear(); pa_context_get_sink_info_list(c, sink_input_info_callback, userdata); pa_context_get_source_info_list(c, source_input_info_callback, userdata); break; case PA_SUBSCRIPTION_EVENT_TYPE_MASK: - _debug("Audio: PA_SUBSCRIPTION_EVENT_TYPE_MASK"); + DEBUG("Audio: PA_SUBSCRIPTION_EVENT_TYPE_MASK"); break; default: - _debug("Audio: Unknown event type %d", t); + DEBUG("Audio: Unknown event type %d", t); } } @@ -261,11 +261,11 @@ void PulseLayer::context_state_callback(pa_context* c, void* user_data) case PA_CONTEXT_AUTHORIZING: case PA_CONTEXT_SETTING_NAME: - _debug("Audio: Waiting...."); + DEBUG("Audio: Waiting...."); break; case PA_CONTEXT_READY: - _debug("Audio: Connection to PulseAudio server established"); + DEBUG("Audio: Connection to PulseAudio server established"); pa_threaded_mainloop_signal(pulse->mainloop_, 0); pa_context_subscribe(c, (pa_subscription_mask_t)(PA_SUBSCRIPTION_MASK_SINK| PA_SUBSCRIPTION_MASK_SOURCE), NULL, pulse); @@ -279,7 +279,7 @@ void PulseLayer::context_state_callback(pa_context* c, void* user_data) case PA_CONTEXT_FAILED: default: - _error("Pulse: %s" , pa_strerror(pa_context_errno(c))); + ERROR("Pulse: %s" , pa_strerror(pa_context_errno(c))); pa_threaded_mainloop_signal(pulse->mainloop_, 0); pulse->disconnectAudioStream(); break; @@ -317,7 +317,7 @@ void PulseLayer::createStreams(pa_context* c) std::string recordDevice(audioPref.getDeviceRecord()); std::string ringtoneDevice(audioPref.getDeviceRingtone()); - _debug("PulseAudio: Devices: playback %s , record %s , ringtone %s", + DEBUG("PulseAudio: Devices: playback %s , record %s , ringtone %s", playbackDevice.c_str(), recordDevice.c_str(), ringtoneDevice.c_str()); playback_ = new AudioStream(c, mainloop_, "SFLphone playback", PLAYBACK_STREAM, audioSampleRate_, @@ -424,7 +424,7 @@ void PulseLayer::writeToSpeaker() int writable = pa_stream_writable_size(s); if (writable < 0) - _error("Pulse: playback error : %s", pa_strerror(writable)); + ERROR("Pulse: playback error : %s", pa_strerror(writable)); if (writable <= 0) return; @@ -514,7 +514,7 @@ void PulseLayer::readFromMic() size_t bytes; if (pa_stream_peek(record_->pulseStream() , (const void**) &data , &bytes) < 0 or !data) { - _error("Audio: Error capture stream peek failed: %s" , pa_strerror(pa_context_errno(context_))); + ERROR("Audio: Error capture stream peek failed: %s" , pa_strerror(pa_context_errno(context_))); return; } @@ -541,7 +541,7 @@ void PulseLayer::readFromMic() Manager::instance().getMainBuffer()->putData(mic_buffer_, bytes); if (pa_stream_drop(record_->pulseStream()) < 0) - _error("Audio: Error: capture stream drop failed: %s" , pa_strerror(pa_context_errno(context_))); + ERROR("Audio: Error: capture stream drop failed: %s" , pa_strerror(pa_context_errno(context_))); } @@ -555,7 +555,7 @@ void PulseLayer::ringtoneToSpeaker() int writable = pa_stream_writable_size(s); if (writable < 0) - _error("Pulse: ringtone error : %s", pa_strerror(writable)); + ERROR("Pulse: ringtone error : %s", pa_strerror(writable)); if (writable <= 0) return; diff --git a/daemon/src/audio/ringbuffer.cpp b/daemon/src/audio/ringbuffer.cpp index 40ff582aa067652eb893c5b350be69f4c667725b..6cc11987ec1de479510e39e72ea4d96e3e35f2f6 100644 --- a/daemon/src/audio/ringbuffer.cpp +++ b/daemon/src/audio/ringbuffer.cpp @@ -91,7 +91,7 @@ RingBuffer::getLen(const std::string &call_id) void RingBuffer::debug() { - _debug("Start=%d; End=%d; BufferSize=%d", getSmallestReadPointer(), endPos_, bufferSize_); + DEBUG("Start=%d; End=%d; BufferSize=%d", getSmallestReadPointer(), endPos_, bufferSize_); } int @@ -129,7 +129,7 @@ RingBuffer::storeReadPointer(int pointer_value, const std::string &call_id) if (iter != readpointer_.end()) iter->second = pointer_value; else - _debug("storeReadPointer: Cannot find \"%s\" readPointer in \"%s\" ringbuffer", call_id.c_str(), buffer_id_.c_str()); + DEBUG("storeReadPointer: Cannot find \"%s\" readPointer in \"%s\" ringbuffer", call_id.c_str(), buffer_id_.c_str()); } diff --git a/daemon/src/audio/sound/audiofile.cpp b/daemon/src/audio/sound/audiofile.cpp index 11c9172a8417760692572746c6db173a64dcff48..0dd1c336d861b3022b7bb7c3e97ea3d1c78d626d 100644 --- a/daemon/src/audio/sound/audiofile.cpp +++ b/daemon/src/audio/sound/audiofile.cpp @@ -191,8 +191,8 @@ WaveFile::WaveFile(const std::string& fileName, unsigned int audioSamplingRate) unsigned long nbSamples = 8 * bytes / dt / chan; // sample frames - _debug("WaveFile: frame size %ld, data size %d align %d rate %d avgbyte %d chunk size %d dt %d", - nbSamples, bytes, blockal, srate, avgb, chunk_size, dt); + DEBUG("WaveFile: frame size %ld, data size %d align %d rate %d avgbyte %d chunk size %d dt %d", + nbSamples, bytes, blockal, srate, avgb, chunk_size, dt); // Should not be longer than a minute if (nbSamples > static_cast<unsigned int>(60 * srate)) diff --git a/daemon/src/audio/sound/tone.cpp b/daemon/src/audio/sound/tone.cpp index 85000730b4924cf30bd9bc7f0c8c8ec2dcdf6a2e..0e233c2eef65929a28c8332fca18e9b348241402 100644 --- a/daemon/src/audio/sound/tone.cpp +++ b/daemon/src/audio/sound/tone.cpp @@ -110,7 +110,7 @@ Tone::genBuffer(const std::string& definition) count = (sampleRate_ * time) / 1000; // Generate SAMPLING_RATE samples of sinus, buffer is the result - _debug("genSin(%d, %d)", freq1, freq2); + DEBUG("genSin(%d, %d)", freq1, freq2); genSin(bufferPos, freq1, freq2, count); // To concatenate the different buffers for each section. diff --git a/daemon/src/audio/speexechocancel.cpp b/daemon/src/audio/speexechocancel.cpp index 5b7b5c71e67aa01c8a17c7858fb481022fe37d7b..fbff2918160ae63f29d23a7736e60915979e917e 100644 --- a/daemon/src/audio/speexechocancel.cpp +++ b/daemon/src/audio/speexechocancel.cpp @@ -45,8 +45,8 @@ SpeexEchoCancel::SpeexEchoCancel() echoState_ = speex_echo_state_init(EC_FRAME_SIZE, echoTailLength_); preState_ = speex_preprocess_state_init(EC_FRAME_SIZE, samplingRate); - _debug("EchoCancel: Initializing echo canceller with delay: %d, filter length: %d, frame size: %d and samplerate %d", - echoDelay_, echoTailLength_, EC_FRAME_SIZE, samplingRate); + DEBUG("EchoCancel: Initializing echo canceller with delay: %d, filter length: %d, frame size: %d and samplerate %d", + echoDelay_, echoTailLength_, EC_FRAME_SIZE, samplingRate); speex_echo_ctl(echoState_, SPEEX_ECHO_SET_SAMPLING_RATE, &samplingRate); speex_preprocess_ctl(preState_, SPEEX_PREPROCESS_SET_ECHO_STATE, echoState_); diff --git a/daemon/src/config/config.cpp b/daemon/src/config/config.cpp index d96d14dfc4b85b356293f23ccecfb88c1448d8df..bd3818d857eb3b499585cd96b9de8d19cb3ca02b 100644 --- a/daemon/src/config/config.cpp +++ b/daemon/src/config/config.cpp @@ -256,7 +256,7 @@ ConfigTree::setConfigTreeItem(const std::string& section, bool ConfigTree::saveConfigTree(const std::string& fileName) { - _debug("ConfigTree: Save %s", fileName.c_str()); + DEBUG("ConfigTree: Save %s", fileName.c_str()); if (fileName.empty() and sections_.begin() == sections_.end()) return false; @@ -266,7 +266,7 @@ ConfigTree::saveConfigTree(const std::string& fileName) file.open(fileName.data(), std::fstream::out); if (!file.is_open()) { - _error("ConfigTree: Error: Could not open %s configuration file", fileName.c_str()); + ERROR("ConfigTree: Error: Could not open %s configuration file", fileName.c_str()); return false; } @@ -290,7 +290,7 @@ ConfigTree::saveConfigTree(const std::string& fileName) file.close(); if (chmod(fileName.c_str(), S_IRUSR | S_IWUSR)) - _error("ConfigTree: Error: Failed to set permission on configuration: %m"); + ERROR("ConfigTree: Error: Failed to set permission on configuration: %m"); return true; } @@ -302,7 +302,7 @@ ConfigTree::saveConfigTree(const std::string& fileName) int ConfigTree::populateFromFile(const std::string& fileName) { - _debug("ConfigTree: Populate from file %s", fileName.c_str()); + DEBUG("ConfigTree: Populate from file %s", fileName.c_str()); if (fileName.empty()) return 0; @@ -366,7 +366,7 @@ ConfigTree::populateFromFile(const std::string& fileName) file.close(); if (chmod(fileName.c_str(), S_IRUSR | S_IWUSR)) - _debug("Failed to set permission on configuration file because: %m"); + DEBUG("Failed to set permission on configuration file because: %m"); return 1; } diff --git a/daemon/src/config/yamlemitter.cpp b/daemon/src/config/yamlemitter.cpp index ba8296a5152d55f11e7ebf43d6f4a694e8e02ca0..4c21298fedf1dd53f0c3eaf060b6e429f45b74d1 100644 --- a/daemon/src/config/yamlemitter.cpp +++ b/daemon/src/config/yamlemitter.cpp @@ -99,7 +99,7 @@ void YamlEmitter::serializeAccount(MappingNode *map) throw(YamlEmitterException) if (isFirstAccount) { int accountid; - _debug("YamlEmitter: Create account sequence"); + DEBUG("YamlEmitter: Create account sequence"); // accountSequence need to be static outside this scope since reused each time an account is written if ((accountid = yaml_document_add_scalar(&document, NULL, (yaml_char_t *) "accounts", -1, YAML_PLAIN_SCALAR_STYLE)) == 0) { diff --git a/daemon/src/config/yamlnode.cpp b/daemon/src/config/yamlnode.cpp index 8c0a64b8b7cb79117815884bdaa3629547c9c75a..5bae6cf3016703496b4eda765826462a29022b2b 100644 --- a/daemon/src/config/yamlnode.cpp +++ b/daemon/src/config/yamlnode.cpp @@ -116,7 +116,7 @@ YamlNode *MappingNode::getValue(const std::string &key) if (it != map.end()) { return it->second; } else { - _debug("MappingNode: Could not find %s", key.c_str()); + DEBUG("MappingNode: Could not find %s", key.c_str()); return NULL; } } diff --git a/daemon/src/config/yamlparser.cpp b/daemon/src/config/yamlparser.cpp index 166abd1b94577f8ae9307b36645411cb1d0ac2ee..dabc22933084b4d8ea57db7a9d16c3c57934af1c 100644 --- a/daemon/src/config/yamlparser.cpp +++ b/daemon/src/config/yamlparser.cpp @@ -425,15 +425,12 @@ void YamlParser::constructNativeData() switch ((*iter)->getType()) { case SCALAR: - // _debug("construct scalar"); throw YamlParserException("No scalar allowed at document level, expect a mapping"); break; case SEQUENCE: - // _debug("construct sequence"); throw YamlParserException("No sequence allowed at document level, expect a mapping"); break; case MAPPING: { - // _debug("construct mapping"); MappingNode *map = (MappingNode *)(*iter); mainNativeDataMapping(map); break; diff --git a/daemon/src/dbus/callmanager.cpp b/daemon/src/dbus/callmanager.cpp index aea7355ef46bcdb0f67122be16cb87e6bbd10e8d..3a13295efea24a9c22fdda2cfe43b1faa64b0590 100644 --- a/daemon/src/dbus/callmanager.cpp +++ b/daemon/src/dbus/callmanager.cpp @@ -50,7 +50,7 @@ void CallManager::placeCall(const std::string& accountID, { // Check if a destination number is available if (to.empty()) - _debug("No number entered - Call stopped"); + DEBUG("No number entered - Call stopped"); else Manager::instance().outgoingCall(accountID, callID, to); } @@ -62,7 +62,7 @@ void CallManager::placeCallFirstAccount(const std::string& callID, using std::string; if (to.empty()) { - _warn("CallManager: Warning: No number entered, call stopped"); + WARN("CallManager: Warning: No number entered, call stopped"); return; } diff --git a/daemon/src/dbus/configurationmanager.cpp b/daemon/src/dbus/configurationmanager.cpp index 4abab73d4d1076e3b5473050ae47cd271b95eb56..c9e73568467d81e7645cdfb92ebe7b7db5af5d20 100644 --- a/daemon/src/dbus/configurationmanager.cpp +++ b/daemon/src/dbus/configurationmanager.cpp @@ -59,7 +59,7 @@ std::map<std::string, std::string> ConfigurationManager::getIp2IpDetails() SIPAccount *sipaccount = static_cast<SIPAccount *>(Manager::instance().getAccount(IP2IP_PROFILE)); if (!sipaccount) { - _error("ConfigurationManager: could not find account"); + ERROR("ConfigurationManager: could not find account"); return ip2ipAccountDetails; } else return sipaccount->getIp2IpDetails(); @@ -119,7 +119,7 @@ void ConfigurationManager::setTlsSettings(const std::map<std::string, std::strin SIPAccount * sipaccount = (SIPAccount *) Manager::instance().getAccount(IP2IP_PROFILE); if (!sipaccount) { - _debug("ConfigurationManager: Error: No valid account in set TLS settings"); + DEBUG("ConfigurationManager: Error: No valid account in set TLS settings"); return; } @@ -267,7 +267,7 @@ int32_t ConfigurationManager::getAudioDeviceIndex(const std::string& name) std::string ConfigurationManager::getCurrentAudioOutputPlugin() { - _debug("ConfigurationManager: Get audio plugin %s", Manager::instance().getCurrentAudioOutputPlugin().c_str()); + DEBUG("ConfigurationManager: Get audio plugin %s", Manager::instance().getCurrentAudioOutputPlugin().c_str()); return Manager::instance().getCurrentAudioOutputPlugin(); } diff --git a/daemon/src/dbus/dbusmanager.cpp b/daemon/src/dbus/dbusmanager.cpp index 261d0f3bc5bea1ba34dfe8d5f65c740a50e9afe2..9c2a1a1eba42ac838d7afed4c6b066b817083ab0 100644 --- a/daemon/src/dbus/dbusmanager.cpp +++ b/daemon/src/dbus/dbusmanager.cpp @@ -57,7 +57,7 @@ DBusManager::DBusManager() #endif } catch (const DBus::Error &err) { - _error("%s: %s, exiting\n", err.name(), err.what()); + ERROR("%s: %s, exiting\n", err.name(), err.what()); ::exit(EXIT_FAILURE); } } diff --git a/daemon/src/dbus/networkmanager.cpp b/daemon/src/dbus/networkmanager.cpp index f40499f1363ebd2d21067028470aef6cd3f5430e..9f7288069262b05e94ad927d373d821a100c6235 100644 --- a/daemon/src/dbus/networkmanager.cpp +++ b/daemon/src/dbus/networkmanager.cpp @@ -45,14 +45,14 @@ std::string NetworkManager::stateAsString(const uint32_t& state) void NetworkManager::StateChanged(const uint32_t& state) { - _warn("Network state changed: %s", stateAsString(state).c_str()); + WARN("Network state changed: %s", stateAsString(state).c_str()); } void NetworkManager::PropertiesChanged(const std::map< std::string, ::DBus::Variant >& argin0) { const std::map< std::string, ::DBus::Variant >::const_iterator iter = argin0.begin(); - _warn("Properties changed: %s", iter->first.c_str()); + WARN("Properties changed: %s", iter->first.c_str()); Manager::instance().registerAccounts(); } diff --git a/daemon/src/history/historyitem.cpp b/daemon/src/history/historyitem.cpp index 130094aaa810a84cb6ca657670f8894b24d77f7d..659e2f10befb688409b3daaa1b097298a3554450 100644 --- a/daemon/src/history/historyitem.cpp +++ b/daemon/src/history/historyitem.cpp @@ -95,7 +95,7 @@ HistoryItem::HistoryItem(std::string serialized_form) timeAdded_ = tmp; break; default: // error - _error("Unserialized form %d not recognized\n", indice); + ERROR("Unserialized form %d not recognized\n", indice); break; } diff --git a/daemon/src/history/historymanager.cpp b/daemon/src/history/historymanager.cpp index 630f0006705830b2f00cb1388afb0ec5af8814c6..558ed30b752d6acab4e7190649c0300b6df53716 100644 --- a/daemon/src/history/historymanager.cpp +++ b/daemon/src/history/historymanager.cpp @@ -75,7 +75,7 @@ bool HistoryManager::save_history() bool HistoryManager::load_history_from_file(Conf::ConfigTree *history_list) { - _debug("HistoryManager: Load history from file %s", history_path_.c_str()); + DEBUG("HistoryManager: Load history from file %s", history_path_.c_str()); int exist = history_list->populateFromFile(history_path_.c_str()); history_loaded_ = (exist == 2) ? false : true; @@ -121,7 +121,7 @@ int HistoryManager::load_history_items_map(Conf::ConfigTree *history_list, int l bool HistoryManager::save_history_to_file(Conf::ConfigTree *history_list) { - _debug("HistoryManager: Saving history in XDG directory: %s", history_path_.c_str()); + DEBUG("HistoryManager: Saving history in XDG directory: %s", history_path_.c_str()); return history_list->saveConfigTree(history_path_.data()); } @@ -134,7 +134,7 @@ int HistoryManager::save_history_items_map(Conf::ConfigTree *history_list) if (item and item->save(&history_list)) ++items_saved; else - _debug("can't save NULL history item\n"); + DEBUG("can't save NULL history item\n"); } return items_saved; @@ -166,7 +166,7 @@ int HistoryManager::create_history_path(std::string path) if (mkdir(userdata.data(), 0755) != 0) { // If directory creation failed if (errno != EEXIST) { - _debug("HistoryManager: Cannot create directory: %m"); + DEBUG("HistoryManager: Cannot create directory: %m"); return -1; } } @@ -209,7 +209,7 @@ std::vector<std::string> HistoryManager::get_history_serialized() std::vector<std::string> serialized; HistoryItemMap::iterator iter; - _debug("HistoryManager: Get history serialized"); + DEBUG("HistoryManager: Get history serialized"); for (iter = history_items_.begin(); iter != history_items_.end(); ++iter) { HistoryItem *current = *iter; @@ -227,7 +227,7 @@ int HistoryManager::set_serialized_history(std::vector<std::string> history, int int history_limit; time_t current_timestamp; - _debug("HistoryManager: Set serialized history"); + DEBUG("HistoryManager: Set serialized history"); // Clear the existing history free_history(history_items_); diff --git a/daemon/src/iax/iaxaccount.cpp b/daemon/src/iax/iaxaccount.cpp index a30705662ae02888796bfa9ec85552b7fa363ed9..53b8705d6d4111a0e598265e52d575a20bd14831 100644 --- a/daemon/src/iax/iaxaccount.cpp +++ b/daemon/src/iax/iaxaccount.cpp @@ -52,7 +52,7 @@ IAXAccount::~IAXAccount() void IAXAccount::serialize(Conf::YamlEmitter *emitter) { if (emitter == NULL) { - _error("IAXAccount: Error: emitter is NULL in serialize"); + ERROR("IAXAccount: Error: emitter is NULL in serialize"); return; } @@ -85,14 +85,14 @@ void IAXAccount::serialize(Conf::YamlEmitter *emitter) try { emitter->serializeAccount(&accountmap); } catch (const Conf::YamlEmitterException &e) { - _error("ConfigTree: %s", e.what()); + ERROR("ConfigTree: %s", e.what()); } } void IAXAccount::unserialize(Conf::MappingNode *map) { if (map == NULL) { - _error("IAXAccount: Error: Map is NULL in unserialize"); + ERROR("IAXAccount: Error: Map is NULL in unserialize"); return; } @@ -151,7 +151,7 @@ void IAXAccount::registerVoIPLink() link_->init(); link_->sendRegister(this); } catch (const VoipLinkException &e) { - _error("IAXAccount: %s", e.what()); + ERROR("IAXAccount: %s", e.what()); } } @@ -162,7 +162,7 @@ IAXAccount::unregisterVoIPLink() link_->sendUnregister(this); dynamic_cast<IAXVoIPLink*>(link_)->terminate(); } catch (const VoipLinkException &e) { - _error("IAXAccount: %s", e.what()); + ERROR("IAXAccount: %s", e.what()); } } diff --git a/daemon/src/iax/iaxcall.cpp b/daemon/src/iax/iaxcall.cpp index afa6622310fc35875838c3120d9d7751019dd4ca..4302102a2f6db683f171ec771b27f8021ae4205c 100644 --- a/daemon/src/iax/iaxcall.cpp +++ b/daemon/src/iax/iaxcall.cpp @@ -50,7 +50,7 @@ int codecToASTFormat(int c) return AST_FORMAT_SPEEX; default: - _error("Codec %d not supported!", c); + ERROR("Codec %d not supported!", c); return 0; } } @@ -71,7 +71,7 @@ int IAXCall::getSupportedFormat(const std::string &accountID) const for (CodecOrder::const_iterator iter = map.begin(); iter != map.end(); ++iter) format_mask |= codecToASTFormat(*iter); } else - _error("No IAx account could be found"); + ERROR("No IAx account could be found"); return format_mask; } @@ -91,7 +91,7 @@ int IAXCall::getFirstMatchingFormat(int needles, const std::string &accountID) c return format_mask; } } else - _error("No IAx account could be found"); + ERROR("No IAx account could be found"); return 0; } @@ -110,7 +110,7 @@ int IAXCall::getAudioCodec() const case AST_FORMAT_SPEEX: return PAYLOAD_CODEC_SPEEX_8000; default: - _error("IAX: Format %d not supported!", format); + ERROR("IAX: Format %d not supported!", format); return -1; } } diff --git a/daemon/src/iax/iaxvoiplink.cpp b/daemon/src/iax/iaxvoiplink.cpp index 2ee740e936fe35044738d70e58e701f3312c9254..4aed158f7c62c0c62ba3b922bae82bf1e3d7c7d5 100644 --- a/daemon/src/iax/iaxvoiplink.cpp +++ b/daemon/src/iax/iaxvoiplink.cpp @@ -185,7 +185,7 @@ IAXVoIPLink::sendAudioFromMic() ost::MutexLock m(mutexIAX_); if (iax_send_voice(currentCall->session, currentCall->format, encodedData, compSize, outSamples) == -1) - _error("IAX: Error sending voice data."); + ERROR("IAX: Error sending voice data."); } } } @@ -273,7 +273,7 @@ IAXVoIPLink::answer(Call *c) void IAXVoIPLink::hangup(const std::string& id) { - _debug("IAXVoIPLink: Hangup"); + DEBUG("IAXVoIPLink: Hangup"); IAXCall* call = getIAXCall(id); @@ -295,7 +295,7 @@ IAXVoIPLink::hangup(const std::string& id) void IAXVoIPLink::peerHungup(const std::string& id) { - _debug("IAXVoIPLink: Peer hung up"); + DEBUG("IAXVoIPLink: Peer hung up"); IAXCall* call = getIAXCall(id); diff --git a/daemon/src/im/instant_messaging.cpp b/daemon/src/im/instant_messaging.cpp index 1e30e9c1b56ae4a30c56fd8624f2a64cf6a63b33..8c4de04741019cb3d66e5e1755d76d244c31b216 100644 --- a/daemon/src/im/instant_messaging.cpp +++ b/daemon/src/im/instant_messaging.cpp @@ -153,7 +153,7 @@ InstantMessaging::UriList InstantMessaging::parseXmlUriList(std::string& urilist XML_SetElementHandler(parser, startElementCallback, endElementCallback); if (XML_Parse(parser, urilist.c_str(), urilist.size(), 1) == XML_STATUS_ERROR) { - _error("%s at line %lu\n", XML_ErrorString(XML_GetErrorCode(parser)), + ERROR("%s at line %lu\n", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser)); throw InstantMessageException("Error while parsing uri-list xml content"); } diff --git a/daemon/src/logger.h b/daemon/src/logger.h index e87f117860b3bbdc15b607943896ae6a350175c0..9bbf6a9074f3fc38c2857ae255736ca2e5b9c8bc 100644 --- a/daemon/src/logger.h +++ b/daemon/src/logger.h @@ -40,10 +40,10 @@ void setConsoleLog(bool); void setDebugMode(bool); }; -#define _error(...) Logger::log(LOG_ERR, __VA_ARGS__) -#define _warn(...) Logger::log(LOG_WARNING, __VA_ARGS__) -#define _info(...) Logger::log(LOG_INFO, __VA_ARGS__) -#define _debug(...) Logger::log(LOG_DEBUG, __VA_ARGS__) +#define ERROR(...) Logger::log(LOG_ERR, __VA_ARGS__) +#define WARN(...) Logger::log(LOG_WARNING, __VA_ARGS__) +#define INFO(...) Logger::log(LOG_INFO, __VA_ARGS__) +#define DEBUG(...) Logger::log(LOG_DEBUG, __VA_ARGS__) #define BLACK "\033[22;30m" #define RED "\033[22;31m" diff --git a/daemon/src/main.cpp b/daemon/src/main.cpp index 8e086fe9d91bba4beefdaac3fa5de962563f9627..ad6cd9fb9c536c92f26fd678a4bd1939eceda211 100644 --- a/daemon/src/main.cpp +++ b/daemon/src/main.cpp @@ -153,7 +153,7 @@ main(int argc, char **argv) return 1; } - _debug("Starting DBus event loop"); + DEBUG("Starting DBus event loop"); Manager::instance().getDbusManager()->exec(); return 0; diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index 68e4ea8e87d5667ef1fa6ce559ecc8387356e69c..8661b466b4f9572f1937740af7616660176f5c64 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -94,7 +94,7 @@ void ManagerImpl::init(std::string config_file) path_ = config_file; - _debug("Manager: configuration file path: %s", path_.c_str()); + DEBUG("Manager: configuration file path: %s", path_.c_str()); Conf::YamlParser *parser = NULL; @@ -104,7 +104,7 @@ void ManagerImpl::init(std::string config_file) parser->composeEvents(); parser->constructNativeData(); } catch (Conf::YamlParserException &e) { - _error("Manager: %s", e.what()); + ERROR("Manager: %s", e.what()); fflush(stderr); delete parser; parser = NULL; @@ -132,7 +132,7 @@ void ManagerImpl::init(std::string config_file) void ManagerImpl::terminate() { std::vector<std::string> callList(getCallList()); - _debug("Manager: Hangup %zu remaining call", callList.size()); + DEBUG("Manager: Hangup %zu remaining call", callList.size()); for (std::vector<std::string>::iterator iter = callList.begin(); iter != callList.end(); ++iter) hangupCall(*iter); @@ -171,7 +171,7 @@ ManagerImpl::getCurrentCallId() const void ManagerImpl::switchCall(const std::string& id) { ost::MutexLock m(currentCallMutex_); - _debug("----- Switch current call id to %s -----", id.c_str()); + DEBUG("----- Switch current call id to %s -----", id.c_str()); currentCallId_ = id; } @@ -186,17 +186,17 @@ bool ManagerImpl::outgoingCall(const std::string& account_id, const std::string& conf_id) { if (call_id.empty()) { - _debug("Manager: New outgoing call abort, missing callid"); + DEBUG("Manager: New outgoing call abort, missing callid"); return false; } // Call ID must be unique if (not getAccountFromCall(call_id).empty()) { - _error("Manager: Error: Call id already exists in outgoing call"); + ERROR("Manager: Error: Call id already exists in outgoing call"); return false; } - _debug("Manager: New outgoing call %s to %s", call_id.c_str(), to.c_str()); + DEBUG("Manager: New outgoing call %s to %s", call_id.c_str(), to.c_str()); stopTone(); @@ -217,7 +217,7 @@ bool ManagerImpl::outgoingCall(const std::string& account_id, // in any cases we have to detach from current communication if (hasCurrentCall()) { - _debug("Manager: Has current call (%s) put it onhold", current_call_id.c_str()); + DEBUG("Manager: Has current call (%s) put it onhold", current_call_id.c_str()); // if this is not a conferenceand this and is not a conference participant if (!isConference(current_call_id) && !participToConference(current_call_id)) @@ -227,7 +227,7 @@ bool ManagerImpl::outgoingCall(const std::string& account_id, } if (callConfig == Call::IPtoIP) { - _debug("Manager: Start IP2IP call"); + DEBUG("Manager: Start IP2IP call"); /* We need to retrieve the sip voiplink instance */ if (SIPVoIPLink::instance()->SIPNewIpToIpCall(call_id, to_cleaned)) { @@ -239,16 +239,16 @@ bool ManagerImpl::outgoingCall(const std::string& account_id, return false; } - _debug("Manager: Selecting account %s", account_id.c_str()); + DEBUG("Manager: Selecting account %s", account_id.c_str()); // Is this account exist if (!accountExists(account_id)) { - _error("Manager: Error: Account doesn't exist in new outgoing call"); + ERROR("Manager: Error: Account doesn't exist in new outgoing call"); return false; } if (!associateCallToAccount(call_id, account_id)) - _warn("Manager: Warning: Could not associate call id %s to account id %s", call_id.c_str(), account_id.c_str()); + WARN("Manager: Warning: Could not associate call id %s to account id %s", call_id.c_str(), account_id.c_str()); try { Call *call = getAccountLink(account_id)->newOutgoingCall(call_id, to_cleaned); @@ -257,7 +257,7 @@ bool ManagerImpl::outgoingCall(const std::string& account_id, call->setConfId(conf_id); } catch (const VoipLinkException &e) { callFailure(call_id); - _error("Manager: %s", e.what()); + ERROR("Manager: %s", e.what()); return false; } @@ -269,7 +269,7 @@ bool ManagerImpl::outgoingCall(const std::string& account_id, //THREAD=Main : for outgoing Call bool ManagerImpl::answerCall(const std::string& call_id) { - _debug("Manager: Answer call %s", call_id.c_str()); + DEBUG("Manager: Answer call %s", call_id.c_str()); // If sflphone is ringing stopTone(); @@ -282,21 +282,21 @@ bool ManagerImpl::answerCall(const std::string& call_id) Call *call = getAccountLink(account_id)->getCall(call_id); if (call == NULL) { - _error("Manager: Error: Call is null"); + ERROR("Manager: Error: Call is null"); } // in any cases we have to detach from current communication if (hasCurrentCall()) { - _debug("Manager: Currently conversing with %s", current_call_id.c_str()); + DEBUG("Manager: Currently conversing with %s", current_call_id.c_str()); if (!isConference(current_call_id) && !participToConference(current_call_id)) { // if it is not a conference and is not a conference participant - _debug("Manager: Answer call: Put the current call (%s) on hold", current_call_id.c_str()); + DEBUG("Manager: Answer call: Put the current call (%s) on hold", current_call_id.c_str()); onHoldCall(current_call_id); } else if (isConference(current_call_id) && !participToConference(call_id)) { // if we are talking to a conference and we are answering an incoming call - _debug("Manager: Detach main participant from conference"); + DEBUG("Manager: Detach main participant from conference"); detachParticipant(Call::DEFAULT_ID, current_call_id); } } @@ -304,7 +304,7 @@ bool ManagerImpl::answerCall(const std::string& call_id) try { getAccountLink(account_id)->answer(call); } catch (const VoipLinkException &e) { - _error("Manager: Error: %s", e.what()); + ERROR("Manager: Error: %s", e.what()); } // if it was waiting, it's waiting no more @@ -337,7 +337,7 @@ bool ManagerImpl::answerCall(const std::string& call_id) //THREAD=Main void ManagerImpl::hangupCall(const std::string& callId) { - _info("Manager: Hangup call %s", callId.c_str()); + INFO("Manager: Hangup call %s", callId.c_str()); // store the current call id std::string currentCallId(getCurrentCallId()); @@ -345,11 +345,11 @@ void ManagerImpl::hangupCall(const std::string& callId) stopTone(); /* Broadcast a signal over DBus */ - _debug("Manager: Send DBUS call state change (HUNGUP) for id %s", callId.c_str()); + DEBUG("Manager: Send DBUS call state change (HUNGUP) for id %s", callId.c_str()); dbus_.getCallManager()->callStateChanged(callId, "HUNGUP"); if (not isValidCall(callId) and not getConfigFromCall(callId) == Call::IPtoIP) { - _error("Manager: Error: Could not hang up call, call not valid"); + ERROR("Manager: Error: Could not hang up call, call not valid"); return; } @@ -375,7 +375,7 @@ void ManagerImpl::hangupCall(const std::string& callId) try { SIPVoIPLink::instance()->hangup(callId); } catch (const VoipLinkException &e) { - _error("%s", e.what()); + ERROR("%s", e.what()); } } else { std::string accountId(getAccountFromCall(callId)); @@ -388,7 +388,7 @@ void ManagerImpl::hangupCall(const std::string& callId) bool ManagerImpl::hangupConference(const std::string& id) { - _debug("Manager: Hangup conference %s", id.c_str()); + DEBUG("Manager: Hangup conference %s", id.c_str()); ConferenceMap::iterator iter_conf = conferenceMap_.find(id); @@ -402,7 +402,7 @@ bool ManagerImpl::hangupConference(const std::string& id) iter != participants.end(); ++iter) hangupCall(*iter); } else { - _error("Manager: No such conference %s", id.c_str()); + ERROR("Manager: No such conference %s", id.c_str()); return false; } } @@ -418,7 +418,7 @@ bool ManagerImpl::hangupConference(const std::string& id) //THREAD=Main void ManagerImpl::onHoldCall(const std::string& callId) { - _debug("Manager: Put call %s on hold", callId.c_str()); + DEBUG("Manager: Put call %s on hold", callId.c_str()); stopTone(); @@ -433,14 +433,14 @@ void ManagerImpl::onHoldCall(const std::string& callId) std::string account_id(getAccountFromCall(callId)); if (account_id.empty()) { - _debug("Manager: Account ID %s or callid %s doesn't exists in call onHold", account_id.c_str(), callId.c_str()); + DEBUG("Manager: Account ID %s or callid %s doesn't exists in call onHold", account_id.c_str(), callId.c_str()); return; } getAccountLink(account_id)->onhold(callId); } } catch (const VoipLinkException &e) { - _error("Manager: Error: %s", e.what()); + ERROR("Manager: Error: %s", e.what()); } // Unbind calls in main buffer @@ -465,7 +465,7 @@ void ManagerImpl::offHoldCall(const std::string& callId) std::string accountId; std::string codecName; - _debug("Manager: Put call %s off hold", callId.c_str()); + DEBUG("Manager: Put call %s off hold", callId.c_str()); stopTone(); @@ -477,7 +477,7 @@ void ManagerImpl::offHoldCall(const std::string& callId) // if this is not a conference and this and is not a conference participant if (!isConference(currentCallId) && !participToConference(currentCallId)) { - _debug("Manager: Has current call (%s), put on hold", currentCallId.c_str()); + DEBUG("Manager: Has current call (%s), put on hold", currentCallId.c_str()); onHoldCall(currentCallId); } else if (isConference(currentCallId) && !participToConference(callId)) detachParticipant(Call::DEFAULT_ID, currentCallId); @@ -492,7 +492,7 @@ void ManagerImpl::offHoldCall(const std::string& callId) /* Classic call, attached to an account */ accountId = getAccountFromCall(callId); - _debug("Manager: Setting offhold, Account %s, callid %s", accountId.c_str(), callId.c_str()); + DEBUG("Manager: Setting offhold, Account %s, callid %s", accountId.c_str(), callId.c_str()); Call * call = getAccountLink(accountId)->getCall(callId); @@ -613,7 +613,7 @@ Conference* ManagerImpl::createConference(const std::string& id1, const std::string& id2) { typedef std::pair<std::string, Conference*> ConferenceEntry; - _debug("Manager: Create conference with call %s and %s", id1.c_str(), id2.c_str()); + DEBUG("Manager: Create conference with call %s and %s", id1.c_str(), id2.c_str()); Conference* conf = new Conference; @@ -631,9 +631,9 @@ ManagerImpl::createConference(const std::string& id1, const std::string& id2) void ManagerImpl::removeConference(const std::string& conference_id) { - _debug("Manager: Remove conference %s", conference_id.c_str()); + DEBUG("Manager: Remove conference %s", conference_id.c_str()); - _debug("Manager: number of participants: %u", conferenceMap_.size()); + DEBUG("Manager: number of participants: %u", conferenceMap_.size()); ConferenceMap::iterator iter = conferenceMap_.find(conference_id); Conference* conf = 0; @@ -642,7 +642,7 @@ void ManagerImpl::removeConference(const std::string& conference_id) conf = iter->second; if (conf == NULL) { - _error("Manager: Error: Conference not found"); + ERROR("Manager: Error: Conference not found"); return; } @@ -664,9 +664,9 @@ void ManagerImpl::removeConference(const std::string& conference_id) // Then remove the conference from the conference map if (conferenceMap_.erase(conference_id) == 1) - _debug("Manager: Conference %s removed successfully", conference_id.c_str()); + DEBUG("Manager: Conference %s removed successfully", conference_id.c_str()); else - _error("Manager: Error: Cannot remove conference: %s", conference_id.c_str()); + ERROR("Manager: Error: Cannot remove conference: %s", conference_id.c_str()); delete conf; } @@ -748,7 +748,7 @@ bool ManagerImpl::participToConference(const std::string& call_id) Call *call = getAccountLink(accountId)->getCall(call_id); if (call == NULL) { - _error("Manager: Error call is NULL in particip to conference"); + ERROR("Manager: Error call is NULL in particip to conference"); return false; } @@ -760,11 +760,11 @@ bool ManagerImpl::participToConference(const std::string& call_id) void ManagerImpl::addParticipant(const std::string& callId, const std::string& conferenceId) { - _debug("Manager: Add participant %s to %s", callId.c_str(), conferenceId.c_str()); + DEBUG("Manager: Add participant %s to %s", callId.c_str(), conferenceId.c_str()); ConferenceMap::iterator iter = conferenceMap_.find(conferenceId); if (iter == conferenceMap_.end()) { - _error("Manager: Error: Conference id is not valid"); + ERROR("Manager: Error: Conference id is not valid"); return; } @@ -772,7 +772,7 @@ void ManagerImpl::addParticipant(const std::string& callId, const std::string& c Call *call = getAccountLink(currentAccountId)->getCall(callId); if (call == NULL) { - _error("Manager: Error: Call id is not valid"); + ERROR("Manager: Error: Call id is not valid"); return; } @@ -820,7 +820,7 @@ void ManagerImpl::addParticipant(const std::string& callId, const std::string& c ParticipantSet participants(conf->getParticipantList()); if (participants.empty()) - _error("Manager: Error: Participant list is empty for this conference"); + ERROR("Manager: Error: Participant list is empty for this conference"); // reset ring buffer for all conference participant // flush conference participants only @@ -868,7 +868,7 @@ void ManagerImpl::addMainParticipant(const std::string& conference_id) else if (conf->getState() == Conference::ACTIVE_DETACHED_REC) conf->setState(Conference::ACTIVE_ATTACHED_REC); else - _warn("Manager: Warning: Invalid conference state while adding main participant"); + WARN("Manager: Warning: Invalid conference state while adding main participant"); dbus_.getCallManager()->conferenceChanged(conference_id, conf->getStateStr()); } @@ -880,13 +880,13 @@ void ManagerImpl::addMainParticipant(const std::string& conference_id) void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& callId2) { - _debug("Manager: Join participants %s, %s", callId1.c_str(), callId2.c_str()); + DEBUG("Manager: Join participants %s, %s", callId1.c_str(), callId2.c_str()); std::map<std::string, std::string> call1Details(getCallDetails(callId1)); std::map<std::string, std::string> call2Details(getCallDetails(callId2)); std::string current_call_id(getCurrentCallId()); - _debug("Manager: Current Call ID %s", current_call_id.c_str()); + DEBUG("Manager: Current Call ID %s", current_call_id.c_str()); // detach from the conference and switch to this conference if ((current_call_id != callId1) and (current_call_id != callId2)) { @@ -904,7 +904,7 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& Call *call1 = getAccountLink(currentAccountId1)->getCall(callId1); if (call1 == NULL) { - _error("Manager: Could not find call %s", callId1.c_str()); + ERROR("Manager: Could not find call %s", callId1.c_str()); return; } @@ -916,7 +916,7 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& Call *call2 = getAccountLink(currentAccountId2)->getCall(callId2); if (call2 == NULL) { - _error("Manager: Could not find call %s", callId2.c_str()); + ERROR("Manager: Could not find call %s", callId2.c_str()); return; } @@ -925,7 +925,7 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& // Process call1 according to its state std::string call1_state_str(call1Details.find("CALL_STATE")->second); - _debug("Manager: Process call %s state: %s", callId1.c_str(), call1_state_str.c_str()); + DEBUG("Manager: Process call %s state: %s", callId1.c_str(), call1_state_str.c_str()); if (call1_state_str == "HOLD") { conf->bindParticipant(callId1); @@ -941,11 +941,11 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& conf->bindParticipant(callId1); answerCall(callId1); } else - _warn("Manager: Call state not recognized"); + WARN("Manager: Call state not recognized"); // Process call2 according to its state std::string call2_state_str(call2Details.find("CALL_STATE")->second); - _debug("Manager: Process call %s state: %s", callId2.c_str(), call2_state_str.c_str()); + DEBUG("Manager: Process call %s state: %s", callId2.c_str(), call2_state_str.c_str()); if (call2_state_str == "HOLD") { conf->bindParticipant(callId2); @@ -961,7 +961,7 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& conf->bindParticipant(callId2); answerCall(callId2); } else - _warn("Manager: Call state not recognized"); + WARN("Manager: Call state not recognized"); // Switch current call id to this conference switchCall(conf->getConfID()); @@ -982,7 +982,7 @@ void ManagerImpl::createConfFromParticipantList(const std::vector< std::string > { // we must at least have 2 participant for a conference if (participantList.size() <= 1) { - _error("Manager: Error: Participant number must be higher or equal to 2"); + ERROR("Manager: Error: Participant number must be higher or equal to 2"); return; } @@ -1034,7 +1034,7 @@ void ManagerImpl::createConfFromParticipantList(const std::vector< std::string > void ManagerImpl::detachParticipant(const std::string& call_id, const std::string& current_id) { - _debug("Manager: Detach participant %s (current id: %s)", call_id.c_str(), + DEBUG("Manager: Detach participant %s (current id: %s)", call_id.c_str(), current_id.c_str()); std::string current_call_id(getCurrentCallId()); @@ -1043,14 +1043,14 @@ void ManagerImpl::detachParticipant(const std::string& call_id, Call *call = getAccountLink(currentAccountId)->getCall(call_id); if (call == NULL) { - _error("Manager: Error: Could not find call %s", call_id.c_str()); + ERROR("Manager: Error: Could not find call %s", call_id.c_str()); return; } Conference *conf = getConferenceFromCallID(call_id); if (conf == NULL) { - _error("Manager: Error: Call is not conferencing, cannot detach"); + ERROR("Manager: Error: Call is not conferencing, cannot detach"); return; } @@ -1058,7 +1058,7 @@ void ManagerImpl::detachParticipant(const std::string& call_id, std::map<std::string, std::string>::iterator iter_details(call_details.find("CALL_STATE")); if (iter_details == call_details.end()) { - _error("Manager: Error: Could not find CALL_STATE"); + ERROR("Manager: Error: Could not find CALL_STATE"); return; } @@ -1070,25 +1070,25 @@ void ManagerImpl::detachParticipant(const std::string& call_id, // Conference may have been deleted and set to 0 above processRemainingParticipants(current_call_id, conf); if (conf == 0) { - _error("Manager: Error: Call is not conferencing, cannot detach"); + ERROR("Manager: Error: Call is not conferencing, cannot detach"); return; } } dbus_.getCallManager()->conferenceChanged(conf->getConfID(), conf->getStateStr()); } else { - _debug("Manager: Unbind main participant from conference %d"); + DEBUG("Manager: Unbind main participant from conference %d"); getMainBuffer()->unBindAll(Call::DEFAULT_ID); if (!isConference(current_call_id)) { - _error("Manager: Warning: Current call id (%s) is not a conference", current_call_id.c_str()); + ERROR("Manager: Warning: Current call id (%s) is not a conference", current_call_id.c_str()); return; } ConferenceMap::iterator iter = conferenceMap_.find(current_call_id); if (iter == conferenceMap_.end() or iter->second == 0) { - _debug("Manager: Error: Conference is NULL"); + DEBUG("Manager: Error: Conference is NULL"); return; } Conference *conf = iter->second; @@ -1098,7 +1098,7 @@ void ManagerImpl::detachParticipant(const std::string& call_id, else if (conf->getState() == Conference::ACTIVE_ATTACHED_REC) conf->setState(Conference::ACTIVE_DETACHED_REC); else - _warn("Manager: Warning: Undefined behavior, invalid conference state in detach participant"); + WARN("Manager: Warning: Undefined behavior, invalid conference state in detach participant"); dbus_.getCallManager()->conferenceChanged(conf->getConfID(), conf->getStateStr()); @@ -1109,7 +1109,7 @@ void ManagerImpl::detachParticipant(const std::string& call_id, void ManagerImpl::removeParticipant(const std::string& call_id) { - _debug("Manager: Remove participant %s", call_id.c_str()); + DEBUG("Manager: Remove participant %s", call_id.c_str()); // this call is no more a conference participant const std::string currentAccountId(getAccountFromCall(call_id)); @@ -1119,12 +1119,12 @@ void ManagerImpl::removeParticipant(const std::string& call_id) ConferenceMap::const_iterator iter = conf_map.find(call->getConfId()); if (iter == conf_map.end() or iter->second == 0) { - _error("Manager: Error: No conference with id %s, cannot remove participant", call->getConfId().c_str()); + ERROR("Manager: Error: No conference with id %s, cannot remove participant", call->getConfId().c_str()); return; } Conference *conf = iter->second; - _debug("Manager: Remove participant %s", call_id.c_str()); + DEBUG("Manager: Remove participant %s", call_id.c_str()); conf->remove(call_id); call->setConfId(""); @@ -1137,7 +1137,7 @@ void ManagerImpl::processRemainingParticipants(const std::string ¤t_call_i { ParticipantSet participants(conf->getParticipantList()); size_t n = participants.size(); - _debug("Manager: Process remaining %d participant(s) from conference %s", + DEBUG("Manager: Process remaining %d participant(s) from conference %s", n, conf->getConfID().c_str()); if (n > 1) { @@ -1169,7 +1169,7 @@ void ManagerImpl::processRemainingParticipants(const std::string ¤t_call_i removeConference(conf->getConfID()); conf = 0; } else { - _debug("Manager: No remaining participants, remove conference"); + DEBUG("Manager: No remaining participants, remove conference"); removeConference(conf->getConfID()); conf = 0; switchCall(""); @@ -1182,12 +1182,12 @@ void ManagerImpl::joinConference(const std::string& conf_id1, ConferenceMap::iterator iter(conferenceMap_.find(conf_id1)); if (iter == conferenceMap_.end()) { - _error("Manager: Error: Not a valid conference ID: %s", conf_id1.c_str()); + ERROR("Manager: Error: Not a valid conference ID: %s", conf_id1.c_str()); return; } if (conferenceMap_.find(conf_id2) != conferenceMap_.end()) { - _error("Manager: Error: Not a valid conference ID: %s", conf_id2.c_str()); + ERROR("Manager: Error: Not a valid conference ID: %s", conf_id2.c_str()); return; } @@ -1205,13 +1205,13 @@ void ManagerImpl::joinConference(const std::string& conf_id1, void ManagerImpl::addStream(const std::string& call_id) { - _debug("Manager: Add audio stream %s", call_id.c_str()); + DEBUG("Manager: Add audio stream %s", call_id.c_str()); std::string currentAccountId(getAccountFromCall(call_id)); Call *call = getAccountLink(currentAccountId)->getCall(call_id); if (call and participToConference(call_id)) { - _debug("Manager: Add stream to conference"); + DEBUG("Manager: Add stream to conference"); // bind to conference participant ConferenceMap::iterator iter = conferenceMap_.find(call->getConfId()); @@ -1232,7 +1232,7 @@ void ManagerImpl::addStream(const std::string& call_id) } } else { - _debug("Manager: Add stream to call"); + DEBUG("Manager: Add stream to call"); // bind to main getMainBuffer()->bindCallID(call_id); @@ -1248,7 +1248,7 @@ void ManagerImpl::addStream(const std::string& call_id) void ManagerImpl::removeStream(const std::string& call_id) { - _debug("Manager: Remove audio stream %s", call_id.c_str()); + DEBUG("Manager: Remove audio stream %s", call_id.c_str()); getMainBuffer()->unBindAll(call_id); getMainBuffer()->stateInfo(); } @@ -1256,7 +1256,7 @@ void ManagerImpl::removeStream(const std::string& call_id) //THREAD=Main void ManagerImpl::saveConfig() { - _debug("Manager: Saving Configuration to XDG directory %s", path_.c_str()); + DEBUG("Manager: Saving Configuration to XDG directory %s", path_.c_str()); audioPreference.setVolumemic(getMicVolume()); audioPreference.setVolumespkr(getSpkrVolume()); @@ -1280,7 +1280,7 @@ void ManagerImpl::saveConfig() emitter.serializeData(); } catch (const Conf::YamlEmitterException &e) { - _error("ConfigTree: %s", e.what()); + ERROR("ConfigTree: %s", e.what()); } } @@ -1298,7 +1298,7 @@ void ManagerImpl::playDtmf(char code) stopTone(); if (not voipPreferences.getPlayDtmf()) { - _debug("Manager: playDtmf: Do not have to play a tone..."); + DEBUG("Manager: playDtmf: Do not have to play a tone..."); return; } @@ -1306,7 +1306,7 @@ void ManagerImpl::playDtmf(char code) int pulselen = voipPreferences.getPulseLength(); if (pulselen == 0) { - _debug("Manager: playDtmf: Pulse length is not set..."); + DEBUG("Manager: playDtmf: Pulse length is not set..."); return; } @@ -1317,7 +1317,7 @@ void ManagerImpl::playDtmf(char code) // fast return, no sound, so no dtmf if (audiodriver_ == NULL || dtmfKey_ == NULL) { - _debug("Manager: playDtmf: Error no audio layer..."); + DEBUG("Manager: playDtmf: Error no audio layer..."); audioLayerMutexUnlock(); return; } @@ -1439,12 +1439,12 @@ void ManagerImpl::incomingMessage(const std::string& callID, std::string accountId(getAccountFromCall(*iter_p)); - _debug("Manager: Send message to %s, (%s)", (*iter_p).c_str(), accountId.c_str()); + DEBUG("Manager: Send message to %s, (%s)", (*iter_p).c_str(), accountId.c_str()); Account *account = getAccount(accountId); if (!account) { - _error("Manager: Failed to get account while sending instant message"); + ERROR("Manager: Failed to get account while sending instant message"); return; } @@ -1463,7 +1463,7 @@ void ManagerImpl::incomingMessage(const std::string& callID, bool ManagerImpl::sendTextMessage(const std::string& callID, const std::string& message, const std::string& from) { if (isConference(callID)) { - _debug("Manager: Is a conference, send instant message to everyone"); + DEBUG("Manager: Is a conference, send instant message to everyone"); ConferenceMap::iterator it = conferenceMap_.find(callID); if (it == conferenceMap_.end()) @@ -1484,7 +1484,7 @@ bool ManagerImpl::sendTextMessage(const std::string& callID, const std::string& Account *account = getAccount(accountId); if (!account) { - _debug("Manager: Failed to get account while sending instant message"); + DEBUG("Manager: Failed to get account while sending instant message"); return false; } @@ -1495,7 +1495,7 @@ bool ManagerImpl::sendTextMessage(const std::string& callID, const std::string& } if (participToConference(callID)) { - _debug("Manager: Particip to a conference, send instant message to everyone"); + DEBUG("Manager: Particip to a conference, send instant message to everyone"); Conference *conf = getConferenceFromCallID(callID); if (!conf) @@ -1511,7 +1511,7 @@ bool ManagerImpl::sendTextMessage(const std::string& callID, const std::string& Account *account = getAccount(accountId); if (!account) { - _debug("Manager: Failed to get account while sending instant message"); + DEBUG("Manager: Failed to get account while sending instant message"); return false; } @@ -1521,7 +1521,7 @@ bool ManagerImpl::sendTextMessage(const std::string& callID, const std::string& Account *account = getAccount(getAccountFromCall(callID)); if (!account) { - _debug("Manager: Failed to get account while sending instant message"); + DEBUG("Manager: Failed to get account while sending instant message"); return false; } @@ -1534,7 +1534,7 @@ bool ManagerImpl::sendTextMessage(const std::string& callID, const std::string& //THREAD=VoIP CALL=Outgoing void ManagerImpl::peerAnsweredCall(const std::string& id) { - _debug("Manager: Peer answered call %s", id.c_str()); + DEBUG("Manager: Peer answered call %s", id.c_str()); // The if statement is usefull only if we sent two calls at the same time. if (isCurrentCall(id)) @@ -1558,7 +1558,7 @@ void ManagerImpl::peerAnsweredCall(const std::string& id) //THREAD=VoIP Call=Outgoing void ManagerImpl::peerRingingCall(const std::string& id) { - _debug("Manager: Peer call %s ringing", id.c_str()); + DEBUG("Manager: Peer call %s ringing", id.c_str()); if (isCurrentCall(id)) ringback(); @@ -1569,7 +1569,7 @@ void ManagerImpl::peerRingingCall(const std::string& id) //THREAD=VoIP Call=Outgoing/Ingoing void ManagerImpl::peerHungupCall(const std::string& call_id) { - _debug("Manager: Peer hungup call %s", call_id.c_str()); + DEBUG("Manager: Peer hungup call %s", call_id.c_str()); if (participToConference(call_id)) { Conference *conf = getConferenceFromCallID(call_id); @@ -1601,7 +1601,7 @@ void ManagerImpl::peerHungupCall(const std::string& call_id) removeStream(call_id); if (getCallList().empty()) { - _debug("Manager: Stop audio stream, ther is only %d call(s) remaining", getCallList().size()); + DEBUG("Manager: Stop audio stream, ther is only %d call(s) remaining", getCallList().size()); audioLayerMutexLock(); audiodriver_->stopStream(); @@ -1612,7 +1612,7 @@ void ManagerImpl::peerHungupCall(const std::string& call_id) //THREAD=VoIP void ManagerImpl::callBusy(const std::string& id) { - _debug("Manager: Call %s busy", id.c_str()); + DEBUG("Manager: Call %s busy", id.c_str()); dbus_.getCallManager()->callStateChanged(id, "BUSY"); if (isCurrentCall(id)) { @@ -1635,11 +1635,11 @@ void ManagerImpl::callFailure(const std::string& call_id) } if (participToConference(call_id)) { - _debug("Manager: Call %s participating to a conference failed", call_id.c_str()); + DEBUG("Manager: Call %s participating to a conference failed", call_id.c_str()); Conference *conf = getConferenceFromCallID(call_id); if (conf == NULL) { - _error("Manager: Could not retreive conference from call id %s", call_id.c_str()); + ERROR("Manager: Could not retreive conference from call id %s", call_id.c_str()); return; } @@ -1675,7 +1675,7 @@ void ManagerImpl::playATone(Tone::TONEID toneId) audioLayerMutexLock(); if (audiodriver_ == NULL) { - _error("Manager: Error: Audio layer not initialized"); + ERROR("Manager: Error: Audio layer not initialized"); audioLayerMutexUnlock(); return; } @@ -1754,7 +1754,7 @@ void ManagerImpl::ringtone(const std::string& accountID) Account *account = getAccount(accountID); if (!account) { - _warn("Manager: Warning: invalid account in ringtone"); + WARN("Manager: Warning: invalid account in ringtone"); return; } @@ -1775,7 +1775,7 @@ void ManagerImpl::ringtone(const std::string& accountID) audioLayerMutexLock(); if (!audiodriver_) { - _error("Manager: Error: no audio layer in ringtone"); + ERROR("Manager: Error: no audio layer in ringtone"); audioLayerMutexUnlock(); return; } @@ -1807,7 +1807,7 @@ void ManagerImpl::ringtone(const std::string& accountID) audiofile_ = new RawFile(ringchoice, static_cast<sfl::AudioCodec *>(codec), samplerate); } } catch (AudioFileException &e) { - _error("Manager: Exception: %s", e.what()); + ERROR("Manager: Exception: %s", e.what()); } } // leave mutex @@ -1856,7 +1856,7 @@ std::string ManagerImpl::getConfigFile() const if (mkdir(configdir.data(), 0700) != 0) { // If directory creation failed if (errno != EEXIST) - _debug("Cannot create directory: %m"); + DEBUG("Cannot create directory: %m"); } static const char * const PROGNAME = "sflphoned"; @@ -1917,7 +1917,7 @@ void ManagerImpl::setAudioPlugin(const std::string& audioPlugin) AlsaLayer *alsa = dynamic_cast<AlsaLayer*>(audiodriver_); if (!alsa) { - _error("Can't find alsa device"); + ERROR("Can't find alsa device"); audioLayerMutexUnlock(); return ; } @@ -1944,7 +1944,7 @@ void ManagerImpl::setAudioDevice(const int index, int streamType) AlsaLayer *alsaLayer = dynamic_cast<AlsaLayer*>(audiodriver_); if (!alsaLayer) { - _error("Can't find alsa device"); + ERROR("Can't find alsa device"); audioLayerMutexUnlock(); return ; } @@ -2045,7 +2045,7 @@ int ManagerImpl::isRingtoneEnabled(const std::string& id) Account *account = getAccount(id); if (!account) { - _warn("Manager: Warning: invalid account in ringtone enabled"); + WARN("Manager: Warning: invalid account in ringtone enabled"); return 0; } @@ -2057,7 +2057,7 @@ void ManagerImpl::ringtoneEnabled(const std::string& id) Account *account = getAccount(id); if (!account) { - _warn("Manager: Warning: invalid account in ringtone enabled"); + WARN("Manager: Warning: invalid account in ringtone enabled"); return; } @@ -2071,7 +2071,7 @@ std::string ManagerImpl::getRecordPath() const void ManagerImpl::setRecordPath(const std::string& recPath) { - _debug("Manager: Set record path %s", recPath.c_str()); + DEBUG("Manager: Set record path %s", recPath.c_str()); audioPreference.setRecordpath(recPath); } @@ -2091,11 +2091,11 @@ void ManagerImpl::setRecordingCall(const std::string& id) ConferenceMap::const_iterator it(conferenceMap_.find(id)); if (it == conferenceMap_.end()) { - _debug("Manager: Set recording for call %s", id.c_str()); + DEBUG("Manager: Set recording for call %s", id.c_str()); std::string accountid(getAccountFromCall(id)); rec = getAccountLink(accountid)->getCall(id); } else { - _debug("Manager: Set recording for conference %s", id.c_str()); + DEBUG("Manager: Set recording for conference %s", id.c_str()); Conference *conf = it->second; if (conf) { @@ -2108,7 +2108,7 @@ void ManagerImpl::setRecordingCall(const std::string& id) } if (rec == NULL) { - _error("Manager: Error: Could not find recordable instance %s", id.c_str()); + ERROR("Manager: Error: Could not find recordable instance %s", id.c_str()); return; } @@ -2125,12 +2125,12 @@ bool ManagerImpl::isRecording(const std::string& id) bool ManagerImpl::startRecordedFilePlayback(const std::string& filepath) { - _debug("Manager: Start recorded file playback %s", filepath.c_str()); + DEBUG("Manager: Start recorded file playback %s", filepath.c_str()); audioLayerMutexLock(); if (!audiodriver_) { - _error("Manager: Error: No audio layer in start recorded file playback"); + ERROR("Manager: Error: No audio layer in start recorded file playback"); audioLayerMutexUnlock(); return false; } @@ -2151,7 +2151,7 @@ bool ManagerImpl::startRecordedFilePlayback(const std::string& filepath) try { audiofile_ = new WaveFile(filepath, sampleRate); } catch (const AudioFileException &e) { - _error("Manager: Exception: %s", e.what()); + ERROR("Manager: Exception: %s", e.what()); } } // release toneMutex @@ -2165,7 +2165,7 @@ bool ManagerImpl::startRecordedFilePlayback(const std::string& filepath) void ManagerImpl::stopRecordedFilePlayback(const std::string& filepath) { - _debug("Manager: Stop recorded file playback %s", filepath.c_str()); + DEBUG("Manager: Stop recorded file playback %s", filepath.c_str()); audioLayerMutexLock(); audiodriver_->stopStream(); @@ -2180,7 +2180,7 @@ void ManagerImpl::stopRecordedFilePlayback(const std::string& filepath) void ManagerImpl::setHistoryLimit(int days) { - _debug("Manager: Set history limit"); + DEBUG("Manager: Set history limit"); preferences.setHistoryLimit(days); saveConfig(); } @@ -2197,7 +2197,7 @@ int32_t ManagerImpl::getMailNotify() const void ManagerImpl::setMailNotify() { - _debug("Manager: Set mail notify"); + DEBUG("Manager: Set mail notify"); preferences.getNotifyMails() ? preferences.setNotifyMails(true) : preferences.setNotifyMails(false); saveConfig(); } @@ -2212,7 +2212,7 @@ void ManagerImpl::setAudioManager(const std::string &api) } if (api == audioPreference.getAudioApi()) { - _debug("Manager: Audio manager chosen already in use. No changes made. "); + DEBUG("Manager: Audio manager chosen already in use. No changes made. "); audioLayerMutexUnlock(); return; } @@ -2237,7 +2237,7 @@ int ManagerImpl::getAudioDeviceIndex(const std::string &name) audioLayerMutexLock(); if (audiodriver_ == NULL) { - _error("Manager: Error: Audio layer not initialized"); + ERROR("Manager: Error: Audio layer not initialized"); audioLayerMutexUnlock(); return soundCardIndex; } @@ -2328,7 +2328,7 @@ void ManagerImpl::audioSamplingRateChanged(int samplerate) audioLayerMutexLock(); if (!audiodriver_) { - _debug("Manager: No Audio driver initialized"); + DEBUG("Manager: No Audio driver initialized"); audioLayerMutexUnlock(); return; } @@ -2337,11 +2337,11 @@ void ManagerImpl::audioSamplingRateChanged(int samplerate) int currentSamplerate = mainBuffer_.getInternalSamplingRate(); if (currentSamplerate >= samplerate) { - _debug("Manager: No need to update audio layer sampling rate"); + DEBUG("Manager: No need to update audio layer sampling rate"); audioLayerMutexUnlock(); return; } else - _debug("Manager: Audio sampling rate changed: %d -> %d", currentSamplerate, samplerate); + DEBUG("Manager: Audio sampling rate changed: %d -> %d", currentSamplerate, samplerate); bool wasActive = audiodriver_->isStarted(); @@ -2436,7 +2436,7 @@ bool ManagerImpl::setConfig(const std::string& section, void ManagerImpl::setAccountsOrder(const std::string& order) { - _debug("Manager: Set accounts order : %s", order.c_str()); + DEBUG("Manager: Set accounts order : %s", order.c_str()); // Set the new config preferences.setAccountOrder(order); @@ -2458,7 +2458,7 @@ std::vector<std::string> ManagerImpl::getAccountList() const if (ip2ip_iter->second) v.push_back(ip2ip_iter->second->getAccountID()); else - _error("Manager: could not find IP2IP profile in getAccount list"); + ERROR("Manager: could not find IP2IP profile in getAccount list"); // If no order has been set, load the default one ie according to the creation date. if (account_order.empty()) { @@ -2492,7 +2492,7 @@ std::map<std::string, std::string> ManagerImpl::getAccountDetails( static const SIPAccount DEFAULT_ACCOUNT("default"); if (accountID.empty()) { - _debug("Manager: Returning default account settings"); + DEBUG("Manager: Returning default account settings"); return DEFAULT_ACCOUNT.getAccountDetails(); } @@ -2505,7 +2505,7 @@ std::map<std::string, std::string> ManagerImpl::getAccountDetails( if (account) return account->getAccountDetails(); else { - _debug("Manager: Get account details on a non-existing accountID %s. Returning default", accountID.c_str()); + DEBUG("Manager: Get account details on a non-existing accountID %s. Returning default", accountID.c_str()); return DEFAULT_ACCOUNT.getAccountDetails(); } } @@ -2516,12 +2516,12 @@ std::map<std::string, std::string> ManagerImpl::getAccountDetails( void ManagerImpl::setAccountDetails(const std::string& accountID, const std::map<std::string, std::string>& details) { - _debug("Manager: Set account details for %s", accountID.c_str()); + DEBUG("Manager: Set account details for %s", accountID.c_str()); Account* account = getAccount(accountID); if (account == NULL) { - _error("Manager: Error: Could not find account %s", accountID.c_str()); + ERROR("Manager: Error: Could not find account %s", accountID.c_str()); return; } @@ -2550,7 +2550,7 @@ std::string ManagerImpl::addAccount(const std::map<std::string, std::string>& de // Get the type std::string accountType((*details.find(CONFIG_ACCOUNT_TYPE)).second); - _debug("Manager: Adding account %s", newAccountID.c_str()); + DEBUG("Manager: Adding account %s", newAccountID.c_str()); /** @todo Verify the uniqueness, in case a program adds accounts, two in a row. */ @@ -2561,7 +2561,7 @@ std::string ManagerImpl::addAccount(const std::map<std::string, std::string>& de else if (accountType == "IAX") newAccount = new IAXAccount(newAccountID); else { - _error("Unknown %s param when calling addAccount(): %s", + ERROR("Unknown %s param when calling addAccount(): %s", CONFIG_ACCOUNT_TYPE, accountType.c_str()); return ""; } @@ -2584,7 +2584,7 @@ std::string ManagerImpl::addAccount(const std::map<std::string, std::string>& de preferences.setAccountOrder(accountList); } - _debug("AccountMap: %s", accountList.c_str()); + DEBUG("AccountMap: %s", accountList.c_str()); newAccount->registerVoIPLink(); @@ -2622,7 +2622,7 @@ bool ManagerImpl::associateCallToAccount(const std::string& callID, // account id exist in AccountMap ost::MutexLock m(callAccountMapMutex_); callAccountMap_[callID] = accountID; - _debug("Manager: Associate Call %s with Account %s", callID.data(), accountID.data()); + DEBUG("Manager: Associate Call %s with Account %s", callID.data(), accountID.data()); return true; } @@ -2784,14 +2784,14 @@ ManagerImpl::getAccount(const std::string& accountID) const std::string ManagerImpl::getAccountIdFromNameAndServer(const std::string& userName, const std::string& server) const { - _info("Manager : username = %s , server = %s", userName.c_str(), server.c_str()); + INFO("Manager : username = %s , server = %s", userName.c_str(), server.c_str()); // Try to find the account id from username and server name by full match for (AccountMap::const_iterator iter = accountMap_.begin(); iter != accountMap_.end(); ++iter) { SIPAccount *account = dynamic_cast<SIPAccount *>(iter->second); if (account and account->isEnabled() and account->fullMatch(userName, server)) { - _debug("Manager: Matching account id in request is a fullmatch %s@%s", userName.c_str(), server.c_str()); + DEBUG("Manager: Matching account id in request is a fullmatch %s@%s", userName.c_str(), server.c_str()); return iter->first; } } @@ -2801,7 +2801,7 @@ std::string ManagerImpl::getAccountIdFromNameAndServer(const std::string& userNa SIPAccount *account = dynamic_cast<SIPAccount *>(iter->second); if (account and account->isEnabled() and account->hostnameMatch(server)) { - _debug("Manager: Matching account id in request with hostname %s", server.c_str()); + DEBUG("Manager: Matching account id in request with hostname %s", server.c_str()); return iter->first; } } @@ -2811,12 +2811,12 @@ std::string ManagerImpl::getAccountIdFromNameAndServer(const std::string& userNa SIPAccount *account = dynamic_cast<SIPAccount *>(iter->second); if (account and account->isEnabled() and account->userMatch(userName)) { - _debug("Manager: Matching account id in request with username %s", userName.c_str()); + DEBUG("Manager: Matching account id in request with username %s", userName.c_str()); return iter->first; } } - _debug("Manager: Username %s or server %s doesn't match any account, using IP2IP", userName.c_str(), server.c_str()); + DEBUG("Manager: Username %s or server %s doesn't match any account, using IP2IP", userName.c_str(), server.c_str()); return ""; } @@ -2895,7 +2895,7 @@ bool ManagerImpl::associateConfigToCall(const std::string& callID, { if (getConfigFromCall(callID) == 0) { // nothing with the same ID callConfigMap_[callID] = config; - _debug("Manager: Associate call %s with config %d", callID.c_str(), config); + DEBUG("Manager: Associate call %s with config %d", callID.c_str(), config); return true; } else return false; @@ -2947,7 +2947,7 @@ std::map<std::string, std::string> ManagerImpl::getCallDetails(const std::string call_details["CALL_STATE"] = call->getStateStr(); call_details["CALL_TYPE"] = type.str(); } else { - _error("Manager: Error: getCallDetails()"); + ERROR("Manager: Error: getCallDetails()"); call_details["ACCOUNTID"] = ""; call_details["PEER_NUMBER"] = "Unknown"; call_details["PEER_NAME"] = "Unknown"; @@ -3017,7 +3017,7 @@ std::vector<std::string> ManagerImpl::getParticipantList(const std::string& conf const ParticipantSet participants(iter_conf->second->getParticipantList()); std::copy(participants.begin(), participants.end(), std::back_inserter(v));; } else - _warn("Manager: Warning: Did not find conference %s", confID.c_str()); + WARN("Manager: Warning: Did not find conference %s", confID.c_str()); return v; } diff --git a/daemon/src/preferences.cpp b/daemon/src/preferences.cpp index 4aa49de1041ec252196d17fc15e49138f7c093bb..a690ae47e98e93d70ff0c297ef7ae8cd79a9c7fd 100644 --- a/daemon/src/preferences.cpp +++ b/daemon/src/preferences.cpp @@ -97,7 +97,7 @@ void Preferences::serialize(Conf::YamlEmitter *emiter) void Preferences::unserialize(Conf::MappingNode *map) { if (map == NULL) { - _error("Preference: Error: Preference map is NULL"); + ERROR("Preference: Error: Preference map is NULL"); return; } @@ -144,7 +144,7 @@ void VoipPreference::serialize(Conf::YamlEmitter *emitter) void VoipPreference::unserialize(Conf::MappingNode *map) { if (!map) { - _error("VoipPreference: Error: Preference map is NULL"); + ERROR("VoipPreference: Error: Preference map is NULL"); return; } @@ -193,7 +193,7 @@ void AddressbookPreference::serialize(Conf::YamlEmitter *emitter) void AddressbookPreference::unserialize(Conf::MappingNode *map) { if (!map) { - _error("Addressbook: Error: Preference map is NULL"); + ERROR("Addressbook: Error: Preference map is NULL"); return; } @@ -238,7 +238,7 @@ void HookPreference::serialize(Conf::YamlEmitter *emitter) void HookPreference::unserialize(Conf::MappingNode *map) { if (!map) { - _error("Hook: Error: Preference map is NULL"); + ERROR("Hook: Error: Preference map is NULL"); return; } @@ -274,7 +274,7 @@ namespace { void checkSoundCard(int &card, int stream) { if (not AlsaLayer::soundCardIndexExists(card, stream)) { - _warn(" Card with index %d doesn't exist or is unusable.", card); + WARN(" Card with index %d doesn't exist or is unusable.", card); card = ALSA_DFT_CARD_ID; } } @@ -343,11 +343,11 @@ void AudioPreference::serialize(Conf::YamlEmitter *emitter) Conf::ScalarNode noise(noisereduce_); Conf::ScalarNode echo(echocancel_); std::stringstream tailstr; - _debug("************************************************** serialize echotail %d", echoCancelTailLength_); + DEBUG("************************************************** serialize echotail %d", echoCancelTailLength_); tailstr << echoCancelTailLength_; Conf::ScalarNode echotail(tailstr.str()); std::stringstream delaystr; - _debug("************************************************** serialize echodelay %d", echoCancelTailLength_); + DEBUG("************************************************** serialize echodelay %d", echoCancelTailLength_); delaystr << echoCancelDelay_; Conf::ScalarNode echodelay(delaystr.str()); @@ -454,7 +454,7 @@ void ShortcutPreferences::serialize(Conf::YamlEmitter *emitter) void ShortcutPreferences::unserialize(Conf::MappingNode *map) { if (map == NULL) { - _error("ShortcutPreference: Error: Preference map is NULL"); + ERROR("ShortcutPreference: Error: Preference map is NULL"); return; } diff --git a/daemon/src/sip/pattern.cpp b/daemon/src/sip/pattern.cpp index 25177b86b3f8cfbf5e99a1bb18245fc4434bc065..a4aab2c2c570ffd127fdc06d61ec944d95dc20e3 100644 --- a/daemon/src/sip/pattern.cpp +++ b/daemon/src/sip/pattern.cpp @@ -95,7 +95,7 @@ void Pattern::compile() std::string msg("PCRE compiling failed at offset " + offsetStr); - throw compile_error(msg); + throw CompileError(msg); } // Allocate an appropriate amount @@ -150,10 +150,10 @@ std::string Pattern::group(int groupNumber) throw std::out_of_range("Invalid group reference."); case PCRE_ERROR_NOMEMORY: - throw match_error("Memory exhausted."); + throw MatchError("Memory exhausted."); default: - throw match_error("Failed to get named substring."); + throw MatchError("Failed to get named substring."); } } @@ -177,10 +177,10 @@ std::string Pattern::group(const std::string& groupName) break; case PCRE_ERROR_NOMEMORY: - throw match_error("Memory exhausted."); + throw MatchError("Memory exhausted."); default: - throw match_error("Failed to get named substring."); + throw MatchError("Failed to get named substring."); } } @@ -260,7 +260,7 @@ bool Pattern::matches(const std::string& subject) // Matching succeded but not enough space. // @TODO figure out something more clever to do in this case. if (rc == 0) - throw match_error("No space to store all substrings."); + throw MatchError("No space to store all substrings."); // Matching succeeded. Keep the number of substrings for // subsequent calls to group(). diff --git a/daemon/src/sip/pattern.h b/daemon/src/sip/pattern.h index a81fe8971f427127057d5deeb1072403aeb42f01..afc7aba9015b24d81489561a9ce113d15cc896ef 100644 --- a/daemon/src/sip/pattern.h +++ b/daemon/src/sip/pattern.h @@ -41,9 +41,9 @@ namespace sfl { * an error occured while compiling the * regular expression. */ -class compile_error : public std::invalid_argument { +class CompileError : public std::invalid_argument { public: - explicit compile_error(const std::string& error) : + explicit CompileError(const std::string& error) : std::invalid_argument(error) {} }; @@ -52,9 +52,9 @@ class compile_error : public std::invalid_argument { * an error occured while mathing a * pattern to an expression. */ -class match_error : public std::invalid_argument { +class MatchError : public std::invalid_argument { public: - match_error(const std::string& error) : + MatchError(const std::string& error) : std::invalid_argument(error) {} }; diff --git a/daemon/src/sip/sdes_negotiator.cpp b/daemon/src/sip/sdes_negotiator.cpp index 213a676532d274b21b64cdc93801b3f7c24f05d6..e32a3548bbb55ec539b28bd0f6a12becd48a91ac 100644 --- a/daemon/src/sip/sdes_negotiator.cpp +++ b/daemon/src/sip/sdes_negotiator.cpp @@ -78,8 +78,8 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse() "(?P<mkiValue>[0-9]+)\\:" \ "(?P<mkiLength>[0-9]{1,3})\\;?)?", "g"); - } catch (const compile_error& exception) { - throw parse_error("A compile exception occured on a pattern."); + } catch (const CompileError& exception) { + throw ParseError("A compile exception occured on a pattern."); } @@ -102,9 +102,9 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse() sdesLine = generalSyntaxPattern->split(); if (sdesLine.size() < 3) - throw parse_error("Missing components in SDES line"); - } catch (const match_error& exception) { - throw parse_error("Error while analyzing the SDES line."); + throw ParseError("Missing components in SDES line"); + } catch (const MatchError& exception) { + throw ParseError("Error while analyzing the SDES line."); } // Check if the attribute starts with a=crypto @@ -116,8 +116,8 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse() if (tagPattern->matches()) { try { tag = tagPattern->group("tag"); - } catch (const match_error& exception) { - throw parse_error("Error while parsing the tag field"); + } catch (const MatchError& exception) { + throw ParseError("Error while parsing the tag field"); } } else return cryptoAttributeVector; @@ -131,8 +131,8 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse() if (cryptoSuitePattern->matches()) { try { cryptoSuite = cryptoSuitePattern->group("cryptoSuite"); - } catch (const match_error& exception) { - throw parse_error("Error while parsing the crypto-suite field"); + } catch (const MatchError& exception) { + throw ParseError("Error while parsing the crypto-suite field"); } } else return cryptoAttributeVector; @@ -154,8 +154,8 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse() mkiValue = keyParamsPattern->group("mkiValue"); mkiLength = keyParamsPattern->group("mkiLength"); } - } catch (const match_error& exception) { - throw parse_error("Error while parsing the key-params field"); + } catch (const MatchError& exception) { + throw ParseError("Error while parsing the key-params field"); } // Add the new CryptoAttribute to the vector @@ -198,9 +198,9 @@ bool SdesNegotiator::negotiate() iter_offer++; } - } catch (const parse_error& exception) { + } catch (const ParseError& exception) { return false; - } catch (const match_error& exception) { + } catch (const MatchError& exception) { return false; } diff --git a/daemon/src/sip/sdes_negotiator.h b/daemon/src/sip/sdes_negotiator.h index 42d2b66c96aae4c207db996c37073f17682dbea0..7fb4213555d670af6bd32f68073584107a886c09 100644 --- a/daemon/src/sip/sdes_negotiator.h +++ b/daemon/src/sip/sdes_negotiator.h @@ -41,9 +41,9 @@ namespace sfl { * an error occured with a regular expression * operation. */ -class parse_error : public std::invalid_argument { +class ParseError : public std::invalid_argument { public: - explicit parse_error(const std::string& error) : + explicit ParseError(const std::string& error) : std::invalid_argument(error) {} }; diff --git a/daemon/src/sip/sdp.cpp b/daemon/src/sip/sdp.cpp index 3ada56f849d44b54a8109fc76c091cdff16fdccd..b615b1786542ab52694ce5e0484ccaaffefd8c4f 100644 --- a/daemon/src/sip/sdp.cpp +++ b/daemon/src/sip/sdp.cpp @@ -91,7 +91,7 @@ void Sdp::setActiveRemoteSdpSession(const pjmedia_sdp_session *sdp) activeRemoteSession_ = (pjmedia_sdp_session*) sdp; if (!sdp) { - _error("Sdp: Error: Remote sdp is NULL while parsing telephone event attribute"); + ERROR("Sdp: Error: Remote sdp is NULL while parsing telephone event attribute"); return; } @@ -110,7 +110,7 @@ void Sdp::setActiveRemoteSdpSession(const pjmedia_sdp_session *sdp) return; } - _error("Sdp: Error: Could not found dtmf event from remote sdp"); + ERROR("Sdp: Error: Could not found dtmf event from remote sdp"); } std::string Sdp::getCodecName() const @@ -207,7 +207,7 @@ void Sdp::setTelephoneEventRtpmap(pjmedia_sdp_media *med) void Sdp::setLocalMediaCapabilities(const CodecOrder &selectedCodecs) { if (selectedCodecs.size() == 0) - _warn("No selected codec while building local SDP offer"); + WARN("No selected codec while building local SDP offer"); codec_list_.clear(); @@ -217,7 +217,7 @@ void Sdp::setLocalMediaCapabilities(const CodecOrder &selectedCodecs) if (codec) codec_list_.push_back(codec); else - _warn("SDP: Couldn't find audio codec"); + WARN("SDP: Couldn't find audio codec"); } } @@ -261,7 +261,7 @@ int Sdp::createLocalSession(const CodecOrder &selectedCodecs) char buffer[1000]; pjmedia_sdp_print(localSession_, buffer, sizeof(buffer)); - _debug("SDP: Local SDP Session:\n%s", buffer); + DEBUG("SDP: Local SDP Session:\n%s", buffer); return pjmedia_sdp_validate(localSession_); } @@ -269,9 +269,9 @@ int Sdp::createLocalSession(const CodecOrder &selectedCodecs) void Sdp::createOffer(const CodecOrder &selectedCodecs) { if (createLocalSession(selectedCodecs) != PJ_SUCCESS) - _error("SDP: Error: Failed to create initial offer"); + ERROR("SDP: Error: Failed to create initial offer"); else if (pjmedia_sdp_neg_create_w_local_offer(memPool_, localSession_, &negotiator_) != PJ_SUCCESS) - _error("SDP: Error: Failed to create an initial SDP negotiator"); + ERROR("SDP: Error: Failed to create an initial SDP negotiator"); } void Sdp::receiveOffer(const pjmedia_sdp_session* remote, @@ -283,7 +283,7 @@ void Sdp::receiveOffer(const pjmedia_sdp_session* remote, pjmedia_sdp_print(remote, buffer, sizeof(buffer)); if (localSession_ == NULL && createLocalSession(selectedCodecs) != PJ_SUCCESS) { - _error("SDP: Failed to create initial offer"); + ERROR("SDP: Failed to create initial offer"); return; } @@ -311,18 +311,18 @@ void Sdp::startNegotiation() assert(negotiator_); if (pjmedia_sdp_neg_get_state(negotiator_) != PJMEDIA_SDP_NEG_STATE_WAIT_NEGO) - _warn("SDP: Warning: negotiator not in right state for negotiation"); + WARN("SDP: Warning: negotiator not in right state for negotiation"); if (pjmedia_sdp_neg_negotiate(memPool_, negotiator_, 0) != PJ_SUCCESS) return; if (pjmedia_sdp_neg_get_active_local(negotiator_, &active_local) != PJ_SUCCESS) - _error("SDP: Could not retrieve local active session"); + ERROR("SDP: Could not retrieve local active session"); else setActiveLocalSdpSession(active_local); if (pjmedia_sdp_neg_get_active_remote(negotiator_, &active_remote) != PJ_SUCCESS) - _error("SDP: Could not retrieve remote active session"); + ERROR("SDP: Could not retrieve remote active session"); else setActiveRemoteSdpSession(active_remote); } @@ -369,7 +369,7 @@ void Sdp::removeAttributeFromLocalAudioMedia(const char *attr) void Sdp::setMediaTransportInfoFromRemoteSdp() { if (!activeRemoteSession_) { - _error("Sdp: Error: Remote sdp is NULL while parsing media"); + ERROR("Sdp: Error: Remote sdp is NULL while parsing media"); return; } @@ -380,7 +380,7 @@ void Sdp::setMediaTransportInfoFromRemoteSdp() return; } - _error("SDP: No remote sdp media found in the remote offer"); + ERROR("SDP: No remote sdp media found in the remote offer"); } void Sdp::getRemoteSdpCryptoFromOffer(const pjmedia_sdp_session* remote_sdp, CryptoOffer& crypto_offer) diff --git a/daemon/src/sip/sipaccount.cpp b/daemon/src/sip/sipaccount.cpp index 0f9cfcce665b9efcefc114948dfbf4e7be11f095..f679d8d0aed39b9a8a501791352e35e28e521c79 100644 --- a/daemon/src/sip/sipaccount.cpp +++ b/daemon/src/sip/sipaccount.cpp @@ -219,7 +219,7 @@ void SIPAccount::serialize(Conf::YamlEmitter *emitter) try { emitter->serializeAccount(&accountmap); } catch (const Conf::YamlEmitterException &e) { - _error("ConfigTree: %s", e.what()); + ERROR("ConfigTree: %s", e.what()); } Conf::Sequence *seq = credentialseq.getSequence(); @@ -528,7 +528,7 @@ void SIPAccount::registerVoIPLink() // Init TLS settings if the user wants to use TLS if (tlsEnable_ == "true") { - _debug("SIPAccount: TLS is enabled for account %s", accountID_.c_str()); + DEBUG("SIPAccount: TLS is enabled for account %s", accountID_.c_str()); transportType_ = PJSIP_TRANSPORT_TLS; initTlsConfiguration(); } @@ -549,7 +549,7 @@ void SIPAccount::registerVoIPLink() try { link_->sendRegister(this); } catch (const VoipLinkException &e) { - _error("SIPAccount: %s", e.what()); + ERROR("SIPAccount: %s", e.what()); } } @@ -561,7 +561,7 @@ void SIPAccount::unregisterVoIPLink() try { link_->sendUnregister(this); } catch (const VoipLinkException &e) { - _error("SIPAccount: %s", e.what()); + ERROR("SIPAccount: %s", e.what()); } } diff --git a/daemon/src/sip/sipvoiplink.cpp b/daemon/src/sip/sipvoiplink.cpp index 1cc6855cb34b70fe17ddf28b52e89cf3fabdc5f0..a49283e33509e54bbd29b04f86189bd534bfcf30 100644 --- a/daemon/src/sip/sipvoiplink.cpp +++ b/daemon/src/sip/sipvoiplink.cpp @@ -228,7 +228,7 @@ SIPVoIPLink::SIPVoIPLink() : evThread_(new EventThread(this)) static const pj_str_t accepted = { (char*) "application/sdp", 15 }; pjsip_endpt_add_capability(endpt_, &mod_ua_, PJSIP_H_ACCEPT, NULL, 1, &accepted); - _debug("UserAgent: pjsip version %s for %s initialized", pj_get_version(), PJ_OS_NAME); + DEBUG("UserAgent: pjsip version %s for %s initialized", pj_get_version(), PJ_OS_NAME); TRY(pjsip_replaces_init_module(endpt_)); @@ -567,7 +567,7 @@ SIPVoIPLink::offhold(const std::string& id) call->getAudioRtp().initAudioSymmetricRtpSession(); call->getAudioRtp().start(static_cast<sfl::AudioCodec *>(audiocodec)); } catch (const SdpException &e) { - _error("UserAgent: Exception: %s", e.what()); + ERROR("UserAgent: Exception: %s", e.what()); } catch (...) { throw VoipLinkException("Could not create audio rtp session"); } @@ -908,7 +908,7 @@ bool SIPVoIPLink::SIPNewIpToIpCall(const std::string& id, const std::string& to) std::string remoteAddr = toUri.substr(at+1, trns-at-1); if (toUri.find("sips:") != 1) { - _debug("UserAgent: Error \"sips\" scheme required for TLS call"); + DEBUG("UserAgent: Error \"sips\" scheme required for TLS call"); delete call; return false; } @@ -965,7 +965,7 @@ pj_status_t SIPVoIPLink::stunServerResolve(SIPAccount *account) if (status != PJ_SUCCESS) { char errmsg[PJ_ERR_MSG_SIZE]; pj_strerror(status, errmsg, sizeof(errmsg)); - _debug("Error creating STUN socket for %.*s: %s", (int) stunServer.slen, stunServer.ptr, errmsg); + DEBUG("Error creating STUN socket for %.*s: %s", (int) stunServer.slen, stunServer.ptr, errmsg); return status; } @@ -974,7 +974,7 @@ pj_status_t SIPVoIPLink::stunServerResolve(SIPAccount *account) if (status != PJ_SUCCESS) { char errmsg[PJ_ERR_MSG_SIZE]; pj_strerror(status, errmsg, sizeof(errmsg)); - _debug("Error starting STUN socket for %.*s: %s", (int) stunServer.slen, stunServer.ptr, errmsg); + DEBUG("Error starting STUN socket for %.*s: %s", (int) stunServer.slen, stunServer.ptr, errmsg); pj_stun_sock_destroy(stun_sock); } @@ -1116,7 +1116,7 @@ void SIPVoIPLink::createStunTransport(SIPAccount *account) pj_uint16_t stunPort = account->getStunPort(); if (stunServerResolve(account) != PJ_SUCCESS) { - _error("Can't resolve STUN server"); + ERROR("Can't resolve STUN server"); return; } @@ -1125,12 +1125,12 @@ void SIPVoIPLink::createStunTransport(SIPAccount *account) pj_sockaddr_in boundAddr; if (pj_sockaddr_in_init(&boundAddr, &stunServer, 0) != PJ_SUCCESS) { - _error("Can't initialize IPv4 socket on %*s:%i", stunServer.slen, stunServer.ptr, stunPort); + ERROR("Can't initialize IPv4 socket on %*s:%i", stunServer.slen, stunServer.ptr, stunPort); return; } if (pj_sock_socket(pj_AF_INET(), pj_SOCK_DGRAM(), 0, &sock) != PJ_SUCCESS) { - _error("Can't create or bind socket"); + ERROR("Can't create or bind socket"); return; } @@ -1138,7 +1138,7 @@ void SIPVoIPLink::createStunTransport(SIPAccount *account) pj_sockaddr_in pub_addr; if (pjstun_get_mapped_addr(&cp_->factory, 1, &sock, &stunServer, stunPort, &stunServer, stunPort, &pub_addr) != PJ_SUCCESS) { - _error("Can't contact STUN server"); + ERROR("Can't contact STUN server"); pj_sock_close(sock); return; } @@ -1380,19 +1380,19 @@ void sdp_media_update_cb(pjsip_inv_session *inv, pj_status_t status) SIPCall *call = reinterpret_cast<SIPCall *>(inv->mod_data[mod_ua_.id]); if (call == NULL) { - _debug("UserAgent: Call declined by peer, SDP negotiation stopped"); + DEBUG("UserAgent: Call declined by peer, SDP negotiation stopped"); return; } if (status != PJ_SUCCESS) { - _warn("UserAgent: Error: while negotiating the offer"); + WARN("UserAgent: Error: while negotiating the offer"); SIPVoIPLink::instance()->hangup(call->getCallId()); Manager::instance().callFailure(call->getCallId()); return; } if (!inv->neg) { - _warn("UserAgent: Error: no negotiator for this session"); + WARN("UserAgent: Error: no negotiator for this session"); return; } @@ -1407,11 +1407,11 @@ void sdp_media_update_cb(pjsip_inv_session *inv, pj_status_t status) char buffer[1000]; memset(buffer, 0, sizeof buffer); pjmedia_sdp_print(remote_sdp, buffer, 1000); - _debug("SDP: Remote active SDP Session:\n%s", buffer); + DEBUG("SDP: Remote active SDP Session:\n%s", buffer); memset(buffer, 0, 1000); pjmedia_sdp_print(local_sdp, buffer, 1000); - _debug("SDP: Local active SDP Session:\n%s", buffer); + DEBUG("SDP: Local active SDP Session:\n%s", buffer); // Set active SDP sessions sdpSession->setActiveRemoteSdpSession(remote_sdp); @@ -1438,7 +1438,7 @@ void sdp_media_update_cb(pjsip_inv_session *inv, pj_status_t status) sfl::SdesNegotiator sdesnego(localCapabilities, crypto_offer); if (sdesnego.negotiate()) { - _debug("UserAgent: SDES negotiation successfull"); + DEBUG("UserAgent: SDES negotiation successfull"); nego_success = true; try { @@ -1483,9 +1483,9 @@ void sdp_media_update_cb(pjsip_inv_session *inv, pj_status_t status) call->getAudioRtp().updateSessionMedia(static_cast<sfl::AudioCodec *>(audiocodec)); } } catch (const SdpException &e) { - _error("UserAgent: Exception: %s", e.what()); + ERROR("UserAgent: Exception: %s", e.what()); } catch (const std::exception& rtpException) { - _error("UserAgent: Exception: %s", rtpException.what()); + ERROR("UserAgent: Exception: %s", rtpException.what()); } } @@ -1514,7 +1514,7 @@ void transaction_state_changed_cb(pjsip_inv_session *inv UNUSED, pjsip_transacti if (r_data && r_data->msg_info.msg->line.req.method.id == PJSIP_OTHER_METHOD) { std::string request = pjsip_rx_data_get_info(r_data); - _debug("UserAgent: %s", request.c_str()); + DEBUG("UserAgent: %s", request.c_str()); if (request.find("NOTIFY") == std::string::npos && request.find("INFO") != std::string::npos) { pjsip_dlg_create_response(inv->dlg, r_data, PJSIP_SC_OK, NULL, &t_data); @@ -1569,7 +1569,7 @@ void transaction_state_changed_cb(pjsip_inv_session *inv UNUSED, pjsip_transacti Manager::instance().incomingMessage(call->getCallId(), from, module->findTextMessage(formatedMessage)); } catch (const sfl::InstantMessageException &except) { - _error("SipVoipLink: %s", except.what()); + ERROR("SipVoipLink: %s", except.what()); } } @@ -1820,7 +1820,7 @@ static pj_bool_t transaction_request_cb(pjsip_rx_data *rdata) pjsip_tx_data *response; if (pjsip_replaces_verify_request(rdata, &replaced_dlg, PJ_FALSE, &response) != PJ_SUCCESS) { - _error("Something wrong with Replaces request."); + ERROR("Something wrong with Replaces request."); pjsip_endpt_respond_stateless(endpt_, rdata, 500 /* internal server error */, NULL, NULL, NULL); } @@ -2028,7 +2028,7 @@ std::string SIPVoIPLink::getInterfaceAddrFromName(const std::string &ifaceName) int fd = socket(AF_INET, SOCK_DGRAM,0); if (fd < 0) { - _error("UserAgent: Error: could not open socket: %m"); + ERROR("UserAgent: Error: could not open socket: %m"); return ""; } diff --git a/daemon/src/voiplink.cpp b/daemon/src/voiplink.cpp index 696de5396324c6ed03d51675e6f30f9e24506cc9..335d5871d5e273dbdb504fbfc28a0da2bb12342c 100644 --- a/daemon/src/voiplink.cpp +++ b/daemon/src/voiplink.cpp @@ -58,7 +58,7 @@ void VoIPLink::removeCall(const std::string& id) { ost::MutexLock m(callMapMutex_); - _debug("VoipLink: removing call %s from list", id.c_str()); + DEBUG("VoipLink: removing call %s from list", id.c_str()); delete callMap_[id]; callMap_.erase(id); diff --git a/daemon/test/Makefile.am b/daemon/test/Makefile.am index c9fdba31d6b031192cf35e66d45242a6e47a781e..5a23e32309ebf043588c37a442e92332f9a9d93b 100644 --- a/daemon/test/Makefile.am +++ b/daemon/test/Makefile.am @@ -6,7 +6,7 @@ check_PROGRAMS = test TESTS = run_tests.sh test_CXXFLAGS = -I . -test_LDADD = $(top_builddir)/src/libsflphone.la @LIBCRYPTO_LIBS@ @CPPUNIT_LIBS@ +test_LDADD = $(top_builddir)/src/libsflphone.la @ZRTPCPP_LIBS@ @LIBCRYPTO_LIBS@ @CPPUNIT_LIBS@ EXTRA_DIST = $(test_SOURCES) sflphoned-sample.yml history-sample.tpl run_tests.sh test_SOURCES = \ diff --git a/daemon/test/accounttest.cpp b/daemon/test/accounttest.cpp index 57f359a67dd8a10b816e29ce506c6db23433a9a1..3df3153c230e7662d4d8fb61f853dab2eea4912d 100644 --- a/daemon/test/accounttest.cpp +++ b/daemon/test/accounttest.cpp @@ -38,7 +38,7 @@ void AccountTest::TestAddRemove(void) { - _debug("-------------------- AccountTest::TestAddRemove --------------------\n"); + DEBUG("-------------------- AccountTest::TestAddRemove --------------------\n"); std::map<std::string, std::string> details; details[CONFIG_ACCOUNT_TYPE] = "SIP"; diff --git a/daemon/test/audiolayertest.cpp b/daemon/test/audiolayertest.cpp index e6c45b1d6faa869c76eccd6d41bf0a4b1399ca0e..d9581653bf525f66b99ae2c99bbc6599092d4e01 100644 --- a/daemon/test/audiolayertest.cpp +++ b/daemon/test/audiolayertest.cpp @@ -41,7 +41,7 @@ using std::endl; void AudioLayerTest::testAudioLayerConfig() { - _debug("-------------------- AudioLayerTest::testAudioLayerConfig --------------------\n"); + DEBUG("-------------------- AudioLayerTest::testAudioLayerConfig --------------------\n"); CPPUNIT_ASSERT(Manager::instance().audioPreference.getSmplrate() == 44100); @@ -65,12 +65,12 @@ void AudioLayerTest::testAudioLayerConfig() void AudioLayerTest::testAudioLayerSwitch() { - _debug("-------------------- AudioLayerTest::testAudioLayerSwitch --------------------\n"); + DEBUG("-------------------- AudioLayerTest::testAudioLayerSwitch --------------------\n"); bool wasAlsa = dynamic_cast<AlsaLayer*>(Manager::instance().getAudioDriver()) != 0; for (int i = 0; i < 2; i++) { - _debug("iter - %i", i); + DEBUG("iter - %i", i); Manager::instance().switchAudioManager(); if (wasAlsa) @@ -85,14 +85,14 @@ void AudioLayerTest::testAudioLayerSwitch() void AudioLayerTest::testPulseConnect() { - _debug("-------------------- AudioLayerTest::testPulseConnect --------------------\n"); + DEBUG("-------------------- AudioLayerTest::testPulseConnect --------------------\n"); if (dynamic_cast<AlsaLayer*>(Manager::instance().getAudioDriver())) { Manager::instance().switchAudioManager(); usleep(100000); } - _pulselayer = dynamic_cast<PulseLayer*>(Manager::instance().getAudioDriver()); + pulselayer_ = dynamic_cast<PulseLayer*>(Manager::instance().getAudioDriver()); - CPPUNIT_ASSERT(_pulselayer); + CPPUNIT_ASSERT(pulselayer_); } diff --git a/daemon/test/audiolayertest.h b/daemon/test/audiolayertest.h index 9a539b6b0e060c2f0b4887049892298ee154ff16..6515933b7c9b27221f815c79d88be022afdaeace 100644 --- a/daemon/test/audiolayertest.h +++ b/daemon/test/audiolayertest.h @@ -70,11 +70,11 @@ class AudioLayerTest: public CppUnit::TestFixture { private: - ManagerImpl* manager; + ManagerImpl* manager_; - PulseLayer* _pulselayer; + PulseLayer* pulselayer_; - int layer; + int layer_; }; CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(AudioLayerTest, "AudioLayerTest"); CPPUNIT_TEST_SUITE_REGISTRATION(AudioLayerTest); diff --git a/daemon/test/configurationtest.cpp b/daemon/test/configurationtest.cpp index 4d5f8916be5be7fb9ae83540662b63632d261414..cce25d5d5c056e85f283dcb08ffa8fb7fbcef1d9 100644 --- a/daemon/test/configurationtest.cpp +++ b/daemon/test/configurationtest.cpp @@ -41,7 +41,7 @@ using std::endl; void ConfigurationTest::testDefaultValueAudio() { - _debug("-------------------- ConfigurationTest::testDefaultValueAudio() --------------------\n"); + DEBUG("-------------------- ConfigurationTest::testDefaultValueAudio() --------------------\n"); CPPUNIT_ASSERT(Manager::instance().audioPreference.getCardin() == 0); // ALSA_DFT_CARD); CPPUNIT_ASSERT(Manager::instance().audioPreference.getCardout() == 0); // ALSA_DFT_CARD); @@ -53,14 +53,14 @@ void ConfigurationTest::testDefaultValueAudio() void ConfigurationTest::testDefaultValuePreferences() { - _debug("-------------------- ConfigurationTest::testDefaultValuePreferences --------------------\n"); + DEBUG("-------------------- ConfigurationTest::testDefaultValuePreferences --------------------\n"); CPPUNIT_ASSERT(Manager::instance().preferences.getZoneToneChoice() == Preferences::DFT_ZONE); } void ConfigurationTest::testDefaultValueSignalisation() { - _debug("-------------------- ConfigurationTest::testDefaultValueSignalisation --------------------\n"); + DEBUG("-------------------- ConfigurationTest::testDefaultValueSignalisation --------------------\n"); CPPUNIT_ASSERT(Manager::instance().voipPreferences.getSymmetricRtp() == true); CPPUNIT_ASSERT(Manager::instance().voipPreferences.getPlayDtmf() == true); @@ -70,7 +70,7 @@ void ConfigurationTest::testDefaultValueSignalisation() void ConfigurationTest::testInitAudioDriver() { - _debug("-------------------- ConfigurationTest::testInitAudioDriver --------------------\n"); + DEBUG("-------------------- ConfigurationTest::testInitAudioDriver --------------------\n"); // Load the audio driver Manager::instance().initAudioDriver(); @@ -100,7 +100,7 @@ void ConfigurationTest::testYamlParser() delete parser; } catch (Conf::YamlParserException &e) { - _error("ConfigTree: %s", e.what()); + ERROR("ConfigTree: %s", e.what()); } } @@ -231,6 +231,6 @@ void ConfigurationTest::testYamlEmitter() delete emitter; } catch (Conf::YamlEmitterException &e) { - _error("ConfigTree: %s", e.what()); + ERROR("ConfigTree: %s", e.what()); } } diff --git a/daemon/test/delaydetectiontest.cpp b/daemon/test/delaydetectiontest.cpp index 466f5676e405ed06d5fb3b9d65895efab936a5d8..a140d208d52531599c62fd8b836d25072c92692d 100644 --- a/daemon/test/delaydetectiontest.cpp +++ b/daemon/test/delaydetectiontest.cpp @@ -47,15 +47,15 @@ void DelayDetectionTest::testCrossCorrelation() float result[10]; float expected[10] = {0.0, 0.89442719, 1.0, 0.95618289, 0.91350028, 0.88543774, 0.86640023, 0.85280287, 0.8426548, 0.83480969}; - CPPUNIT_ASSERT(_delaydetect.correlate(ref, ref, 3) == 5.0); - CPPUNIT_ASSERT(_delaydetect.correlate(signal, signal, 10) == 285.0); + CPPUNIT_ASSERT(delaydetect_.correlate(ref, ref, 3) == 5.0); + CPPUNIT_ASSERT(delaydetect_.correlate(signal, signal, 10) == 285.0); - _delaydetect.crossCorrelate(ref, signal, result, 3, 10); + delaydetect_.crossCorrelate(ref, signal, result, 3, 10); float tmp; for (int i = 0; i < 10; i++) { - tmp = result[i]-expected[i]; + tmp = result[i] - expected[i]; if (tmp < 0.0) CPPUNIT_ASSERT(tmp > -0.001); @@ -71,7 +71,7 @@ void DelayDetectionTest::testCrossCorrelationDelay() float result[10]; - _delaydetect.crossCorrelate(ref, signal, result, 3, 10); + delaydetect_.crossCorrelate(ref, signal, result, 3, 10); float expected[10] = {0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}; @@ -104,15 +104,15 @@ void DelayDetectionTest::testFirFilter() memset(impulse, 0, sizeof(float) *100); impulse[0] = 1.0; - FirFilter _decimationFilter(ird); - FirFilter _bandpassFilter(irb); + FirFilter decimationFilter_(ird); + FirFilter bandpassFilter_(irb); float impulseresponse[100]; memset(impulseresponse, 0, sizeof(float) *100); // compute impulse response for (int i = 0; i < 100; i++) { - impulseresponse[i] = _decimationFilter.getOutputSample(impulse[i]); + impulseresponse[i] = decimationFilter_.getOutputSample(impulse[i]); } float tmp; @@ -129,7 +129,7 @@ void DelayDetectionTest::testFirFilter() for (int i = 0; i < 100; i++) { - impulseresponse[i] = _bandpassFilter.getOutputSample(impulse[i]); + impulseresponse[i] = bandpassFilter_.getOutputSample(impulse[i]); } size = sizeof(bandpassCoefs) /sizeof(float); @@ -154,7 +154,7 @@ void DelayDetectionTest::testIntToFloatConversion() for (int i = -32768; i < 32768; i++) data[i+32768] = i; - _delaydetect.convertInt16ToFloat32(data, converted, 32768*2); + delaydetect_.convertInt16ToFloat32(data, converted, 32768*2); for (int i = -32768; i < 0; i++) { CPPUNIT_ASSERT(converted[i+32768] >= -1.0); @@ -177,9 +177,9 @@ void DelayDetectionTest::testDownSamplingData() for (int i = -32768; i < 32768; i++) data[i+32768] = i; - _delaydetect.convertInt16ToFloat32(data, converted, 32768*2); + delaydetect_.convertInt16ToFloat32(data, converted, 32768*2); - _delaydetect.downsampleData(converted, resampled, 32768*2, 8); + delaydetect_.downsampleData(converted, resampled, 32768*2, 8); for (int i = 0; i < 32768/8; i++) { CPPUNIT_ASSERT(resampled[i] >= -1.0); @@ -216,7 +216,6 @@ void DelayDetectionTest::testDelayDetection() mic[delay+3] = 32000; mic[delay+4] = 32000; - _delaydetect.putData(spkr, WINDOW_SIZE); - _delaydetect.process(mic, DELAY_BUFF_SIZE); - + delaydetect_.putData(spkr, WINDOW_SIZE); + delaydetect_.process(mic, DELAY_BUFF_SIZE); } diff --git a/daemon/test/delaydetectiontest.h b/daemon/test/delaydetectiontest.h index 9350f70150ce70293170fc914970cb6853e4ec5c..11d4eef7d5a3afc917ebdbc7217a969fb7e0b2ba 100644 --- a/daemon/test/delaydetectiontest.h +++ b/daemon/test/delaydetectiontest.h @@ -101,7 +101,7 @@ class DelayDetectionTest : public CppUnit::TestCase { private: - DelayDetection _delaydetect; + DelayDetection delaydetect_; }; diff --git a/daemon/test/echocanceltest.cpp b/daemon/test/echocanceltest.cpp index c656854289d5328c8922dba5ecf6a3da52efea2b..6102b9591d0ab4b4606a346315e33b432e055c96 100644 --- a/daemon/test/echocanceltest.cpp +++ b/daemon/test/echocanceltest.cpp @@ -37,8 +37,6 @@ using namespace std; void EchoCancelTest::testEchoCancelProcessing() { -// _debug ("-------------------- EchoCancelTest::testEchoCancelTest --------------------\n"); - const int nbSamples = 160; int inputFileLength = 0; int remainingLength = 0; diff --git a/daemon/test/historytest.cpp b/daemon/test/historytest.cpp index 529237360ef6117d73c7b4f574a47b9724fc2f81..216fe0f10db7479f94aa9b752b55b213b3122d65 100644 --- a/daemon/test/historytest.cpp +++ b/daemon/test/historytest.cpp @@ -50,7 +50,7 @@ void HistoryTest::setUp() void HistoryTest::test_create_history_path() { - _debug("-------------------- HistoryTest::test_create_history_path --------------------\n"); + DEBUG("-------------------- HistoryTest::test_create_history_path --------------------\n"); int result; std::string path(HISTORY_SAMPLE); @@ -63,7 +63,7 @@ void HistoryTest::test_create_history_path() void HistoryTest::test_load_history_from_file() { - _debug("-------------------- HistoryTest::test_load_history_from_file --------------------\n"); + DEBUG("-------------------- HistoryTest::test_load_history_from_file --------------------\n"); bool res; Conf::ConfigTree history_list; @@ -77,7 +77,7 @@ void HistoryTest::test_load_history_from_file() void HistoryTest::test_load_history_items_map() { - _debug("-------------------- HistoryTest::test_load_history_items_map --------------------\n"); + DEBUG("-------------------- HistoryTest::test_load_history_items_map --------------------\n"); std::string path; int nb_items; @@ -93,7 +93,7 @@ void HistoryTest::test_load_history_items_map() void HistoryTest::test_save_history_items_map() { - _debug("-------------------- HistoryTest::test_save_history_items_map --------------------\n"); + DEBUG("-------------------- HistoryTest::test_save_history_items_map --------------------\n"); std::string path; int nb_items_loaded, nb_items_saved; @@ -109,7 +109,7 @@ void HistoryTest::test_save_history_items_map() void HistoryTest::test_save_history_to_file() { - _debug("-------------------- HistoryTest::test_save_history_to_file --------------------\n"); + DEBUG("-------------------- HistoryTest::test_save_history_to_file --------------------\n"); std::string path; Conf::ConfigTree history_list, history_list2; @@ -125,7 +125,7 @@ void HistoryTest::test_save_history_to_file() void HistoryTest::test_get_history_serialized() { - _debug("-------------------- HistoryTest::test_get_history_serialized --------------------\n"); + DEBUG("-------------------- HistoryTest::test_get_history_serialized --------------------\n"); std::vector<std::string> res; std::vector<std::string>::iterator iter; @@ -153,7 +153,7 @@ void HistoryTest::test_get_history_serialized() void HistoryTest::test_set_serialized_history() { - _debug("-------------------- HistoryTest::test_set_serialized_history --------------------\n"); + DEBUG("-------------------- HistoryTest::test_set_serialized_history --------------------\n"); // We build a map to have an efficient test std::vector<std::string> test_vector; @@ -188,7 +188,7 @@ void HistoryTest::test_set_serialized_history() void HistoryTest::test_set_serialized_history_with_limit() { - _debug("-------------------- HistoryTest::test_set_serialized_history_with_limit --------------------\n"); + DEBUG("-------------------- HistoryTest::test_set_serialized_history_with_limit --------------------\n"); // We build a map to have an efficient test std::vector<std::string> test_vector; diff --git a/daemon/test/instantmessagingtest.cpp b/daemon/test/instantmessagingtest.cpp index 1d0cf751b81467cdd24e5fc4a28d53bee0bad1a5..89f0041a3f465f168c1d798a37c14d1fa448bc81 100644 --- a/daemon/test/instantmessagingtest.cpp +++ b/daemon/test/instantmessagingtest.cpp @@ -46,19 +46,19 @@ using std::endl; void InstantMessagingTest::setUp() { - _im = new sfl::InstantMessaging(); + im_ = new sfl::InstantMessaging(); } void InstantMessagingTest::testSaveSingleMessage() { - _debug("-------------------- InstantMessagingTest::testSaveSingleMessage --------------------\n"); + DEBUG("-------------------- InstantMessagingTest::testSaveSingleMessage --------------------\n"); std::string input, tmp; std::string callID = "testfile1.txt"; std::string filename = "im:"; // Open a file stream and try to write in it - CPPUNIT_ASSERT(_im->saveMessage("Bonjour, c'est un test d'archivage de message", "Manu", callID, std::ios::out) == true); + CPPUNIT_ASSERT(im_->saveMessage("Bonjour, c'est un test d'archivage de message", "Manu", callID, std::ios::out) == true); filename.append(callID); // Read it to check it has been successfully written @@ -76,15 +76,15 @@ void InstantMessagingTest::testSaveSingleMessage() void InstantMessagingTest::testSaveMultipleMessage() { - _debug("-------------------- InstantMessagingTest::testSaveMultipleMessage --------------------\n"); + DEBUG("-------------------- InstantMessagingTest::testSaveMultipleMessage --------------------\n"); std::string input, tmp; std::string callID = "testfile2.txt"; std::string filename = "im:"; // Open a file stream and try to write in it - CPPUNIT_ASSERT(_im->saveMessage("Bonjour, c'est un test d'archivage de message", "Manu", callID, std::ios::out) == true); - CPPUNIT_ASSERT(_im->saveMessage("Cool", "Alex", callID, std::ios::out || std::ios::app) == true); + CPPUNIT_ASSERT(im_->saveMessage("Bonjour, c'est un test d'archivage de message", "Manu", callID, std::ios::out) == true); + CPPUNIT_ASSERT(im_->saveMessage("Cool", "Alex", callID, std::ios::out || std::ios::app) == true); filename.append(callID); // Read it to check it has been successfully written @@ -165,7 +165,7 @@ void InstantMessagingTest::testGenerateXmlUriList() list.push_front(entry1); list.push_front(entry2); - std::string buffer = _im->generateXmlUriList(list); + std::string buffer = im_->generateXmlUriList(list); CPPUNIT_ASSERT(buffer.size() != 0); std::cout << buffer << std::endl; @@ -200,7 +200,7 @@ void InstantMessagingTest::testXmlUriListParsing() xmlbuffer.append("</resource-lists>"); - sfl::InstantMessaging::UriList list = _im->parseXmlUriList(xmlbuffer); + sfl::InstantMessaging::UriList list = im_->parseXmlUriList(xmlbuffer); CPPUNIT_ASSERT(list.size() == 2); // An iterator over xml attribute @@ -241,7 +241,7 @@ void InstantMessagingTest::testGetTextArea() formatedText.append("</resource-lists>"); formatedText.append("--boundary--"); - std::string message = _im->findTextMessage(formatedText); + std::string message = im_->findTextMessage(formatedText); std::cout << "message " << message << std::endl; @@ -265,13 +265,13 @@ void InstantMessagingTest::testGetUriListArea() formatedText.append("</resource-lists>"); formatedText.append("--boundary--"); - std::string urilist = _im->findTextUriList(formatedText); + std::string urilist = im_->findTextUriList(formatedText); CPPUNIT_ASSERT(urilist.compare("<?xml version=\"1.0\" encoding=\"UTF-8\"?><resource-lists xmlns=\"urn:ietf:params:xml:ns:resource-lists\" xmlns:cp=\"urn:ietf:params:xml:ns:copycontrol\"><list><entry uri=\"sip:alex@example.com\" cp:copyControl=\"to\" /><entry uri=\"sip:manu@example.com\" cp:copyControl=\"to\" /></list></resource-lists>") == 0); std::cout << "urilist: " << urilist << std::endl; - sfl::InstantMessaging::UriList list = _im->parseXmlUriList(urilist); + sfl::InstantMessaging::UriList list = im_->parseXmlUriList(urilist); CPPUNIT_ASSERT(list.size() == 2); // order may be important, for example to identify message sender @@ -310,7 +310,7 @@ void InstantMessagingTest::testIllFormatedMessage() formatedText.append("--boundary--"); try { - std::string message = _im->findTextMessage(formatedText); + std::string message = im_->findTextMessage(formatedText); } catch (sfl::InstantMessageException &e) { exceptionCaught = true; } @@ -325,6 +325,6 @@ void InstantMessagingTest::testIllFormatedMessage() void InstantMessagingTest::tearDown() { - delete _im; - _im = 0; + delete im_; + im_ = 0; } diff --git a/daemon/test/instantmessagingtest.h b/daemon/test/instantmessagingtest.h index 9a3cad585f607cc1390487c2ba6192082a607b3d..f653fc39ca1c1ec53469e825868cf17bf443e919 100644 --- a/daemon/test/instantmessagingtest.h +++ b/daemon/test/instantmessagingtest.h @@ -92,7 +92,7 @@ class InstantMessagingTest : public CppUnit::TestCase { void testIllFormatedMessage(); private: - sfl::InstantMessaging *_im; + sfl::InstantMessaging *im_; }; /* Register our test module */ diff --git a/daemon/test/main.cpp b/daemon/test/main.cpp index 77e16a585551c071eabfda1b48e944062f89e945..ca16605642b7778596d07865eace991a0030c90f 100644 --- a/daemon/test/main.cpp +++ b/daemon/test/main.cpp @@ -71,13 +71,13 @@ int main(int argc, char* argv[]) argvIndex++; Logger::setDebugMode(true); - _info("Debug mode activated"); + INFO("Debug mode activated"); } else if (strcmp("--xml", argv[1]) == 0) { argvIndex++; xmlOutput = true; - _info("Using XML output"); + INFO("Using XML output"); } } @@ -98,7 +98,7 @@ int main(int argc, char* argv[]) CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry(testSuiteName).makeTest(); if (suite->getChildTestCount() == 0) { - _error("Invalid test suite name: %s", testSuiteName.c_str()); + ERROR("Invalid test suite name: %s", testSuiteName.c_str()); system("mv " CONFIG_SAMPLE ".bak " CONFIG_SAMPLE); return 1; } diff --git a/daemon/test/mainbuffertest.cpp b/daemon/test/mainbuffertest.cpp index f98cf2507c217efd920407e0503be249bba59cc8..94085b0c9ca68a83392e233d28fcae534006798a 100644 --- a/daemon/test/mainbuffertest.cpp +++ b/daemon/test/mainbuffertest.cpp @@ -64,7 +64,7 @@ void MainBufferTest::tearDown() void MainBufferTest::testRingBufferCreation() { - _debug("-------------------- MainBufferTest::testRingBufferCreation --------------------\n"); + DEBUG("-------------------- MainBufferTest::testRingBufferCreation --------------------\n"); std::string test_id = "1234"; std::string null_id = "null id"; @@ -73,45 +73,45 @@ void MainBufferTest::testRingBufferCreation() RingBufferMap::iterator iter; // test mainbuffer ringbuffer map size - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 0); - test_ring_buffer = _mainbuffer.createRingBuffer(test_id); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 1); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 0); + test_ring_buffer = mainbuffer_.createRingBuffer(test_id); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 1); - // test _mainbuffer.getRingBuffer method + // test mainbuffer_.getRingBuffer method CPPUNIT_ASSERT(test_ring_buffer != NULL); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(null_id) == NULL); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 1); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(test_id) == test_ring_buffer); - - // test _mainbuffer _ringBufferMap - iter = _mainbuffer._ringBufferMap.find(null_id); - CPPUNIT_ASSERT(iter == _mainbuffer._ringBufferMap.end()); - iter = _mainbuffer._ringBufferMap.find(test_id); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(null_id) == NULL); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 1); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(test_id) == test_ring_buffer); + + // test mainbuffer_ ringBufferMap_ + iter = mainbuffer_.ringBufferMap_.find(null_id); + CPPUNIT_ASSERT(iter == mainbuffer_.ringBufferMap_.end()); + iter = mainbuffer_.ringBufferMap_.find(test_id); CPPUNIT_ASSERT(iter->first == test_id); CPPUNIT_ASSERT(iter->second == test_ring_buffer); - CPPUNIT_ASSERT(iter->second == _mainbuffer.getRingBuffer(test_id)); + CPPUNIT_ASSERT(iter->second == mainbuffer_.getRingBuffer(test_id)); // test creating twice a buffer (should not create it) - _mainbuffer.createRingBuffer(test_id); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 1); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(test_id) == test_ring_buffer); + mainbuffer_.createRingBuffer(test_id); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 1); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(test_id) == test_ring_buffer); // test remove ring buffer - CPPUNIT_ASSERT(_mainbuffer.removeRingBuffer(null_id) == true); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 1); - CPPUNIT_ASSERT(_mainbuffer.removeRingBuffer(test_id) == true); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 0); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(test_id) == NULL); + CPPUNIT_ASSERT(mainbuffer_.removeRingBuffer(null_id) == true); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 1); + CPPUNIT_ASSERT(mainbuffer_.removeRingBuffer(test_id) == true); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 0); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(test_id) == NULL); - iter = _mainbuffer._ringBufferMap.find(test_id); - CPPUNIT_ASSERT(iter == _mainbuffer._ringBufferMap.end()); + iter = mainbuffer_.ringBufferMap_.find(test_id); + CPPUNIT_ASSERT(iter == mainbuffer_.ringBufferMap_.end()); } void MainBufferTest::testRingBufferReadPointer() { - _debug("-------------------- MainBufferTest::testRingBufferReadPointer --------------------\n"); + DEBUG("-------------------- MainBufferTest::testRingBufferReadPointer --------------------\n"); std::string call_id = "call id"; std::string read_id = "read id"; @@ -121,7 +121,7 @@ void MainBufferTest::testRingBufferReadPointer() RingBuffer* test_ring_buffer; // test ring buffer read pointers (one per participant) - test_ring_buffer = _mainbuffer.createRingBuffer(call_id); + test_ring_buffer = mainbuffer_.createRingBuffer(call_id); CPPUNIT_ASSERT(test_ring_buffer->getNbReadPointer() == 0); CPPUNIT_ASSERT(test_ring_buffer->getReadPointer(read_id) == (int) NULL); @@ -158,7 +158,7 @@ void MainBufferTest::testRingBufferReadPointer() void MainBufferTest::testCallIDSet() { - _debug("-------------------- MainBufferTest::testCallIDSet --------------------\n"); + DEBUG("-------------------- MainBufferTest::testCallIDSet --------------------\n"); std::string test_id = "set id"; std::string false_id = "false set id"; @@ -171,46 +171,46 @@ void MainBufferTest::testCallIDSet() std::string call_id_2 = "call id 2"; // test initial settings - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 0); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 0); - iter_map = _mainbuffer._callIDMap.find(test_id); - CPPUNIT_ASSERT(iter_map ==_mainbuffer._callIDMap.end()); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 0); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 0); + iter_map = mainbuffer_.callIDMap_.find(test_id); + CPPUNIT_ASSERT(iter_map ==mainbuffer_.callIDMap_.end()); // test callidset creation - _mainbuffer.createCallIDSet(test_id); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 1); - iter_map = _mainbuffer._callIDMap.find(test_id); + mainbuffer_.createCallIDSet(test_id); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 1); + iter_map = mainbuffer_.callIDMap_.find(test_id); CPPUNIT_ASSERT(iter_map->first == test_id); - CPPUNIT_ASSERT(iter_map->second == _mainbuffer.getCallIDSet(test_id)); + CPPUNIT_ASSERT(iter_map->second == mainbuffer_.getCallIDSet(test_id)); - CPPUNIT_ASSERT(_mainbuffer.getCallIDSet(false_id) == NULL); - CPPUNIT_ASSERT(_mainbuffer.getCallIDSet(test_id) != NULL); + CPPUNIT_ASSERT(mainbuffer_.getCallIDSet(false_id) == NULL); + CPPUNIT_ASSERT(mainbuffer_.getCallIDSet(test_id) != NULL); // Test callIDSet add call_ids - _mainbuffer.addCallIDtoSet(test_id, call_id_1); - iter_map = _mainbuffer._callIDMap.find(test_id); + mainbuffer_.addCallIDtoSet(test_id, call_id_1); + iter_map = mainbuffer_.callIDMap_.find(test_id); CPPUNIT_ASSERT(iter_map->second->size() == 1); iter_set = iter_map->second->find(call_id_1); CPPUNIT_ASSERT(*iter_set == call_id_1); // test add second call id to set - _mainbuffer.addCallIDtoSet(test_id, call_id_2); - iter_map = _mainbuffer._callIDMap.find(test_id); + mainbuffer_.addCallIDtoSet(test_id, call_id_2); + iter_map = mainbuffer_.callIDMap_.find(test_id); CPPUNIT_ASSERT(iter_map->second->size() == 2); iter_set = iter_map->second->find(call_id_2); CPPUNIT_ASSERT(*iter_set == call_id_2); // test add a call id twice - _mainbuffer.addCallIDtoSet(test_id, call_id_2); - iter_map = _mainbuffer._callIDMap.find(test_id); + mainbuffer_.addCallIDtoSet(test_id, call_id_2); + iter_map = mainbuffer_.callIDMap_.find(test_id); CPPUNIT_ASSERT(iter_map->second->size() == 2); iter_set = iter_map->second->find(call_id_2); CPPUNIT_ASSERT(*iter_set == call_id_2); // test remove a call id - _mainbuffer.removeCallIDfromSet(test_id, call_id_2); - iter_map = _mainbuffer._callIDMap.find(test_id); + mainbuffer_.removeCallIDfromSet(test_id, call_id_2); + iter_map = mainbuffer_.callIDMap_.find(test_id); CPPUNIT_ASSERT(iter_map->second->size() == 1); iter_set = iter_map->second->find(call_id_1); CPPUNIT_ASSERT(*iter_set == call_id_1); @@ -218,8 +218,8 @@ void MainBufferTest::testCallIDSet() CPPUNIT_ASSERT(iter_set == iter_map->second->end()); // test remove a call id twice - _mainbuffer.removeCallIDfromSet(test_id, call_id_2); - iter_map = _mainbuffer._callIDMap.find(test_id); + mainbuffer_.removeCallIDfromSet(test_id, call_id_2); + iter_map = mainbuffer_.callIDMap_.find(test_id); CPPUNIT_ASSERT(iter_map->second->size() == 1); iter_set = iter_map->second->find(call_id_1); CPPUNIT_ASSERT(*iter_set == call_id_1); @@ -227,13 +227,13 @@ void MainBufferTest::testCallIDSet() CPPUNIT_ASSERT(iter_set == iter_map->second->end()); // Test removeCallIDSet - CPPUNIT_ASSERT(_mainbuffer.removeCallIDSet(false_id) == false); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 1); - CPPUNIT_ASSERT(_mainbuffer.removeCallIDSet(test_id) == true); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 0); + CPPUNIT_ASSERT(mainbuffer_.removeCallIDSet(false_id) == false); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 1); + CPPUNIT_ASSERT(mainbuffer_.removeCallIDSet(test_id) == true); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 0); - iter_map = _mainbuffer._callIDMap.find(test_id); - CPPUNIT_ASSERT(iter_map ==_mainbuffer._callIDMap.end()); + iter_map = mainbuffer_.callIDMap_.find(test_id); + CPPUNIT_ASSERT(iter_map ==mainbuffer_.callIDMap_.end()); } @@ -241,7 +241,7 @@ void MainBufferTest::testCallIDSet() void MainBufferTest::testRingBufferInt() { - _debug("-------------------- MainBufferTest::testRingBufferInt --------------------\n"); + DEBUG("-------------------- MainBufferTest::testRingBufferInt --------------------\n"); // CallID test_id = "test_int"; @@ -251,7 +251,7 @@ void MainBufferTest::testRingBufferInt() // test with default ring buffer - RingBuffer* test_ring_buffer = _mainbuffer.createRingBuffer(default_id); + RingBuffer* test_ring_buffer = mainbuffer_.createRingBuffer(default_id); // initial state init_put_size = test_ring_buffer->AvailForPut(); @@ -357,7 +357,7 @@ void MainBufferTest::testRingBufferInt() void MainBufferTest::testRingBufferNonDefaultID() { - _debug("-------------------- MainBufferTest::testRingBufferNonDefaultID --------------------\n"); + DEBUG("-------------------- MainBufferTest::testRingBufferNonDefaultID --------------------\n"); std::string test_id = "test_int"; @@ -367,7 +367,7 @@ void MainBufferTest::testRingBufferNonDefaultID() // test putData, getData with arbitrary read pointer id - RingBuffer* test_ring_buffer = _mainbuffer.createRingBuffer(default_id); + RingBuffer* test_ring_buffer = mainbuffer_.createRingBuffer(default_id); test_ring_buffer->createReadPointer(test_id); init_put_size = test_ring_buffer->AvailForPut(); @@ -444,12 +444,12 @@ void MainBufferTest::testRingBufferNonDefaultID() void MainBufferTest::testRingBufferFloat() { - _debug("-------------------- MainBufferTest::testRingBufferFloat --------------------\n"); + DEBUG("-------------------- MainBufferTest::testRingBufferFloat --------------------\n"); float testfloat1 = 12.5; float testfloat2 = 13.4; - RingBuffer* test_ring_buffer = _mainbuffer.createRingBuffer(default_id); + RingBuffer* test_ring_buffer = mainbuffer_.createRingBuffer(default_id); test_ring_buffer->createReadPointer(default_id); @@ -478,11 +478,11 @@ void MainBufferTest::testRingBufferFloat() void MainBufferTest::testTwoPointer() { - _debug("-------------------- MainBufferTest::testTwoPointer --------------------\n"); + DEBUG("-------------------- MainBufferTest::testTwoPointer --------------------\n"); - RingBuffer* input_buffer = _mainbuffer.createRingBuffer(default_id); + RingBuffer* input_buffer = mainbuffer_.createRingBuffer(default_id); input_buffer->createReadPointer(default_id); - RingBuffer* output_buffer = _mainbuffer.getRingBuffer(default_id); + RingBuffer* output_buffer = mainbuffer_.getRingBuffer(default_id); int test_input = 12; int test_output; @@ -495,7 +495,7 @@ void MainBufferTest::testTwoPointer() void MainBufferTest::testBindUnbindBuffer() { - _debug("-------------------- MainBufferTest::testBindUnbindBuffer --------------------\n"); + DEBUG("-------------------- MainBufferTest::testBindUnbindBuffer --------------------\n"); std::string test_id1 = "bind unbind 1"; std::string test_id2 = "bind unbind 2"; @@ -509,46 +509,46 @@ void MainBufferTest::testBindUnbindBuffer() RingBuffer* ringbuffer; // test initial state with no ring brffer created - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 0); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 0); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 0); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 0); - iter_buffer = _mainbuffer._ringBufferMap.find(default_id); - CPPUNIT_ASSERT(iter_buffer == _mainbuffer._ringBufferMap.end()); - iter_idset = _mainbuffer._callIDMap.find(default_id); - CPPUNIT_ASSERT(iter_idset == _mainbuffer._callIDMap.end()); + iter_buffer = mainbuffer_.ringBufferMap_.find(default_id); + CPPUNIT_ASSERT(iter_buffer == mainbuffer_.ringBufferMap_.end()); + iter_idset = mainbuffer_.callIDMap_.find(default_id); + CPPUNIT_ASSERT(iter_idset == mainbuffer_.callIDMap_.end()); // bind test_id1 with default_id (both buffer not already created) - _mainbuffer.bindCallID(test_id1); + mainbuffer_.bindCallID(test_id1); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 2); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 2); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 2); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 2); - iter_buffer = _mainbuffer._ringBufferMap.find(default_id); + iter_buffer = mainbuffer_.ringBufferMap_.find(default_id); CPPUNIT_ASSERT(iter_buffer->first == default_id); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(default_id)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(default_id)); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id1); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id1); CPPUNIT_ASSERT(iter_buffer->first == test_id1); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(test_id1)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(test_id1)); - iter_idset = _mainbuffer._callIDMap.find(default_id); + iter_idset = mainbuffer_.callIDMap_.find(default_id); CPPUNIT_ASSERT(iter_idset->second->size() == 1); iter_id = iter_idset->second->find(test_id1); CPPUNIT_ASSERT(*iter_id == test_id1); - iter_idset = _mainbuffer._callIDMap.find(test_id1); + iter_idset = mainbuffer_.callIDMap_.find(test_id1); CPPUNIT_ASSERT(iter_idset->second->size() == 1); iter_id = iter_idset->second->find(default_id); CPPUNIT_ASSERT(*iter_id == default_id); - ringbuffer = _mainbuffer.getRingBuffer(default_id); + ringbuffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 1); iter_readpointer = ringbuffer->_readpointer.find(test_id1); CPPUNIT_ASSERT(iter_readpointer->first == test_id1); CPPUNIT_ASSERT(iter_readpointer->second == 0); - ringbuffer = _mainbuffer.getRingBuffer(test_id1); + ringbuffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 1); iter_readpointer = ringbuffer->_readpointer.find(default_id); @@ -557,65 +557,65 @@ void MainBufferTest::testBindUnbindBuffer() // unbind test_id1 with default_id - _mainbuffer.unBindCallID(test_id1); + mainbuffer_.unBindCallID(test_id1); - _debug("%i", (int)(_mainbuffer._ringBufferMap.size())); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 0); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 0); + DEBUG("%i", (int)(mainbuffer_.ringBufferMap_.size())); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 0); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 0); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(default_id) == NULL); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(test_id1) == NULL); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(default_id) == NULL); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(test_id1) == NULL); // bind test_id2 with default_id (default_id already created) // calling it twice not supposed to break anything - _mainbuffer.bindCallID(test_id1, default_id); - _mainbuffer.bindCallID(test_id1, default_id); + mainbuffer_.bindCallID(test_id1, default_id); + mainbuffer_.bindCallID(test_id1, default_id); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 2); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 2); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 2); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 2); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id2); - CPPUNIT_ASSERT(iter_buffer == _mainbuffer._ringBufferMap.end()); - iter_idset = _mainbuffer._callIDMap.find(test_id2); - CPPUNIT_ASSERT(iter_idset == _mainbuffer._callIDMap.end()); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id2); + CPPUNIT_ASSERT(iter_buffer == mainbuffer_.ringBufferMap_.end()); + iter_idset = mainbuffer_.callIDMap_.find(test_id2); + CPPUNIT_ASSERT(iter_idset == mainbuffer_.callIDMap_.end()); - _mainbuffer.bindCallID(test_id2, default_id); - _mainbuffer.bindCallID(test_id2, default_id); + mainbuffer_.bindCallID(test_id2, default_id); + mainbuffer_.bindCallID(test_id2, default_id); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 3); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 3); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 3); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 3); - iter_buffer = _mainbuffer._ringBufferMap.find(default_id); + iter_buffer = mainbuffer_.ringBufferMap_.find(default_id); CPPUNIT_ASSERT(iter_buffer->first == default_id); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(default_id)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(default_id)); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id1); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id1); CPPUNIT_ASSERT(iter_buffer->first == test_id1); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(test_id1)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(test_id1)); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id2); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id2); CPPUNIT_ASSERT(iter_buffer->first == test_id2); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(test_id2)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(test_id2)); - iter_idset = _mainbuffer._callIDMap.find(default_id); + iter_idset = mainbuffer_.callIDMap_.find(default_id); CPPUNIT_ASSERT(iter_idset->second->size() == 2); iter_id = iter_idset->second->find(test_id1); CPPUNIT_ASSERT(*iter_id == test_id1); iter_id = iter_idset->second->find(test_id2); CPPUNIT_ASSERT(*iter_id == test_id2); - iter_idset = _mainbuffer._callIDMap.find(test_id1); + iter_idset = mainbuffer_.callIDMap_.find(test_id1); CPPUNIT_ASSERT(iter_idset->second->size() == 1); iter_id = iter_idset->second->find(default_id); CPPUNIT_ASSERT(*iter_id == default_id); - iter_idset = _mainbuffer._callIDMap.find(test_id2); + iter_idset = mainbuffer_.callIDMap_.find(test_id2); CPPUNIT_ASSERT(iter_idset->second->size() == 1); iter_id = iter_idset->second->find(default_id); CPPUNIT_ASSERT(*iter_id == default_id); - ringbuffer = _mainbuffer.getRingBuffer(default_id); + ringbuffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 2); iter_readpointer = ringbuffer->_readpointer.find(test_id1); @@ -625,14 +625,14 @@ void MainBufferTest::testBindUnbindBuffer() CPPUNIT_ASSERT(iter_readpointer->first == test_id2); CPPUNIT_ASSERT(iter_readpointer->second == 0); - ringbuffer = _mainbuffer.getRingBuffer(test_id1); + ringbuffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 1); iter_readpointer = ringbuffer->_readpointer.find(default_id); CPPUNIT_ASSERT(iter_readpointer->first == default_id); CPPUNIT_ASSERT(iter_readpointer->second == 0); - ringbuffer = _mainbuffer.getRingBuffer(test_id2); + ringbuffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 1); iter_readpointer = ringbuffer->_readpointer.find(default_id); @@ -641,46 +641,46 @@ void MainBufferTest::testBindUnbindBuffer() // bind test_id1 with test_id2 (both testid1 and test_id2 already created) // calling it twice not supposed to break anything - _mainbuffer.bindCallID(test_id1, test_id2); - _mainbuffer.bindCallID(test_id1, test_id2); + mainbuffer_.bindCallID(test_id1, test_id2); + mainbuffer_.bindCallID(test_id1, test_id2); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 3); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 3); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 3); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 3); - iter_buffer = _mainbuffer._ringBufferMap.find(default_id); + iter_buffer = mainbuffer_.ringBufferMap_.find(default_id); CPPUNIT_ASSERT(iter_buffer->first == default_id); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(default_id)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(default_id)); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id1); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id1); CPPUNIT_ASSERT(iter_buffer->first == test_id1); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(test_id1)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(test_id1)); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id2); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id2); CPPUNIT_ASSERT(iter_buffer->first == test_id2); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(test_id2)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(test_id2)); - iter_idset = _mainbuffer._callIDMap.find(default_id); + iter_idset = mainbuffer_.callIDMap_.find(default_id); CPPUNIT_ASSERT(iter_idset->second->size() == 2); iter_id = iter_idset->second->find(test_id1); CPPUNIT_ASSERT(*iter_id == test_id1); iter_id = iter_idset->second->find(test_id2); CPPUNIT_ASSERT(*iter_id == test_id2); - iter_idset = _mainbuffer._callIDMap.find(test_id1); + iter_idset = mainbuffer_.callIDMap_.find(test_id1); CPPUNIT_ASSERT(iter_idset->second->size() == 2); iter_id = iter_idset->second->find(default_id); CPPUNIT_ASSERT(*iter_id == default_id); iter_id = iter_idset->second->find(test_id2); CPPUNIT_ASSERT(*iter_id == test_id2); - iter_idset = _mainbuffer._callIDMap.find(test_id2); + iter_idset = mainbuffer_.callIDMap_.find(test_id2); CPPUNIT_ASSERT(iter_idset->second->size() == 2); iter_id = iter_idset->second->find(default_id); CPPUNIT_ASSERT(*iter_id == default_id); iter_id = iter_idset->second->find(test_id1); CPPUNIT_ASSERT(*iter_id == test_id1); - ringbuffer = _mainbuffer.getRingBuffer(default_id); + ringbuffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 2); iter_readpointer = ringbuffer->_readpointer.find(test_id1); @@ -690,7 +690,7 @@ void MainBufferTest::testBindUnbindBuffer() CPPUNIT_ASSERT(iter_readpointer->first == test_id2); CPPUNIT_ASSERT(iter_readpointer->second == 0); - ringbuffer = _mainbuffer.getRingBuffer(test_id1); + ringbuffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 2); iter_readpointer = ringbuffer->_readpointer.find(default_id); @@ -700,7 +700,7 @@ void MainBufferTest::testBindUnbindBuffer() CPPUNIT_ASSERT(iter_readpointer->first == test_id2); CPPUNIT_ASSERT(iter_readpointer->second == 0); - ringbuffer = _mainbuffer.getRingBuffer(test_id2); + ringbuffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 2); iter_readpointer = ringbuffer->_readpointer.find(default_id); @@ -712,42 +712,42 @@ void MainBufferTest::testBindUnbindBuffer() // unbind test_id1 with test_id2 // calling it twice not supposed to break anything - _mainbuffer.unBindCallID(test_id1, test_id2); - _mainbuffer.unBindCallID(test_id1, test_id2); + mainbuffer_.unBindCallID(test_id1, test_id2); + mainbuffer_.unBindCallID(test_id1, test_id2); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 3); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 3); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 3); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 3); - iter_buffer = _mainbuffer._ringBufferMap.find(default_id); + iter_buffer = mainbuffer_.ringBufferMap_.find(default_id); CPPUNIT_ASSERT(iter_buffer->first == default_id); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(default_id)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(default_id)); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id1); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id1); CPPUNIT_ASSERT(iter_buffer->first == test_id1); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(test_id1)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(test_id1)); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id2); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id2); CPPUNIT_ASSERT(iter_buffer->first == test_id2); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(test_id2)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(test_id2)); - iter_idset = _mainbuffer._callIDMap.find(default_id); + iter_idset = mainbuffer_.callIDMap_.find(default_id); CPPUNIT_ASSERT(iter_idset->second->size() == 2); iter_id = iter_idset->second->find(test_id1); CPPUNIT_ASSERT(*iter_id == test_id1); iter_id = iter_idset->second->find(test_id2); CPPUNIT_ASSERT(*iter_id == test_id2); - iter_idset = _mainbuffer._callIDMap.find(test_id1); + iter_idset = mainbuffer_.callIDMap_.find(test_id1); CPPUNIT_ASSERT(iter_idset->second->size() == 1); iter_id = iter_idset->second->find(default_id); CPPUNIT_ASSERT(*iter_id == default_id); - iter_idset = _mainbuffer._callIDMap.find(test_id2); + iter_idset = mainbuffer_.callIDMap_.find(test_id2); CPPUNIT_ASSERT(iter_idset->second->size() == 1); iter_id = iter_idset->second->find(default_id); CPPUNIT_ASSERT(*iter_id == default_id); - ringbuffer = _mainbuffer.getRingBuffer(default_id); + ringbuffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 2); iter_readpointer = ringbuffer->_readpointer.find(test_id1); @@ -757,14 +757,14 @@ void MainBufferTest::testBindUnbindBuffer() CPPUNIT_ASSERT(iter_readpointer->first == test_id2); CPPUNIT_ASSERT(iter_readpointer->second == 0); - ringbuffer = _mainbuffer.getRingBuffer(test_id1); + ringbuffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 1); iter_readpointer = ringbuffer->_readpointer.find(default_id); CPPUNIT_ASSERT(iter_readpointer->first == default_id); CPPUNIT_ASSERT(iter_readpointer->second == 0); - ringbuffer = _mainbuffer.getRingBuffer(test_id2); + ringbuffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 1); iter_readpointer = ringbuffer->_readpointer.find(default_id); @@ -772,43 +772,43 @@ void MainBufferTest::testBindUnbindBuffer() CPPUNIT_ASSERT(iter_readpointer->second == 0); - _debug("ok1"); + DEBUG("ok1"); // unbind test_id1 with test_id2 // calling it twice not supposed to break anything - _mainbuffer.unBindCallID(default_id, test_id2); - _mainbuffer.unBindCallID(default_id, test_id2); + mainbuffer_.unBindCallID(default_id, test_id2); + mainbuffer_.unBindCallID(default_id, test_id2); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 2); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 2); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 2); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 2); - iter_buffer = _mainbuffer._ringBufferMap.find(default_id); + iter_buffer = mainbuffer_.ringBufferMap_.find(default_id); CPPUNIT_ASSERT(iter_buffer->first == default_id); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(default_id)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(default_id)); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id1); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id1); CPPUNIT_ASSERT(iter_buffer->first == test_id1); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(test_id1)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(test_id1)); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id2); - CPPUNIT_ASSERT(iter_buffer == _mainbuffer._ringBufferMap.end()); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id2); + CPPUNIT_ASSERT(iter_buffer == mainbuffer_.ringBufferMap_.end()); - iter_idset = _mainbuffer._callIDMap.find(default_id); + iter_idset = mainbuffer_.callIDMap_.find(default_id); CPPUNIT_ASSERT(iter_idset->second->size() == 1); iter_id = iter_idset->second->find(test_id1); CPPUNIT_ASSERT(*iter_id == test_id1); iter_id = iter_idset->second->find(test_id2); CPPUNIT_ASSERT(iter_id == iter_idset->second->end()); - iter_idset = _mainbuffer._callIDMap.find(test_id1); + iter_idset = mainbuffer_.callIDMap_.find(test_id1); CPPUNIT_ASSERT(iter_idset->second->size() == 1); iter_id = iter_idset->second->find(default_id); CPPUNIT_ASSERT(*iter_id == default_id); - iter_idset = _mainbuffer._callIDMap.find(test_id2); - CPPUNIT_ASSERT(iter_idset == _mainbuffer._callIDMap.end()); + iter_idset = mainbuffer_.callIDMap_.find(test_id2); + CPPUNIT_ASSERT(iter_idset == mainbuffer_.callIDMap_.end()); - ringbuffer = _mainbuffer.getRingBuffer(default_id); + ringbuffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 1); iter_readpointer = ringbuffer->_readpointer.find(test_id1); @@ -817,7 +817,7 @@ void MainBufferTest::testBindUnbindBuffer() iter_readpointer = ringbuffer->_readpointer.find(test_id2); CPPUNIT_ASSERT(iter_readpointer == ringbuffer->_readpointer.end()); - ringbuffer = _mainbuffer.getRingBuffer(test_id1); + ringbuffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 1); iter_readpointer = ringbuffer->_readpointer.find(default_id); @@ -826,52 +826,52 @@ void MainBufferTest::testBindUnbindBuffer() iter_readpointer = ringbuffer->_readpointer.find(test_id2); CPPUNIT_ASSERT(iter_readpointer == ringbuffer->_readpointer.end()); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(test_id2) == NULL); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(test_id2) == NULL); - _mainbuffer.unBindCallID(default_id, test_id1); + mainbuffer_.unBindCallID(default_id, test_id1); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 0); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 0); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 0); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 0); // test unbind all function - _mainbuffer.bindCallID(default_id, test_id1); - _mainbuffer.bindCallID(default_id, test_id2); - _mainbuffer.bindCallID(test_id1, test_id2); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 3); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 3); + mainbuffer_.bindCallID(default_id, test_id1); + mainbuffer_.bindCallID(default_id, test_id2); + mainbuffer_.bindCallID(test_id1, test_id2); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 3); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 3); - _mainbuffer.unBindAll(test_id2); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 2); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 2); + mainbuffer_.unBindAll(test_id2); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 2); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 2); - iter_buffer = _mainbuffer._ringBufferMap.find(default_id); + iter_buffer = mainbuffer_.ringBufferMap_.find(default_id); CPPUNIT_ASSERT(iter_buffer->first == default_id); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(default_id)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(default_id)); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id1); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id1); CPPUNIT_ASSERT(iter_buffer->first == test_id1); - CPPUNIT_ASSERT(iter_buffer->second == _mainbuffer.getRingBuffer(test_id1)); + CPPUNIT_ASSERT(iter_buffer->second == mainbuffer_.getRingBuffer(test_id1)); - iter_buffer = _mainbuffer._ringBufferMap.find(test_id2); - CPPUNIT_ASSERT(iter_buffer == _mainbuffer._ringBufferMap.end()); + iter_buffer = mainbuffer_.ringBufferMap_.find(test_id2); + CPPUNIT_ASSERT(iter_buffer == mainbuffer_.ringBufferMap_.end()); - iter_idset = _mainbuffer._callIDMap.find(default_id); + iter_idset = mainbuffer_.callIDMap_.find(default_id); CPPUNIT_ASSERT(iter_idset->second->size() == 1); iter_id = iter_idset->second->find(test_id1); CPPUNIT_ASSERT(*iter_id == test_id1); iter_id = iter_idset->second->find(test_id2); CPPUNIT_ASSERT(iter_id == iter_idset->second->end()); - iter_idset = _mainbuffer._callIDMap.find(test_id1); + iter_idset = mainbuffer_.callIDMap_.find(test_id1); CPPUNIT_ASSERT(iter_idset->second->size() == 1); iter_id = iter_idset->second->find(default_id); CPPUNIT_ASSERT(*iter_id == default_id); - iter_idset = _mainbuffer._callIDMap.find(test_id2); - CPPUNIT_ASSERT(iter_idset == _mainbuffer._callIDMap.end()); + iter_idset = mainbuffer_.callIDMap_.find(test_id2); + CPPUNIT_ASSERT(iter_idset == mainbuffer_.callIDMap_.end()); - ringbuffer = _mainbuffer.getRingBuffer(default_id); + ringbuffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 1); iter_readpointer = ringbuffer->_readpointer.find(test_id1); @@ -880,7 +880,7 @@ void MainBufferTest::testBindUnbindBuffer() iter_readpointer = ringbuffer->_readpointer.find(test_id2); CPPUNIT_ASSERT(iter_readpointer == ringbuffer->_readpointer.end()); - ringbuffer = _mainbuffer.getRingBuffer(test_id1); + ringbuffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(ringbuffer != NULL); CPPUNIT_ASSERT(ringbuffer->getNbReadPointer() == 1); iter_readpointer = ringbuffer->_readpointer.find(default_id); @@ -894,12 +894,12 @@ void MainBufferTest::testBindUnbindBuffer() void MainBufferTest::testGetPutDataByID() { - _debug("-------------------- MainBufferTest::testGetPutDataByID --------------------\n"); + DEBUG("-------------------- MainBufferTest::testGetPutDataByID --------------------\n"); std::string test_id = "getData putData"; std::string false_id = "false id"; - _mainbuffer.bindCallID(test_id); + mainbuffer_.bindCallID(test_id); int test_input1 = 12; int test_input2 = 13; @@ -909,39 +909,39 @@ void MainBufferTest::testGetPutDataByID() int avail_for_put_defaultid; // put by default_id get by test_id without preleminary put - avail_for_put_defaultid = _mainbuffer.availForPut(); - CPPUNIT_ASSERT(_mainbuffer.availForGetByID(default_id, test_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.getDataByID(&test_output, sizeof(int), default_id, test_id) == 0); + avail_for_put_defaultid = mainbuffer_.availForPut(); + CPPUNIT_ASSERT(mainbuffer_.availForGetByID(default_id, test_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.getDataByID(&test_output, sizeof(int), default_id, test_id) == 0); // put by default_id, get by test_id - CPPUNIT_ASSERT(_mainbuffer.availForPut() == avail_for_put_defaultid); - CPPUNIT_ASSERT(_mainbuffer.putData(&test_input1, sizeof(int)) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForPut() == (avail_for_put_defaultid - (int) sizeof(int))); - CPPUNIT_ASSERT(_mainbuffer.availForGetByID(default_id, test_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.getDataByID(&test_output, sizeof(int), 100, default_id, test_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGetByID(default_id, test_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForPut() == avail_for_put_defaultid); + CPPUNIT_ASSERT(mainbuffer_.putData(&test_input1, sizeof(int)) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForPut() == (avail_for_put_defaultid - (int) sizeof(int))); + CPPUNIT_ASSERT(mainbuffer_.availForGetByID(default_id, test_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.getDataByID(&test_output, sizeof(int), 100, default_id, test_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGetByID(default_id, test_id) == 0); CPPUNIT_ASSERT(test_input1 == test_output); // get by default_id without preliminary input - avail_for_put_testid = _mainbuffer.availForPut(test_id); - CPPUNIT_ASSERT(_mainbuffer.availForGetByID(test_id, default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.getDataByID(&test_output, sizeof(int), 100, test_id, default_id) == 0); + avail_for_put_testid = mainbuffer_.availForPut(test_id); + CPPUNIT_ASSERT(mainbuffer_.availForGetByID(test_id, default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.getDataByID(&test_output, sizeof(int), 100, test_id, default_id) == 0); // pu by test_id get by test_id - CPPUNIT_ASSERT(_mainbuffer.availForPut(test_id) == avail_for_put_defaultid); - CPPUNIT_ASSERT(_mainbuffer.putData(&test_input2, sizeof(int), test_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGetByID(test_id, default_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.getDataByID(&test_output, sizeof(int), 100, test_id, default_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGetByID(test_id, default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForPut(test_id) == avail_for_put_defaultid); + CPPUNIT_ASSERT(mainbuffer_.putData(&test_input2, sizeof(int), test_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGetByID(test_id, default_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.getDataByID(&test_output, sizeof(int), 100, test_id, default_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGetByID(test_id, default_id) == 0); CPPUNIT_ASSERT(test_input2 == test_output); // put/get by false id - CPPUNIT_ASSERT(_mainbuffer.putData(&test_input2, sizeof(int), false_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.getDataByID(&test_input2, sizeof(int), 100, false_id, false_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.getDataByID(&test_input2, sizeof(int), 100, default_id, false_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.getDataByID(&test_input2, sizeof(int), 100, false_id, default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.putData(&test_input2, sizeof(int), false_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.getDataByID(&test_input2, sizeof(int), 100, false_id, false_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.getDataByID(&test_input2, sizeof(int), 100, default_id, false_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.getDataByID(&test_input2, sizeof(int), 100, false_id, default_id) == 0); - _mainbuffer.unBindCallID(test_id); + mainbuffer_.unBindCallID(test_id); } @@ -949,11 +949,11 @@ void MainBufferTest::testGetPutDataByID() void MainBufferTest::testGetPutData() { - _debug("-------------------- MainBufferTest::testGetPutData --------------------\n"); + DEBUG("-------------------- MainBufferTest::testGetPutData --------------------\n"); std::string test_id = "incoming rtp session"; - _mainbuffer.bindCallID(test_id); + mainbuffer_.bindCallID(test_id); int test_input1 = 12; int test_input2 = 13; @@ -963,90 +963,90 @@ void MainBufferTest::testGetPutData() int avail_for_put_defaultid; // get by test_id without preleminary put - avail_for_put_defaultid = _mainbuffer.availForPut(); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.getData(&test_output, sizeof(int), 100, test_id) == 0); + avail_for_put_defaultid = mainbuffer_.availForPut(); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.getData(&test_output, sizeof(int), 100, test_id) == 0); // put by default_id, get by test_id - CPPUNIT_ASSERT(_mainbuffer.availForPut() == avail_for_put_defaultid); - CPPUNIT_ASSERT(_mainbuffer.putData(&test_input1, sizeof(int)) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForPut() == (avail_for_put_defaultid - (int) sizeof(int))); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.getData(&test_output, sizeof(int), 100, test_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForPut() == avail_for_put_defaultid); + CPPUNIT_ASSERT(mainbuffer_.putData(&test_input1, sizeof(int)) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForPut() == (avail_for_put_defaultid - (int) sizeof(int))); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.getData(&test_output, sizeof(int), 100, test_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id) == 0); CPPUNIT_ASSERT(test_input1 == test_output); // get by default_id without preleminary put - avail_for_put_testid = _mainbuffer.availForPut(test_id); - CPPUNIT_ASSERT(_mainbuffer.availForGet() == 0); - CPPUNIT_ASSERT(_mainbuffer.getData(&test_output, sizeof(int)) == 0); + avail_for_put_testid = mainbuffer_.availForPut(test_id); + CPPUNIT_ASSERT(mainbuffer_.availForGet() == 0); + CPPUNIT_ASSERT(mainbuffer_.getData(&test_output, sizeof(int)) == 0); // put by test_id, get by default_id - CPPUNIT_ASSERT(_mainbuffer.availForPut(test_id) == avail_for_put_testid); - CPPUNIT_ASSERT(_mainbuffer.putData(&test_input2, sizeof(int), test_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForPut(test_id) == (avail_for_put_testid - (int) sizeof(int))); - CPPUNIT_ASSERT(_mainbuffer.availForGet() == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.getData(&test_output, sizeof(int), 100) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet() == 0); + CPPUNIT_ASSERT(mainbuffer_.availForPut(test_id) == avail_for_put_testid); + CPPUNIT_ASSERT(mainbuffer_.putData(&test_input2, sizeof(int), test_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForPut(test_id) == (avail_for_put_testid - (int) sizeof(int))); + CPPUNIT_ASSERT(mainbuffer_.availForGet() == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.getData(&test_output, sizeof(int), 100) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet() == 0); CPPUNIT_ASSERT(test_input2 == test_output); - _mainbuffer.unBindCallID(test_id); + mainbuffer_.unBindCallID(test_id); } void MainBufferTest::testDiscardFlush() { - _debug("-------------------- MainBufferTest::testDiscardFlush --------------------\n"); + DEBUG("-------------------- MainBufferTest::testDiscardFlush --------------------\n"); std::string test_id = "flush discard"; - // _mainbuffer.createRingBuffer(test_id); - _mainbuffer.bindCallID(test_id); + // mainbuffer_.createRingBuffer(test_id); + mainbuffer_.bindCallID(test_id); int test_input1 = 12; // int test_output_size; // int init_size; - CPPUNIT_ASSERT(_mainbuffer.putData(&test_input1, sizeof(int), test_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet() == sizeof(int)); - _mainbuffer.discard(sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet() == 0); + CPPUNIT_ASSERT(mainbuffer_.putData(&test_input1, sizeof(int), test_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet() == sizeof(int)); + mainbuffer_.discard(sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet() == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id) == 0); - _mainbuffer.discard(sizeof(int), test_id); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id) == 0); + mainbuffer_.discard(sizeof(int), test_id); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(test_id)->getReadPointer(default_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(test_id)->getReadPointer(test_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(test_id)->getReadPointer(default_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(test_id)->getReadPointer(test_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(default_id)->getReadPointer(test_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.putData(&test_input1, sizeof(int), 100) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(default_id)->getReadPointer(test_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(default_id)->getReadPointer(test_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.putData(&test_input1, sizeof(int), 100) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(default_id)->getReadPointer(test_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(default_id)->getReadPointer(test_id) == 0); - _mainbuffer.discard(sizeof(int), test_id); - CPPUNIT_ASSERT(_mainbuffer.getRingBuffer(default_id)->getReadPointer(test_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(default_id)->getReadPointer(test_id) == 0); + mainbuffer_.discard(sizeof(int), test_id); + CPPUNIT_ASSERT(mainbuffer_.getRingBuffer(default_id)->getReadPointer(test_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id) == 0); - // _mainbuffer.removeRingBuffer(test_id); - _mainbuffer.unBindCallID(test_id); + // mainbuffer_.removeRingBuffer(test_id); + mainbuffer_.unBindCallID(test_id); } void MainBufferTest::testReadPointerInit() { - _debug("-------------------- MainBufferTest::testReadPointerInit --------------------\n"); + DEBUG("-------------------- MainBufferTest::testReadPointerInit --------------------\n"); std::string test_id = "test read pointer init"; - // RingBuffer* test_ring_buffer = _mainbuffer.createRingBuffer(test_id); + // RingBuffer* test_ring_buffer = mainbuffer_.createRingBuffer(test_id); - _mainbuffer.bindCallID(test_id); + mainbuffer_.bindCallID(test_id); - RingBuffer* test_ring_buffer = _mainbuffer.getRingBuffer(test_id); + RingBuffer* test_ring_buffer = mainbuffer_.getRingBuffer(test_id); CPPUNIT_ASSERT(test_ring_buffer->getReadPointer() == 0); test_ring_buffer->storeReadPointer(30); @@ -1060,17 +1060,17 @@ void MainBufferTest::testReadPointerInit() CPPUNIT_ASSERT(test_ring_buffer->getReadPointer(test_id) == (int) NULL); test_ring_buffer->removeReadPointer("false id"); - // _mainbuffer.removeRingBuffer(test_id); - _mainbuffer.unBindCallID(test_id); + // mainbuffer_.removeRingBuffer(test_id); + mainbuffer_.unBindCallID(test_id); } void MainBufferTest::testRingBufferSeveralPointers() { - _debug("-------------------- MainBufferTest::testRingBufferSeveralPointers --------------------\n"); + DEBUG("-------------------- MainBufferTest::testRingBufferSeveralPointers --------------------\n"); std::string test_id = "test multiple read pointer"; - RingBuffer* test_ring_buffer = _mainbuffer.createRingBuffer(test_id); + RingBuffer* test_ring_buffer = mainbuffer_.createRingBuffer(test_id); std::string test_pointer1 = "test pointer 1"; std::string test_pointer2 = "test pointer 2"; @@ -1173,14 +1173,14 @@ void MainBufferTest::testRingBufferSeveralPointers() test_ring_buffer->removeReadPointer(test_pointer1); test_ring_buffer->removeReadPointer(test_pointer2); - _mainbuffer.removeRingBuffer(test_id); + mainbuffer_.removeRingBuffer(test_id); } void MainBufferTest::testConference() { - _debug("-------------------- MainBufferTest::testConference --------------------\n"); + DEBUG("-------------------- MainBufferTest::testConference --------------------\n"); std::string test_id1 = "participant A"; std::string test_id2 = "participant B"; @@ -1195,48 +1195,48 @@ void MainBufferTest::testConference() // test initial setup // ringbuffers - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 0); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer == NULL); // callidmap - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 0); - iter_callidmap = _mainbuffer._callIDMap.find(default_id); - CPPUNIT_ASSERT(iter_callidmap == _mainbuffer._callIDMap.end()); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 0); + iter_callidmap = mainbuffer_.callIDMap_.find(default_id); + CPPUNIT_ASSERT(iter_callidmap == mainbuffer_.callIDMap_.end()); // test bind Participant A with default - _mainbuffer.bindCallID(test_id1); + mainbuffer_.bindCallID(test_id1); // ringbuffers - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 2); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 2); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->getNbReadPointer() == 1); iter_readpointer = test_ring_buffer->_readpointer.find(test_id1); CPPUNIT_ASSERT(iter_readpointer->first == test_id1); CPPUNIT_ASSERT(iter_readpointer->second == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->getNbReadPointer() == 1); iter_readpointer = test_ring_buffer->_readpointer.find(default_id); CPPUNIT_ASSERT(iter_readpointer->first == default_id); CPPUNIT_ASSERT(iter_readpointer->second == 0); // callidmap - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 2); - iter_callidmap = _mainbuffer._callIDMap.find(default_id); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 2); + iter_callidmap = mainbuffer_.callIDMap_.find(default_id); CPPUNIT_ASSERT(iter_callidmap->first == default_id); CPPUNIT_ASSERT(iter_callidmap->second->size() == 1); iter_callidset = iter_callidmap->second->find(test_id1); CPPUNIT_ASSERT(*iter_callidset == test_id1); - iter_callidmap = _mainbuffer._callIDMap.find(test_id1); + iter_callidmap = mainbuffer_.callIDMap_.find(test_id1); CPPUNIT_ASSERT(iter_callidmap->first == test_id1); CPPUNIT_ASSERT(iter_callidmap->second->size() == 1); iter_callidset = iter_callidmap->second->find(default_id); CPPUNIT_ASSERT(*iter_callidset == default_id); // test bind Participant B with default - _mainbuffer.bindCallID(test_id2); + mainbuffer_.bindCallID(test_id2); // ringbuffers - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 3); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 3); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->getNbReadPointer() == 2); iter_readpointer = test_ring_buffer->_readpointer.find(test_id1); CPPUNIT_ASSERT(iter_readpointer->first == test_id1); @@ -1244,31 +1244,31 @@ void MainBufferTest::testConference() iter_readpointer = test_ring_buffer->_readpointer.find(test_id2); CPPUNIT_ASSERT(iter_readpointer->first == test_id2); CPPUNIT_ASSERT(iter_readpointer->second == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->getNbReadPointer() == 1); iter_readpointer = test_ring_buffer->_readpointer.find(default_id); CPPUNIT_ASSERT(iter_readpointer->first == default_id); CPPUNIT_ASSERT(iter_readpointer->second == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->getNbReadPointer() == 1); iter_readpointer = test_ring_buffer->_readpointer.find(default_id); CPPUNIT_ASSERT(iter_readpointer->first == default_id); CPPUNIT_ASSERT(iter_readpointer->second == 0); // callidmap - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 3); - iter_callidmap = _mainbuffer._callIDMap.find(default_id); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 3); + iter_callidmap = mainbuffer_.callIDMap_.find(default_id); CPPUNIT_ASSERT(iter_callidmap->first == default_id); CPPUNIT_ASSERT(iter_callidmap->second->size() == 2); iter_callidset = iter_callidmap->second->find(test_id1); CPPUNIT_ASSERT(*iter_callidset == test_id1); iter_callidset = iter_callidmap->second->find(test_id2); CPPUNIT_ASSERT(*iter_callidset == test_id2); - iter_callidmap = _mainbuffer._callIDMap.find(test_id1); + iter_callidmap = mainbuffer_.callIDMap_.find(test_id1); CPPUNIT_ASSERT(iter_callidmap->first == test_id1); CPPUNIT_ASSERT(iter_callidmap->second->size() == 1); iter_callidset = iter_callidmap->second->find(default_id); CPPUNIT_ASSERT(*iter_callidset == default_id); - iter_callidmap = _mainbuffer._callIDMap.find(test_id2); + iter_callidmap = mainbuffer_.callIDMap_.find(test_id2); CPPUNIT_ASSERT(iter_callidmap->first == test_id2); CPPUNIT_ASSERT(iter_callidmap->second->size() == 1); iter_callidset = iter_callidmap->second->find(default_id); @@ -1276,10 +1276,10 @@ void MainBufferTest::testConference() // test bind Participant A with Participant B - _mainbuffer.bindCallID(test_id1, test_id2); + mainbuffer_.bindCallID(test_id1, test_id2); // ringbuffers - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 3); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 3); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->getNbReadPointer() == 2); iter_readpointer = test_ring_buffer->_readpointer.find(test_id1); CPPUNIT_ASSERT(iter_readpointer->first == test_id1); @@ -1287,7 +1287,7 @@ void MainBufferTest::testConference() iter_readpointer = test_ring_buffer->_readpointer.find(test_id2); CPPUNIT_ASSERT(iter_readpointer->first == test_id2); CPPUNIT_ASSERT(iter_readpointer->second == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->getNbReadPointer() == 2); iter_readpointer = test_ring_buffer->_readpointer.find(default_id); CPPUNIT_ASSERT(iter_readpointer->first == default_id); @@ -1295,7 +1295,7 @@ void MainBufferTest::testConference() iter_readpointer = test_ring_buffer->_readpointer.find(test_id2); CPPUNIT_ASSERT(iter_readpointer->first == test_id2); CPPUNIT_ASSERT(iter_readpointer->second == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->getNbReadPointer() == 2); iter_readpointer = test_ring_buffer->_readpointer.find(default_id); CPPUNIT_ASSERT(iter_readpointer->first == default_id); @@ -1304,22 +1304,22 @@ void MainBufferTest::testConference() CPPUNIT_ASSERT(iter_readpointer->first == test_id1); CPPUNIT_ASSERT(iter_readpointer->second == 0); // callidmap - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 3); - iter_callidmap = _mainbuffer._callIDMap.find(default_id); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 3); + iter_callidmap = mainbuffer_.callIDMap_.find(default_id); CPPUNIT_ASSERT(iter_callidmap->first == default_id); CPPUNIT_ASSERT(iter_callidmap->second->size() == 2); iter_callidset = iter_callidmap->second->find(test_id1); CPPUNIT_ASSERT(*iter_callidset == test_id1); iter_callidset = iter_callidmap->second->find(test_id2); CPPUNIT_ASSERT(*iter_callidset == test_id2); - iter_callidmap = _mainbuffer._callIDMap.find(test_id1); + iter_callidmap = mainbuffer_.callIDMap_.find(test_id1); CPPUNIT_ASSERT(iter_callidmap->first == test_id1); CPPUNIT_ASSERT(iter_callidmap->second->size() == 2); iter_callidset = iter_callidmap->second->find(default_id); CPPUNIT_ASSERT(*iter_callidset == default_id); iter_callidset = iter_callidmap->second->find(test_id2); CPPUNIT_ASSERT(*iter_callidset == test_id2); - iter_callidmap = _mainbuffer._callIDMap.find(test_id2); + iter_callidmap = mainbuffer_.callIDMap_.find(test_id2); CPPUNIT_ASSERT(iter_callidmap->first == test_id2); CPPUNIT_ASSERT(iter_callidmap->second->size() == 2); iter_callidset = iter_callidmap->second->find(default_id); @@ -1334,436 +1334,436 @@ void MainBufferTest::testConference() int init_put_id1; int init_put_id2; - init_put_defaultid = _mainbuffer.getRingBuffer(default_id)->AvailForPut(); - init_put_id1 = _mainbuffer.getRingBuffer(test_id1)->AvailForPut(); - init_put_id2 = _mainbuffer.getRingBuffer(test_id2)->AvailForPut(); - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == 0); + init_put_defaultid = mainbuffer_.getRingBuffer(default_id)->AvailForPut(); + init_put_id1 = mainbuffer_.getRingBuffer(test_id1)->AvailForPut(); + init_put_id2 = mainbuffer_.getRingBuffer(test_id2)->AvailForPut(); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == 0); // put data test ring buffers - CPPUNIT_ASSERT(_mainbuffer.putData(&testint, sizeof(int)) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.putData(&testint, sizeof(int)) == sizeof(int)); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id1); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget (get data even if some participant missing) - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); //putdata test ring buffers - CPPUNIT_ASSERT(_mainbuffer.putData(&testint, sizeof(int), 100, test_id1) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.putData(&testint, sizeof(int), 100, test_id1) == sizeof(int)); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget (get data even if some participant missing) - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); //putdata test ring buffers - CPPUNIT_ASSERT(_mainbuffer.putData(&testint, sizeof(int), 100, test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.putData(&testint, sizeof(int), 100, test_id2) == sizeof(int)); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id2 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); int test_output; // test getData default id (audio layer) - CPPUNIT_ASSERT(_mainbuffer.getData(&test_output, sizeof(int), 100) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.getData(&test_output, sizeof(int), 100) == sizeof(int)); CPPUNIT_ASSERT(test_output == (testint + testint)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id2 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); // test getData test_id1 (audio layer) - CPPUNIT_ASSERT(_mainbuffer.getData(&test_output, sizeof(int), 100, test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.getData(&test_output, sizeof(int), 100, test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_output == (testint + testint)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); // test getData test_id2 (audio layer) - CPPUNIT_ASSERT(_mainbuffer.getData(&test_output, sizeof(int), 100, test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.getData(&test_output, sizeof(int), 100, test_id2) == sizeof(int)); CPPUNIT_ASSERT(test_output == (testint + testint)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_defaultid); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id1); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == 0); // test putData default (for discarting) - init_put_defaultid = _mainbuffer.getRingBuffer(default_id)->AvailForPut(); - init_put_id1 = _mainbuffer.getRingBuffer(test_id1)->AvailForPut(); - init_put_id2 = _mainbuffer.getRingBuffer(test_id2)->AvailForPut(); - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == 0); + init_put_defaultid = mainbuffer_.getRingBuffer(default_id)->AvailForPut(); + init_put_id1 = mainbuffer_.getRingBuffer(test_id1)->AvailForPut(); + init_put_id2 = mainbuffer_.getRingBuffer(test_id2)->AvailForPut(); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == 0); // put data test ring buffers - CPPUNIT_ASSERT(_mainbuffer.putData(&testint, sizeof(int), 100) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.putData(&testint, sizeof(int), 100) == sizeof(int)); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id1); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); //putdata test ring buffers - CPPUNIT_ASSERT(_mainbuffer.putData(&testint, sizeof(int), 100, test_id1) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.putData(&testint, sizeof(int), 100, test_id1) == sizeof(int)); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); //putdata test ring buffers - CPPUNIT_ASSERT(_mainbuffer.putData(&testint, sizeof(int), 100, test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.putData(&testint, sizeof(int), 100, test_id2) == sizeof(int)); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id2 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); // test discardData default id (audio layer) - CPPUNIT_ASSERT(_mainbuffer.discard(sizeof(int)) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.discard(sizeof(int)) == sizeof(int)); CPPUNIT_ASSERT(test_output == (testint + testint)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id2 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); // test discardData test_id1 (audio layer) - CPPUNIT_ASSERT(_mainbuffer.discard(sizeof(int), test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.discard(sizeof(int), test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_output == (testint + testint)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); // test discardData test_id2 (audio layer) - CPPUNIT_ASSERT(_mainbuffer.discard(sizeof(int), test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.discard(sizeof(int), test_id2) == sizeof(int)); CPPUNIT_ASSERT(test_output == (testint + testint)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_defaultid); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id1); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == 0); // test putData default (for flushing) - init_put_defaultid = _mainbuffer.getRingBuffer(default_id)->AvailForPut(); - init_put_id1 = _mainbuffer.getRingBuffer(test_id1)->AvailForPut(); - init_put_id2 = _mainbuffer.getRingBuffer(test_id2)->AvailForPut(); - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == 0); + init_put_defaultid = mainbuffer_.getRingBuffer(default_id)->AvailForPut(); + init_put_id1 = mainbuffer_.getRingBuffer(test_id1)->AvailForPut(); + init_put_id2 = mainbuffer_.getRingBuffer(test_id2)->AvailForPut(); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == 0); // put data test ring buffers - CPPUNIT_ASSERT(_mainbuffer.putData(&testint, sizeof(int), 100) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.putData(&testint, sizeof(int), 100) == sizeof(int)); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id1); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); //putdata test ring buffers - CPPUNIT_ASSERT(_mainbuffer.putData(&testint, sizeof(int), 100, test_id1) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.putData(&testint, sizeof(int), 100, test_id1) == sizeof(int)); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); //putdata test ring buffers - CPPUNIT_ASSERT(_mainbuffer.putData(&testint, sizeof(int), 100, test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + CPPUNIT_ASSERT(mainbuffer_.putData(&testint, sizeof(int), 100, test_id2) == sizeof(int)); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id2 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); // test flush default id (audio layer) - _mainbuffer.flush(); + mainbuffer_.flush(); CPPUNIT_ASSERT(test_output == (testint + testint)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); - _debug("%i", test_ring_buffer->putLen()); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); + DEBUG("%i", test_ring_buffer->putLen()); test_ring_buffer->debug(); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id2 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == sizeof(int)); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == sizeof(int)); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); // test flush test_id1 (audio layer) - _mainbuffer.flush(test_id1); + mainbuffer_.flush(test_id1); CPPUNIT_ASSERT(test_output == (testint + testint)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_defaultid - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == sizeof(int)); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == (int)(init_put_id1 - sizeof(int))); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == sizeof(int)); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == sizeof(int)); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == sizeof(int)); // test flush test_id2 (audio layer) - _mainbuffer.flush(test_id2); + mainbuffer_.flush(test_id2); CPPUNIT_ASSERT(test_output == (testint + testint)); - test_ring_buffer = _mainbuffer.getRingBuffer(default_id); + test_ring_buffer = mainbuffer_.getRingBuffer(default_id); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_defaultid); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id1); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id1); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id1); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id2) == 0); - test_ring_buffer = _mainbuffer.getRingBuffer(test_id2); + test_ring_buffer = mainbuffer_.getRingBuffer(test_id2); CPPUNIT_ASSERT(test_ring_buffer->putLen() == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForPut() == init_put_id2); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(default_id) == 0); CPPUNIT_ASSERT(test_ring_buffer->AvailForGet(test_id1) == 0); // test mainbuffer availforget - CPPUNIT_ASSERT(_mainbuffer.availForGet(default_id) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id1) == 0); - CPPUNIT_ASSERT(_mainbuffer.availForGet(test_id2) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(default_id) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id1) == 0); + CPPUNIT_ASSERT(mainbuffer_.availForGet(test_id2) == 0); - _mainbuffer.unBindCallID(test_id1, test_id2); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 3); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 3); + mainbuffer_.unBindCallID(test_id1, test_id2); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 3); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 3); - _mainbuffer.unBindCallID(test_id1); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 2); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 2); + mainbuffer_.unBindCallID(test_id1); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 2); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 2); - _mainbuffer.unBindCallID(test_id2); - CPPUNIT_ASSERT(_mainbuffer._ringBufferMap.size() == 0); - CPPUNIT_ASSERT(_mainbuffer._callIDMap.size() == 0); + mainbuffer_.unBindCallID(test_id2); + CPPUNIT_ASSERT(mainbuffer_.ringBufferMap_.size() == 0); + CPPUNIT_ASSERT(mainbuffer_.callIDMap_.size() == 0); } diff --git a/daemon/test/mainbuffertest.h b/daemon/test/mainbuffertest.h index d461db673e131bfffbb01bed05e5daaf84a895f4..316191f4964ab92f8d1c3fbc2e10f8d5eefb2e65 100644 --- a/daemon/test/mainbuffertest.h +++ b/daemon/test/mainbuffertest.h @@ -138,7 +138,7 @@ class MainBufferTest : public CppUnit::TestCase { private: - MainBuffer _mainbuffer; + MainBuffer mainbuffer_; }; /* Register our test module */ diff --git a/daemon/test/numbercleanertest.cpp b/daemon/test/numbercleanertest.cpp index 4cd2f5212ff211f92678698b7965cabd8641cf50..d9642a7201aae83b6d2b95506f0d8969776c547f 100644 --- a/daemon/test/numbercleanertest.cpp +++ b/daemon/test/numbercleanertest.cpp @@ -53,76 +53,76 @@ void NumberCleanerTest::test_format_1(void) { - _debug("-------------------- NumberCleanerTest::test_format_1 --------------------\n"); + DEBUG("-------------------- NumberCleanerTest::test_format_1 --------------------\n"); CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_1) == VALID_NUMBER); } void NumberCleanerTest::test_format_2(void) { - _debug("-------------------- NumberCleanerTest::test_format_2 --------------------\n"); + DEBUG("-------------------- NumberCleanerTest::test_format_2 --------------------\n"); CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_2) == VALID_NUMBER); } void NumberCleanerTest::test_format_3(void) { - _debug("-------------------- NumberCleanerTest::test_format_3 --------------------\n"); + DEBUG("-------------------- NumberCleanerTest::test_format_3 --------------------\n"); CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_3) == VALID_NUMBER); } void NumberCleanerTest::test_format_4(void) { - _debug("-------------------- NumberCleanerTest::test_format_4 --------------------\n"); + DEBUG("-------------------- NumberCleanerTest::test_format_4 --------------------\n"); CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_4) == VALID_NUMBER); } void NumberCleanerTest::test_format_5(void) { - _debug("-------------------- NumberCleanerTest::test_format_5 --------------------\n"); + DEBUG("-------------------- NumberCleanerTest::test_format_5 --------------------\n"); CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_5) == VALID_NUMBER); } void NumberCleanerTest::test_format_6(void) { - _debug("-------------------- NumberCleanerTest::test_format_6 --------------------\n"); + DEBUG("-------------------- NumberCleanerTest::test_format_6 --------------------\n"); CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_6) == VALID_NUMBER); } void NumberCleanerTest::test_format_7(void) { - _debug("-------------------- NumberCleanerTest::test_format_7 --------------------\n"); + DEBUG("-------------------- NumberCleanerTest::test_format_7 --------------------\n"); CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_7) == VALID_EXTENSION); } void NumberCleanerTest::test_format_8(void) { - _debug("-------------------- NumberCleanerTest::test_format_8 --------------------\n"); + DEBUG("-------------------- NumberCleanerTest::test_format_8 --------------------\n"); CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_8) == VALID_NUMBER); } void NumberCleanerTest::test_format_9(void) { - _debug("-------------------- NumberCleanerTest::test_format_9 --------------------\n"); + DEBUG("-------------------- NumberCleanerTest::test_format_9 --------------------\n"); CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_9) == VALID_NUMBER); } void NumberCleanerTest::test_format_10(void) { - _debug("-------------------- NumberCleanerTest::test_format_10 --------------------\n"); + DEBUG("-------------------- NumberCleanerTest::test_format_10 --------------------\n"); CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_1, "9") == VALID_PREPENDED_NUMBER); } void NumberCleanerTest::test_format_11(void) { - _debug("-------------------- NumberCleanerTest::test_format_11 --------------------\n"); + DEBUG("-------------------- NumberCleanerTest::test_format_11 --------------------\n"); CPPUNIT_ASSERT(NumberCleaner::clean(NUMBER_TEST_10, "9") == VALID_EXTENSION); } diff --git a/daemon/test/rtptest.cpp b/daemon/test/rtptest.cpp index 11ab28077213832bcddb4ee26de177917818e02e..34198cc55717522a65324c8c8fcba06943eb4b23 100644 --- a/daemon/test/rtptest.cpp +++ b/daemon/test/rtptest.cpp @@ -57,7 +57,7 @@ bool RtpTest::pjsipInit() void RtpTest::testRtpInitClose() { - _debug("-------------------- RtpTest::testRtpInitClose --------------------\n"); + DEBUG("-------------------- RtpTest::testRtpInitClose --------------------\n"); } diff --git a/daemon/test/sdesnegotiatortest.cpp b/daemon/test/sdesnegotiatortest.cpp index 4b9b75045a4dc3ba7fe6ec250af2935a0e4c3e1c..da2325f6b93ee0aa02ccf103ddbd5fcefd304b10 100644 --- a/daemon/test/sdesnegotiatortest.cpp +++ b/daemon/test/sdesnegotiatortest.cpp @@ -54,7 +54,7 @@ using std::endl; void SdesNegotiatorTest::testTagPattern() { - _debug("-------------------- SdesNegotiatorTest::testTagPattern --------------------\n"); + DEBUG("-------------------- SdesNegotiatorTest::testTagPattern --------------------\n"); std::string subject = "a=crypto:4"; @@ -71,7 +71,7 @@ void SdesNegotiatorTest::testTagPattern() void SdesNegotiatorTest::testCryptoSuitePattern() { - _debug("-------------------- SdesNegotiatorTest::testCryptoSuitePattern --------------------\n"); + DEBUG("-------------------- SdesNegotiatorTest::testCryptoSuitePattern --------------------\n"); std::string subject = "AES_CM_128_HMAC_SHA1_80"; @@ -91,7 +91,7 @@ void SdesNegotiatorTest::testCryptoSuitePattern() void SdesNegotiatorTest::testKeyParamsPattern() { - _debug("-------------------- SdesNegotiatorTest::testKeyParamsPattern --------------------\n"); + DEBUG("-------------------- SdesNegotiatorTest::testKeyParamsPattern --------------------\n"); std::string subject = "inline:d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj|2^20|1:32"; @@ -118,7 +118,7 @@ void SdesNegotiatorTest::testKeyParamsPattern() void SdesNegotiatorTest::testKeyParamsPatternWithoutMKI() { - _debug("-------------------- SdesNegotiatorTest::testKeyParamsPatternWithoutMKI --------------------\n"); + DEBUG("-------------------- SdesNegotiatorTest::testKeyParamsPatternWithoutMKI --------------------\n"); std::string subject = "inline:d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj"; @@ -145,7 +145,7 @@ void SdesNegotiatorTest::testKeyParamsPatternWithoutMKI() */ void SdesNegotiatorTest::testNegotiation() { - _debug("-------------------- SdesNegotiatorTest::testNegotiation --------------------\n"); + DEBUG("-------------------- SdesNegotiatorTest::testNegotiation --------------------\n"); // Add a new SDES crypto line to be processed. remoteOffer = new std::vector<std::string>(); @@ -179,7 +179,7 @@ void SdesNegotiatorTest::testNegotiation() */ void SdesNegotiatorTest::testComponent() { - _debug("-------------------- SdesNegotiatorTest::testComponent --------------------\n"); + DEBUG("-------------------- SdesNegotiatorTest::testComponent --------------------\n"); // Register the local capabilities. std::vector<sfl::CryptoSuiteDefinition> * capabilities = new std::vector<sfl::CryptoSuiteDefinition>(); @@ -206,7 +206,7 @@ void SdesNegotiatorTest::testComponent() */ void SdesNegotiatorTest::testMostSimpleCase() { - _debug("-------------------- SdesNegotiatorTest::testMostSimpleCase --------------------\n"); + DEBUG("-------------------- SdesNegotiatorTest::testMostSimpleCase --------------------\n"); // Register the local capabilities. std::vector<sfl::CryptoSuiteDefinition> * capabilities = new std::vector<sfl::CryptoSuiteDefinition>(); @@ -245,7 +245,7 @@ void SdesNegotiatorTest::testMostSimpleCase() void SdesNegotiatorTest::test32ByteKeyLength() { - _debug("-------------------- SdesNegotiatorTest::test32ByteKeyLength --------------------\n"); + DEBUG("-------------------- SdesNegotiatorTest::test32ByteKeyLength --------------------\n"); // Register the local capabilities. std::vector<sfl::CryptoSuiteDefinition> * capabilities = new std::vector<sfl::CryptoSuiteDefinition>(); diff --git a/daemon/test/sdptest.cpp b/daemon/test/sdptest.cpp index fd4eee66c11fed5748326b80230c7e6aea2d8910..046c9a219c3ed11c750723e75524271b981b5e95 100644 --- a/daemon/test/sdptest.cpp +++ b/daemon/test/sdptest.cpp @@ -102,18 +102,18 @@ static const char *sdp_reinvite = "v=0\r\n" void SDPTest::setUp() { - pj_caching_pool_init(&_poolCache, &pj_pool_factory_default_policy, 0); + pj_caching_pool_init(&poolCache_, &pj_pool_factory_default_policy, 0); - _testPool = pj_pool_create(&_poolCache.factory, "sdptest", 4000, 4000, NULL); + testPool_ = pj_pool_create(&poolCache_.factory, "sdptest", 4000, 4000, NULL); - _session = new Sdp(_testPool); + session_ = new Sdp(testPool_); } void SDPTest::tearDown() { - delete _session; - _session = NULL; - pj_pool_release(_testPool); + delete session_; + session_ = NULL; + pj_pool_release(testPool_); } @@ -121,10 +121,10 @@ void SDPTest::testInitialOfferFirstCodec() { std::cout << "------------ SDPTest::testInitialOfferFirstCodec --------------" << std::endl; - CPPUNIT_ASSERT(_session->getLocalPublishedAudioPort() == 0); - CPPUNIT_ASSERT(_session->getRemoteAudioPort() == 0); - CPPUNIT_ASSERT(_session->getLocalIP() == ""); - CPPUNIT_ASSERT(_session->getRemoteIP() == ""); + CPPUNIT_ASSERT(session_->getLocalPublishedAudioPort() == 0); + CPPUNIT_ASSERT(session_->getRemoteAudioPort() == 0); + CPPUNIT_ASSERT(session_->getLocalIP() == ""); + CPPUNIT_ASSERT(session_->getRemoteIP() == ""); CodecOrder codecSelection; pjmedia_sdp_session *remoteAnswer; @@ -133,24 +133,24 @@ void SDPTest::testInitialOfferFirstCodec() codecSelection.push_back(PAYLOAD_CODEC_ALAW); codecSelection.push_back(PAYLOAD_CODEC_G722); - _session->setLocalIP("127.0.0.1"); - _session->setLocalPublishedAudioPort(49567); + session_->setLocalIP("127.0.0.1"); + session_->setLocalPublishedAudioPort(49567); - _session->createOffer(codecSelection); + session_->createOffer(codecSelection); - // pjmedia_sdp_parse(_testPool, test[0].offer_answer[0].sdp2, strlen(test[0].offer_answer[0].sdp2), &remoteAnswer); - pjmedia_sdp_parse(_testPool, (char*)sdp_answer1, strlen(sdp_answer1), &remoteAnswer); + // pjmedia_sdp_parse(testPool_, test[0].offer_answer[0].sdp2, strlen(test[0].offer_answer[0].sdp2), &remoteAnswer); + pjmedia_sdp_parse(testPool_, (char*)sdp_answer1, strlen(sdp_answer1), &remoteAnswer); - _session->receivingAnswerAfterInitialOffer(remoteAnswer); - _session->startNegotiation(); + session_->receivingAnswerAfterInitialOffer(remoteAnswer); + session_->startNegotiation(); - _session->setMediaTransportInfoFromRemoteSdp(); + session_->setMediaTransportInfoFromRemoteSdp(); - CPPUNIT_ASSERT(_session->getLocalPublishedAudioPort() == 49567); - CPPUNIT_ASSERT(_session->getRemoteAudioPort() == 49920); - CPPUNIT_ASSERT(_session->getLocalIP() == "127.0.0.1"); - CPPUNIT_ASSERT(_session->getRemoteIP() == "host.example.com"); - CPPUNIT_ASSERT(_session->getSessionMedia()->getMimeSubtype() == "PCMU"); + CPPUNIT_ASSERT(session_->getLocalPublishedAudioPort() == 49567); + CPPUNIT_ASSERT(session_->getRemoteAudioPort() == 49920); + CPPUNIT_ASSERT(session_->getLocalIP() == "127.0.0.1"); + CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com"); + CPPUNIT_ASSERT(session_->getSessionMedia()->getMimeSubtype() == "PCMU"); } @@ -158,10 +158,10 @@ void SDPTest::testInitialAnswerFirstCodec() { std::cout << "------------ SDPTest::testInitialAnswerFirstCodec -------------" << std::endl; - CPPUNIT_ASSERT(_session->getLocalPublishedAudioPort() == 0); - CPPUNIT_ASSERT(_session->getRemoteAudioPort() == 0); - CPPUNIT_ASSERT(_session->getLocalIP() == ""); - CPPUNIT_ASSERT(_session->getRemoteIP() == ""); + CPPUNIT_ASSERT(session_->getLocalPublishedAudioPort() == 0); + CPPUNIT_ASSERT(session_->getRemoteAudioPort() == 0); + CPPUNIT_ASSERT(session_->getLocalIP() == ""); + CPPUNIT_ASSERT(session_->getRemoteIP() == ""); CodecOrder codecSelection; pjmedia_sdp_session *remoteOffer; @@ -170,22 +170,22 @@ void SDPTest::testInitialAnswerFirstCodec() codecSelection.push_back(PAYLOAD_CODEC_ALAW); codecSelection.push_back(PAYLOAD_CODEC_G722); - pjmedia_sdp_parse(_testPool, (char*)sdp_offer1, strlen(sdp_offer1), &remoteOffer); + pjmedia_sdp_parse(testPool_, (char*)sdp_offer1, strlen(sdp_offer1), &remoteOffer); - _session->setLocalIP("127.0.0.1"); - _session->setLocalPublishedAudioPort(49567); + session_->setLocalIP("127.0.0.1"); + session_->setLocalPublishedAudioPort(49567); - _session->receiveOffer(remoteOffer, codecSelection); + session_->receiveOffer(remoteOffer, codecSelection); - _session->startNegotiation(); + session_->startNegotiation(); - _session->setMediaTransportInfoFromRemoteSdp(); + session_->setMediaTransportInfoFromRemoteSdp(); - CPPUNIT_ASSERT(_session->getLocalPublishedAudioPort() == 49567); - CPPUNIT_ASSERT(_session->getRemoteAudioPort() == 49920); - CPPUNIT_ASSERT(_session->getLocalIP() == "127.0.0.1"); - CPPUNIT_ASSERT(_session->getRemoteIP() == "host.example.com"); - CPPUNIT_ASSERT(_session->getSessionMedia()->getMimeSubtype() == "PCMU"); + CPPUNIT_ASSERT(session_->getLocalPublishedAudioPort() == 49567); + CPPUNIT_ASSERT(session_->getRemoteAudioPort() == 49920); + CPPUNIT_ASSERT(session_->getLocalIP() == "127.0.0.1"); + CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com"); + CPPUNIT_ASSERT(session_->getSessionMedia()->getMimeSubtype() == "PCMU"); } @@ -193,10 +193,10 @@ void SDPTest::testInitialOfferLastCodec() { std::cout << "------------ SDPTest::testInitialOfferLastCodec --------------------" << std::endl; - CPPUNIT_ASSERT(_session->getLocalPublishedAudioPort() == 0); - CPPUNIT_ASSERT(_session->getRemoteAudioPort() == 0); - CPPUNIT_ASSERT(_session->getLocalIP() == ""); - CPPUNIT_ASSERT(_session->getRemoteIP() == ""); + CPPUNIT_ASSERT(session_->getLocalPublishedAudioPort() == 0); + CPPUNIT_ASSERT(session_->getRemoteAudioPort() == 0); + CPPUNIT_ASSERT(session_->getLocalIP() == ""); + CPPUNIT_ASSERT(session_->getRemoteIP() == ""); CodecOrder codecSelection; pjmedia_sdp_session *remoteAnswer; @@ -205,24 +205,24 @@ void SDPTest::testInitialOfferLastCodec() codecSelection.push_back(PAYLOAD_CODEC_ALAW); codecSelection.push_back(PAYLOAD_CODEC_G722); - _session->setLocalIP("127.0.0.1"); - _session->setLocalPublishedAudioPort(49567); + session_->setLocalIP("127.0.0.1"); + session_->setLocalPublishedAudioPort(49567); - _session->createOffer(codecSelection); + session_->createOffer(codecSelection); - // pjmedia_sdp_parse(_testPool, test[0].offer_answer[0].sdp2, strlen(test[0].offer_answer[0].sdp2), &remoteAnswer); - pjmedia_sdp_parse(_testPool, (char*)sdp_answer2, strlen(sdp_answer2), &remoteAnswer); + // pjmedia_sdp_parse(testPool_, test[0].offer_answer[0].sdp2, strlen(test[0].offer_answer[0].sdp2), &remoteAnswer); + pjmedia_sdp_parse(testPool_, (char*)sdp_answer2, strlen(sdp_answer2), &remoteAnswer); - _session->receivingAnswerAfterInitialOffer(remoteAnswer); - _session->startNegotiation(); + session_->receivingAnswerAfterInitialOffer(remoteAnswer); + session_->startNegotiation(); - _session->setMediaTransportInfoFromRemoteSdp(); + session_->setMediaTransportInfoFromRemoteSdp(); - CPPUNIT_ASSERT(_session->getLocalPublishedAudioPort() == 49567); - CPPUNIT_ASSERT(_session->getRemoteAudioPort() == 49920); - CPPUNIT_ASSERT(_session->getLocalIP() == "127.0.0.1"); - CPPUNIT_ASSERT(_session->getRemoteIP() == "host.example.com"); - CPPUNIT_ASSERT(_session->getSessionMedia()->getMimeSubtype() == "G722"); + CPPUNIT_ASSERT(session_->getLocalPublishedAudioPort() == 49567); + CPPUNIT_ASSERT(session_->getRemoteAudioPort() == 49920); + CPPUNIT_ASSERT(session_->getLocalIP() == "127.0.0.1"); + CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com"); + CPPUNIT_ASSERT(session_->getSessionMedia()->getMimeSubtype() == "G722"); } @@ -230,10 +230,10 @@ void SDPTest::testInitialAnswerLastCodec() { std::cout << "------------ SDPTest::testInitialAnswerLastCodec ------------" << std::endl; - CPPUNIT_ASSERT(_session->getLocalPublishedAudioPort() == 0); - CPPUNIT_ASSERT(_session->getRemoteAudioPort() == 0); - CPPUNIT_ASSERT(_session->getLocalIP() == ""); - CPPUNIT_ASSERT(_session->getRemoteIP() == ""); + CPPUNIT_ASSERT(session_->getLocalPublishedAudioPort() == 0); + CPPUNIT_ASSERT(session_->getRemoteAudioPort() == 0); + CPPUNIT_ASSERT(session_->getLocalIP() == ""); + CPPUNIT_ASSERT(session_->getRemoteIP() == ""); CodecOrder codecSelection; pjmedia_sdp_session *remoteOffer; @@ -242,22 +242,22 @@ void SDPTest::testInitialAnswerLastCodec() codecSelection.push_back(PAYLOAD_CODEC_ALAW); codecSelection.push_back(PAYLOAD_CODEC_G722); - pjmedia_sdp_parse(_testPool, (char*)sdp_offer2, strlen(sdp_offer2), &remoteOffer); + pjmedia_sdp_parse(testPool_, (char*)sdp_offer2, strlen(sdp_offer2), &remoteOffer); - _session->setLocalIP("127.0.0.1"); - _session->setLocalPublishedAudioPort(49567); + session_->setLocalIP("127.0.0.1"); + session_->setLocalPublishedAudioPort(49567); - _session->receiveOffer(remoteOffer, codecSelection); + session_->receiveOffer(remoteOffer, codecSelection); - _session->startNegotiation(); + session_->startNegotiation(); - _session->setMediaTransportInfoFromRemoteSdp(); + session_->setMediaTransportInfoFromRemoteSdp(); - CPPUNIT_ASSERT(_session->getLocalPublishedAudioPort() == 49567); - CPPUNIT_ASSERT(_session->getRemoteAudioPort() == 49920); - CPPUNIT_ASSERT(_session->getLocalIP() == "127.0.0.1"); - CPPUNIT_ASSERT(_session->getRemoteIP() == "host.example.com"); - CPPUNIT_ASSERT(_session->getSessionMedia()->getMimeSubtype() == "G722"); + CPPUNIT_ASSERT(session_->getLocalPublishedAudioPort() == 49567); + CPPUNIT_ASSERT(session_->getRemoteAudioPort() == 49920); + CPPUNIT_ASSERT(session_->getLocalIP() == "127.0.0.1"); + CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com"); + CPPUNIT_ASSERT(session_->getSessionMedia()->getMimeSubtype() == "G722"); } @@ -266,10 +266,10 @@ void SDPTest::testReinvite() { std::cout << "------------ SDPTest::testReinvite --------------------" << std::endl; - CPPUNIT_ASSERT(_session->getLocalPublishedAudioPort() == 0); - CPPUNIT_ASSERT(_session->getRemoteAudioPort() == 0); - CPPUNIT_ASSERT(_session->getLocalIP() == ""); - CPPUNIT_ASSERT(_session->getRemoteIP() == ""); + CPPUNIT_ASSERT(session_->getLocalPublishedAudioPort() == 0); + CPPUNIT_ASSERT(session_->getRemoteAudioPort() == 0); + CPPUNIT_ASSERT(session_->getLocalIP() == ""); + CPPUNIT_ASSERT(session_->getRemoteIP() == ""); CodecOrder codecSelection; pjmedia_sdp_session *remoteAnswer; @@ -279,34 +279,33 @@ void SDPTest::testReinvite() codecSelection.push_back(PAYLOAD_CODEC_ALAW); codecSelection.push_back(PAYLOAD_CODEC_G722); - _session->setLocalIP("127.0.0.1"); - _session->setLocalPublishedAudioPort(49567); + session_->setLocalIP("127.0.0.1"); + session_->setLocalPublishedAudioPort(49567); - _session->createOffer(codecSelection); + session_->createOffer(codecSelection); - // pjmedia_sdp_parse(_testPool, test[0].offer_answer[0].sdp2, strlen(test[0].offer_answer[0].sdp2), &remoteAnswer); - pjmedia_sdp_parse(_testPool, (char*)sdp_answer1, strlen(sdp_answer1), &remoteAnswer); + // pjmedia_sdp_parse(testPool_, test[0].offer_answer[0].sdp2, strlen(test[0].offer_answer[0].sdp2), &remoteAnswer); + pjmedia_sdp_parse(testPool_, (char*)sdp_answer1, strlen(sdp_answer1), &remoteAnswer); - _session->receivingAnswerAfterInitialOffer(remoteAnswer); - _session->startNegotiation(); + session_->receivingAnswerAfterInitialOffer(remoteAnswer); + session_->startNegotiation(); - _session->setMediaTransportInfoFromRemoteSdp(); + session_->setMediaTransportInfoFromRemoteSdp(); - CPPUNIT_ASSERT(_session->getLocalPublishedAudioPort() == 49567); - CPPUNIT_ASSERT(_session->getRemoteAudioPort() == 49920); - CPPUNIT_ASSERT(_session->getLocalIP() == "127.0.0.1"); - CPPUNIT_ASSERT(_session->getRemoteIP() == "host.example.com"); - CPPUNIT_ASSERT(_session->getSessionMedia()->getMimeSubtype() == "PCMU"); + CPPUNIT_ASSERT(session_->getLocalPublishedAudioPort() == 49567); + CPPUNIT_ASSERT(session_->getRemoteAudioPort() == 49920); + CPPUNIT_ASSERT(session_->getLocalIP() == "127.0.0.1"); + CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com"); + CPPUNIT_ASSERT(session_->getSessionMedia()->getMimeSubtype() == "PCMU"); - pjmedia_sdp_parse(_testPool, (char*)sdp_reinvite, strlen(sdp_reinvite), &reinviteOffer); + pjmedia_sdp_parse(testPool_, (char*)sdp_reinvite, strlen(sdp_reinvite), &reinviteOffer); - _session->receiveOffer(reinviteOffer, codecSelection); + session_->receiveOffer(reinviteOffer, codecSelection); - _session->startNegotiation(); + session_->startNegotiation(); - _session->setMediaTransportInfoFromRemoteSdp(); - - CPPUNIT_ASSERT(_session->getRemoteAudioPort() == 42445); - CPPUNIT_ASSERT(_session->getRemoteIP() == "host.exampleReinvite.com"); + session_->setMediaTransportInfoFromRemoteSdp(); + CPPUNIT_ASSERT(session_->getRemoteAudioPort() == 42445); + CPPUNIT_ASSERT(session_->getRemoteIP() == "host.exampleReinvite.com"); } diff --git a/daemon/test/sdptest.h b/daemon/test/sdptest.h index d3cc127c8ce6e2da994e33f14d208e5011f3079c..574158c12c1e9cd7254e14d3ebe03249d703cbd7 100644 --- a/daemon/test/sdptest.h +++ b/daemon/test/sdptest.h @@ -116,11 +116,11 @@ class SDPTest : public CppUnit::TestCase { private: - Sdp *_session; + Sdp *session_; - pj_pool_t *_testPool; + pj_pool_t *testPool_; - pj_caching_pool _poolCache; + pj_caching_pool poolCache_; };