Skip to content

Commit

Permalink
Merged testing
Browse files Browse the repository at this point in the history
  • Loading branch information
hfedcba committed Jul 30, 2019
2 parents 6bbeeb7 + 4313cd7 commit 1f5e234
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 356 deletions.
3 changes: 2 additions & 1 deletion getVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
dir=`mktemp -d`
cat > "$dir/libhomegear-base-version.cpp" <<-'EOF'
#include "homegear-base/BaseLib.h"
#include <iostream>
int main(int argc, char** argv)
{
std::cout << BaseLib::SharedObjects::version() << std::endl;
return 0;
}
EOF
g++ -std=c++11 -o $dir/libhomegear-base-version $dir/libhomegear-base-version.cpp -lhomegear-base -lgcrypt -lgnutls
g++ -std=c++11 -o $dir/libhomegear-base-version $dir/libhomegear-base-version.cpp -lhomegear-base -lgcrypt -lgnutls -lpthread -latomic
chmod 755 $dir/libhomegear-base-version
$dir/libhomegear-base-version
rm -Rf $dir
8 changes: 0 additions & 8 deletions src/Interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ void Interfaces::create()
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
}

}
8 changes: 0 additions & 8 deletions src/IpCam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,6 @@ PVariable IpCam::getPairingInfo()
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
return Variable::createError(-32500, "Unknown application error.");
}
}
148 changes: 2 additions & 146 deletions src/IpCamCentral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "IpCamCentral.h"
#include "GD.h"

#include <iomanip>

namespace IpCam {

IpCamCentral::IpCamCentral(ICentralEventSink* eventHandler) : BaseLib::Systems::ICentral(IPCAM_FAMILY_ID, GD::bl, eventHandler)
Expand Down Expand Up @@ -61,14 +63,6 @@ void IpCamCentral::dispose(bool wait)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
}

void IpCamCentral::init()
Expand All @@ -86,14 +80,6 @@ void IpCamCentral::init()
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
}

void IpCamCentral::worker()
Expand Down Expand Up @@ -144,30 +130,12 @@ void IpCamCentral::worker()
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
}
}
catch(const std::exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
}

void IpCamCentral::loadPeers()
Expand All @@ -193,16 +161,6 @@ void IpCamCentral::loadPeers()
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
_peersMutex.unlock();
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
_peersMutex.unlock();
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
_peersMutex.unlock();
}
}

std::shared_ptr<IpCamPeer> IpCamCentral::getPeer(uint64_t id)
Expand All @@ -221,14 +179,6 @@ std::shared_ptr<IpCamPeer> IpCamCentral::getPeer(uint64_t id)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
_peersMutex.unlock();
return std::shared_ptr<IpCamPeer>();
}
Expand All @@ -249,14 +199,6 @@ std::shared_ptr<IpCamPeer> IpCamCentral::getPeer(std::string serialNumber)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
_peersMutex.unlock();
return std::shared_ptr<IpCamPeer>();
}
Expand All @@ -278,14 +220,6 @@ void IpCamCentral::savePeers(bool full)
catch(const std::exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
_peersMutex.unlock();
}
Expand Down Expand Up @@ -337,14 +271,6 @@ void IpCamCentral::deletePeer(uint64_t id)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
}

std::string IpCamCentral::handleCliCommand(std::string command)
Expand Down Expand Up @@ -424,16 +350,6 @@ std::string IpCamCentral::handleCliCommand(std::string command)
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}

PVariable deviceDescriptions(new Variable(VariableType::tArray));
deviceDescriptions->arrayValue = peer->getDeviceDescriptions(nullptr, true, std::map<std::string, bool>());
Expand Down Expand Up @@ -628,16 +544,6 @@ std::string IpCamCentral::handleCliCommand(std::string command)
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
}
else if(command.compare(0, 13, "peers setname") == 0 || command.compare(0, 2, "pn") == 0)
{
Expand Down Expand Up @@ -693,14 +599,6 @@ std::string IpCamCentral::handleCliCommand(std::string command)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
return "Error executing command. See log file for more details.\n";
}

Expand All @@ -720,14 +618,6 @@ std::shared_ptr<IpCamPeer> IpCamCentral::createPeer(uint32_t deviceType, std::st
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
return std::shared_ptr<IpCamPeer>();
}

Expand Down Expand Up @@ -757,16 +647,6 @@ PVariable IpCamCentral::createDevice(BaseLib::PRpcClientInfo clientInfo, int32_t
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
_peersMutex.unlock();
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}

PVariable deviceDescriptions(new Variable(VariableType::tArray));
deviceDescriptions->arrayValue = peer->getDeviceDescriptions(clientInfo, true, std::map<std::string, bool>());
Expand All @@ -780,14 +660,6 @@ PVariable IpCamCentral::createDevice(BaseLib::PRpcClientInfo clientInfo, int32_t
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
return Variable::createError(-32500, "Unknown application error.");
}

Expand All @@ -811,14 +683,6 @@ PVariable IpCamCentral::deleteDevice(BaseLib::PRpcClientInfo clientInfo, std::st
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
return Variable::createError(-32500, "Unknown application error.");
}

Expand All @@ -843,14 +707,6 @@ PVariable IpCamCentral::deleteDevice(BaseLib::PRpcClientInfo clientInfo, uint64_
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
return Variable::createError(-32500, "Unknown application error.");
}

Expand Down
8 changes: 0 additions & 8 deletions src/IpCamPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ void IpCamPacket::getHttpRequest(std::string& request)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(BaseLib::Exception& ex)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
}
catch(...)
{
GD::out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
}
}

}
Loading

0 comments on commit 1f5e234

Please sign in to comment.