From c71c980ccd9f76f6452694b0cdf098d21e4e6449 Mon Sep 17 00:00:00 2001 From: Rajkumar Kanagaraj Date: Tue, 24 Mar 2020 08:14:34 -0700 Subject: [PATCH] Fix the CI build and unit test issue --- .../device/athandler/athandlertest.cpp | 3 - .../framework/device/athandler/unittest.cmake | 1 - .../platform/ATCmdParser/test_ATCmdParser.cpp | 3 - UNITTESTS/stubs/Timer_stub.cpp | 74 ------------------- UNITTESTS/stubs/Timer_stub.h | 25 ------- drivers/Timeout.h | 3 - drivers/source/Timeout.cpp | 2 - rtos/ConditionVariable.h | 1 + 8 files changed, 1 insertion(+), 111 deletions(-) delete mode 100644 UNITTESTS/stubs/Timer_stub.cpp delete mode 100644 UNITTESTS/stubs/Timer_stub.h diff --git a/UNITTESTS/features/cellular/framework/device/athandler/athandlertest.cpp b/UNITTESTS/features/cellular/framework/device/athandler/athandlertest.cpp index 6b8b414262..a48c018c53 100644 --- a/UNITTESTS/features/cellular/framework/device/athandler/athandlertest.cpp +++ b/UNITTESTS/features/cellular/framework/device/athandler/athandlertest.cpp @@ -25,7 +25,6 @@ #include "mbed_poll_stub.h" #include "CellularUtil_stub.h" -#include "Timer_stub.h" using namespace mbed; using namespace events; @@ -228,7 +227,6 @@ TEST_F(TestATHandler, test_ATHandler_process_oob) at.process_oob(); at.clear_error(); - timer_stub_value = 0; filehandle_stub_table_pos = 0; at.read_bytes(buf, 5); @@ -244,7 +242,6 @@ TEST_F(TestATHandler, test_ATHandler_process_oob) filehandle_stub_table = table2; at.clear_error(); - timer_stub_value = 0; filehandle_stub_table_pos = 0; mbed_poll_stub::revents_value = POLLIN; mbed_poll_stub::int_value = 1; diff --git a/UNITTESTS/features/cellular/framework/device/athandler/unittest.cmake b/UNITTESTS/features/cellular/framework/device/athandler/unittest.cmake index 060b14a1db..26c8058259 100644 --- a/UNITTESTS/features/cellular/framework/device/athandler/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/device/athandler/unittest.cmake @@ -28,7 +28,6 @@ set(unittest-test-sources stubs/SerialBase_stub.cpp stubs/mbed_assert_stub.cpp stubs/mbed_poll_stub.cpp - stubs/Timer_stub.cpp stubs/equeue_stub.c stubs/Kernel_stub.cpp stubs/ThisThread_stub.cpp diff --git a/UNITTESTS/platform/ATCmdParser/test_ATCmdParser.cpp b/UNITTESTS/platform/ATCmdParser/test_ATCmdParser.cpp index 535aa191df..dbe81c549f 100644 --- a/UNITTESTS/platform/ATCmdParser/test_ATCmdParser.cpp +++ b/UNITTESTS/platform/ATCmdParser/test_ATCmdParser.cpp @@ -23,7 +23,6 @@ #include #include "FileHandle_stub.h" #include "mbed_poll_stub.h" -#include "Timer_stub.h" using namespace mbed; @@ -110,7 +109,6 @@ TEST_F(test_ATCmdParser, test_ATCmdParser_process_oob) at.process_oob(); expected_oob_callback = false; - timer_stub_value = 0; filehandle_stub_table_pos = 0; at.read(buf, 5); @@ -127,7 +125,6 @@ TEST_F(test_ATCmdParser, test_ATCmdParser_process_oob) table2[4] = 0; filehandle_stub_table = table2; - timer_stub_value = 0; filehandle_stub_table_pos = 0; mbed_poll_stub::revents_value = POLLIN; mbed_poll_stub::int_value = 1; diff --git a/UNITTESTS/stubs/Timer_stub.cpp b/UNITTESTS/stubs/Timer_stub.cpp deleted file mode 100644 index 2e20c161ae..0000000000 --- a/UNITTESTS/stubs/Timer_stub.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) , 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. - */ - -#include "Timer.h" -#include "Timer_stub.h" - -namespace mbed { - -Timer::Timer() -{ -} - -Timer::Timer(const ticker_data_t *data) -{ -} - -Timer::~Timer() -{ -} - -void Timer::start() -{ -} - -void Timer::stop() -{ - ; -} - -int Timer::read_us() -{ - return 0; -} - -float Timer::read() -{ - return 0; -} - -int Timer::read_ms() -{ - timer_stub_value += timer_stub_step; - return timer_stub_value; -} - -us_timestamp_t Timer::read_high_resolution_us() -{ - return 0; -} - -void Timer::reset() -{ -} - -Timer::operator float() -{ - return 0; -} - -} // namespace mbed diff --git a/UNITTESTS/stubs/Timer_stub.h b/UNITTESTS/stubs/Timer_stub.h deleted file mode 100644 index a97333fe63..0000000000 --- a/UNITTESTS/stubs/Timer_stub.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) , 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 TIMER_STUB_H -#define TIMER_STUB_H - - -static uint16_t timer_stub_value = 0; -static uint16_t timer_stub_step = 20; - -#endif diff --git a/drivers/Timeout.h b/drivers/Timeout.h index 52a46de21e..da703e9352 100644 --- a/drivers/Timeout.h +++ b/drivers/Timeout.h @@ -97,9 +97,6 @@ public: /** Clock to use with attach_absolute, guaranteeing running only while attached or manually locked */ using clock = HighResClock; - /** Clock to use with attach_absolute, running always */ - using steady_clock = SteadyHighResClock; - /** @copydoc TimeoutBase::scheduled_time() */ HighResClock::time_point scheduled_time() const { diff --git a/drivers/source/Timeout.cpp b/drivers/source/Timeout.cpp index d890e0ef67..daed37e6ea 100644 --- a/drivers/source/Timeout.cpp +++ b/drivers/source/Timeout.cpp @@ -44,9 +44,7 @@ Timeout::Timeout() : TimeoutBase(get_us_ticker_data(), true) * (In C++17 could avoid the need for this by making the members inline). */ const bool HighResClock::is_steady; -const bool SteadyHighResClock::is_steady; const bool LowPowerClock::is_steady; -mstd::once_flag SteadyHighResClock::init; const bool RealTimeClock::is_steady; #if DEVICE_LPTICKER diff --git a/rtos/ConditionVariable.h b/rtos/ConditionVariable.h index cb6e56bbc8..d602d7c309 100644 --- a/rtos/ConditionVariable.h +++ b/rtos/ConditionVariable.h @@ -28,6 +28,7 @@ #include "rtos/mbed_rtos_types.h" #include "rtos/Mutex.h" #include "rtos/Semaphore.h" +#include "rtos/Kernel.h" #include "platform/NonCopyable.h"