Move test framework from wrt-commons to security-tests
[platform/core/test/security-tests.git] / tests / security-server-tests / security_server_measurer_API_speed.cpp
index c95c5a0..db42e3a 100644 (file)
@@ -29,7 +29,6 @@
  */
 
 #include <dpl/log/log.h>
-#include <dpl/serialization.h>
 #include <dpl/singleton.h>
 #include <dpl/singleton_safe_impl.h>
 #include <dpl/test/test_runner.h>
@@ -48,7 +47,7 @@
 #include <sys/time.h>
 #include <sys/un.h>
 #include <unistd.h>
-#include <memory>
+#include <memory.h>
 #include "security_server_mockup.h"
 #include <summary_collector.h>
 #include <smack_access.h>
@@ -253,12 +252,6 @@ void finish_stats(readwrite_stats *stats, const char* function_name) {
         LogDebug("No function call succeeded\n");
 }
 
-void closesockfdptr(int* sockfd_ptr)
-{
-    close(*sockfd_ptr);
-}
-typedef std::unique_ptr<int, std::function<void(int*)> > SockFDUniquePtr;
-
 /*TEST CASES*/
 RUNNER_TEST_GROUP_INIT(SECURITY_SERVER_API_SPEED_MEASURER)
 
@@ -492,7 +485,7 @@ void testSecurityServerCheckPrivilegeBySockfd(bool smack) {
         int sockfd = create_new_socket();
         RUNNER_ASSERT_MSG_BT(sockfd >= 0, "create_new_socket() failed");
 
-        SockFDUniquePtr sockfd_ptr(&sockfd, closesockfdptr);
+        SockUniquePtr sockfd_ptr(&sockfd);
 
         if (smack)
             RUNNER_ASSERT_MSG_BT(0 == smack_set_label_for_self(subject_label), "child label " << subject_label << " not set");
@@ -513,7 +506,7 @@ void testSecurityServerCheckPrivilegeBySockfd(bool smack) {
         int sockfd = connect_to_testserver();
         RUNNER_ASSERT_MSG_BT(sockfd >= 0, "connect_to_testserver() failed");
 
-        SockFDUniquePtr sockfd_ptr(&sockfd, closesockfdptr);
+        SockUniquePtr sockfd_ptr(&sockfd);
 
         for (int i = 1; i <= NUMBER_OF_CALLS; i++) {
             start_stats_update(&stats);