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.
pull/10657/head
Steve Cartmell 2018-10-29 17:00:40 +00:00 committed by Filip Jagodzinski
parent 5fc77d3c4a
commit b06e30ed35
3 changed files with 17 additions and 8 deletions

View File

@ -18,13 +18,16 @@
#endif
#define __STDC_LIMIT_MACROS
#include <stdint.h>
#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 <stdint.h>
#include <stdlib.h>
/* 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;

View File

@ -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 <stdlib.h>
/* 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

View File

@ -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"