From b06e30ed3595e9c0a344239da65baf12b2556a3d Mon Sep 17 00:00:00 2001 From: Steve Cartmell Date: Mon, 29 Oct 2018 17:00:40 +0000 Subject: [PATCH] test(api-watchdog): Fix errors in compiling watchdog greentea tests The latest rebase of the watchdog feature branch introduced errors in compiling watchdog tests due to missing headers. - Watchdog HAL API test Include missing header files to main.cpp (mbed_wait_api.h, stdlib.h). - Watchdog HAL API timing test Include missing header files to main.cpp (us_ticker_api.h). - Watchdog Driver API test Include missing header files to main.cpp (mbed_wait_api.h, stdlib.h). Inject mbed namespace into main.cpp to fix Watchdog name resolution. --- TESTS/mbed_drivers/watchdog/main.cpp | 13 +++++++++---- TESTS/mbed_hal/watchdog/main.cpp | 7 +++++-- TESTS/mbed_hal/watchdog_timing/main.cpp | 5 +++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/TESTS/mbed_drivers/watchdog/main.cpp b/TESTS/mbed_drivers/watchdog/main.cpp index 386593e172..a54ac66974 100644 --- a/TESTS/mbed_drivers/watchdog/main.cpp +++ b/TESTS/mbed_drivers/watchdog/main.cpp @@ -18,13 +18,16 @@ #endif #define __STDC_LIMIT_MACROS -#include -#include "greentea-client/test_env.h" -#include "utest/utest.h" -#include "unity/unity.h" #include "drivers/Watchdog.h" +#include "greentea-client/test_env.h" +#include "mbed_wait_api.h" +#include "unity/unity.h" +#include "utest/utest.h" #include "Watchdog_tests.h" +#include +#include + /* This is platform specific and depends on the watchdog timer implementation, * e.g. STM32F4 uses 32kHz internal RC oscillator to clock the IWDG, so * when the prescaler divider is set to max value of 256 the resolution @@ -50,6 +53,8 @@ using utest::v1::Case; using utest::v1::Specification; using utest::v1::Harness; +using namespace mbed; + void test_max_timeout_is_valid() { Watchdog watchdog; diff --git a/TESTS/mbed_hal/watchdog/main.cpp b/TESTS/mbed_hal/watchdog/main.cpp index a4434ab223..611da95280 100644 --- a/TESTS/mbed_hal/watchdog/main.cpp +++ b/TESTS/mbed_hal/watchdog/main.cpp @@ -18,11 +18,14 @@ #endif #include "greentea-client/test_env.h" -#include "utest/utest.h" -#include "unity/unity.h" #include "hal/watchdog_api.h" +#include "mbed_wait_api.h" +#include "unity/unity.h" +#include "utest/utest.h" #include "watchdog_api_tests.h" +#include + /* This is platform specific and depends on the watchdog timer implementation, * e.g. STM32F4 uses 32kHz internal RC oscillator to clock the IWDG, so * when the prescaler divider is set to max value of 256 the resolution diff --git a/TESTS/mbed_hal/watchdog_timing/main.cpp b/TESTS/mbed_hal/watchdog_timing/main.cpp index 38711e7609..a20312423c 100644 --- a/TESTS/mbed_hal/watchdog_timing/main.cpp +++ b/TESTS/mbed_hal/watchdog_timing/main.cpp @@ -18,9 +18,10 @@ #endif #include "greentea-client/test_env.h" -#include "utest/utest.h" -#include "unity/unity.h" #include "hal/watchdog_api.h" +#include "unity/unity.h" +#include "us_ticker_api.h" +#include "utest/utest.h" #include "watchdog_timing_tests.h" #define MSG_VALUE_DUMMY "0"