From 71962481a454835403ace93dd8156949f084246d Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Fri, 16 Jul 2021 13:56:41 +0100 Subject: [PATCH] Unit tests: Remove mbed.h stub from target_h The header `mbed.h` is a convenient wrapper that pre-includes some platform headers, for use by user applications. Libraries and tests internal to Mbed OS should not use it, and they should explicitly include headers they need. So a stub is not needed. --- UNITTESTS/target_h/mbed.h | 34 ------------------- .../UNITTESTS/doubles/NetworkStack_stub.cpp | 1 - events/tests/UNITTESTS/equeue/test_equeue.cpp | 2 +- 3 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 UNITTESTS/target_h/mbed.h diff --git a/UNITTESTS/target_h/mbed.h b/UNITTESTS/target_h/mbed.h deleted file mode 100644 index 276aebc58b..0000000000 --- a/UNITTESTS/target_h/mbed.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * 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. - */ - -#ifndef MBED_H -#define MBED_H - -#include -#include - -#include "events/mbed_events.h" -#include "events/mbed_shared_queues.h" - -namespace mbed { -#include "platform/Callback.h" -}; - -using namespace mbed; -using namespace std; - -#endif // MBED_H diff --git a/connectivity/netsocket/tests/UNITTESTS/doubles/NetworkStack_stub.cpp b/connectivity/netsocket/tests/UNITTESTS/doubles/NetworkStack_stub.cpp index 7d6331a4d9..877bfc7db7 100644 --- a/connectivity/netsocket/tests/UNITTESTS/doubles/NetworkStack_stub.cpp +++ b/connectivity/netsocket/tests/UNITTESTS/doubles/NetworkStack_stub.cpp @@ -17,7 +17,6 @@ #include "netsocket/NetworkStack.h" #include "netsocket/nsapi_dns.h" -#include "mbed.h" #include "stddef.h" #include diff --git a/events/tests/UNITTESTS/equeue/test_equeue.cpp b/events/tests/UNITTESTS/equeue/test_equeue.cpp index ae017cb014..c99c31a2e2 100644 --- a/events/tests/UNITTESTS/equeue/test_equeue.cpp +++ b/events/tests/UNITTESTS/equeue/test_equeue.cpp @@ -16,7 +16,7 @@ */ #include "gtest/gtest.h" #include "events/equeue.h" -#include "mbed.h" +#include "platform/Callback.h" #include #include