Added Gtest for smartcard-service
[platform/core/connectivity/smartcard-service.git] / server / ClientInstance.cpp
index 04f668f..2606405 100644 (file)
 
 namespace smartcard_service_api
 {
-       void ClientInstance::setPID(int pid)
-       {
-               this->pid = pid;
-       }
-
        ServiceInstance *ClientInstance::createService()
        {
                ServiceInstance *result = NULL;
 
                result = new ServiceInstance(this);
-               if (result != NULL)
-               {
+               if (result != NULL) {
                        mapServices.insert(make_pair(result->getHandle(), result));
-               }
-               else
-               {
-                       _ERR("alloc failed");
+               } else {
+                       _ERR("alloc failed"); //LCOV_EXCL_LINE
                }
 
                return result;
@@ -51,6 +43,7 @@ namespace smartcard_service_api
 
        ServiceInstance *ClientInstance::getService(unsigned int handle)
        {
+               /* LCOV_EXCL_START */
                ServiceInstance *result = NULL;
                map<unsigned int, ServiceInstance *>::iterator item;
 
@@ -60,10 +53,12 @@ namespace smartcard_service_api
                }
 
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        void ClientInstance::removeService(unsigned int handle)
        {
+               /* LCOV_EXCL_START */
                map<unsigned int, ServiceInstance *>::iterator item;
 
                if ((item = mapServices.find(handle)) != mapServices.end())
@@ -71,6 +66,7 @@ namespace smartcard_service_api
                        delete item->second;
                        mapServices.erase(item);
                }
+               /* LCOV_EXCL_STOP */
        }
 
        void ClientInstance::removeServices()
@@ -85,22 +81,6 @@ namespace smartcard_service_api
                mapServices.clear();
        }
 
-#ifndef USE_GDBUS
-       bool ClientInstance::sendMessageToAllServices(int socket, const Message &msg)
-       {
-               bool result = true;
-               map<unsigned int, ServiceInstance *>::const_iterator item;
-
-               for (item = mapServices.begin(); item != mapServices.end(); item++)
-               {
-                       if (ServerIPC::getInstance()->sendMessage(socket, msg) == false)
-                               result = false;
-               }
-
-               return result;
-       }
-#endif
-
        void ClientInstance::generateCertificationHashes()
        {
                SignatureHelper::getCertificationHashes(getPID(), certHashes);