From f6ce308ef9b8a97aab9b353bcb826f72537227a4 Mon Sep 17 00:00:00 2001 From: "hyunuk.tak" Date: Mon, 21 Mar 2022 12:22:33 +0900 Subject: [PATCH] Remove unnecessary mock code for socket Change-Id: I561e26409c4d8475911fc1d8301c68a711eea6b4 Signed-off-by: hyunuk.tak --- tests/unittest/mocks/thread-mock-socket.cpp | 13 ------------- tests/unittest/mocks/thread-mock-socket.h | 29 ----------------------------- tests/unittest/thread-unittest-init.cpp | 1 - 3 files changed, 43 deletions(-) delete mode 100644 tests/unittest/mocks/thread-mock-socket.h diff --git a/tests/unittest/mocks/thread-mock-socket.cpp b/tests/unittest/mocks/thread-mock-socket.cpp index 27fc5da..4cd99ff 100644 --- a/tests/unittest/mocks/thread-mock-socket.cpp +++ b/tests/unittest/mocks/thread-mock-socket.cpp @@ -21,19 +21,6 @@ extern "C" { #endif -// static bool __thread_mock_socket = false; -// extern int __real_socket(int domain, int type, int protocol); - -// void thread_mock_set_socket(bool flag) -// { -// __thread_mock_socket = flag; -// } - -// int __wrap_socket(int domain, int type, int protocol) -// { -// return __thread_mock_socket ? 1 : __real_socket(domain, type, protocol); -// } - int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) { return 0; diff --git a/tests/unittest/mocks/thread-mock-socket.h b/tests/unittest/mocks/thread-mock-socket.h deleted file mode 100644 index 6705f62..0000000 --- a/tests/unittest/mocks/thread-mock-socket.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -void thread_mock_set_socket(bool flag); - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/tests/unittest/thread-unittest-init.cpp b/tests/unittest/thread-unittest-init.cpp index 7c5aed7..97afd45 100644 --- a/tests/unittest/thread-unittest-init.cpp +++ b/tests/unittest/thread-unittest-init.cpp @@ -17,7 +17,6 @@ #include #include "thread.h" -#include "mocks/thread-mock-socket.h" class ThreadInitTest : public ::testing::Test { -- 2.7.4