mirror of https://github.com/ARMmbed/mbed-os.git
Fix more unittest errors
parent
ff0652830a
commit
cc7a3dd677
|
@ -16,37 +16,51 @@
|
||||||
*/
|
*/
|
||||||
#ifdef DEVICE_WATCHDOG
|
#ifdef DEVICE_WATCHDOG
|
||||||
|
|
||||||
#include "VirtualWatchdog.h"
|
#include "Watchdog.h"
|
||||||
|
|
||||||
namespace mbed {
|
namespace mbed {
|
||||||
|
|
||||||
VirtualWatchdog *VirtualWatchdog::_first;
|
static uint32_t _timeout = 0;
|
||||||
|
|
||||||
VirtualWatchdog::VirtualWatchdog(uint32_t timeout, const char *const str): _name(str)
|
Watchdog::Watchdog() : _running(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VirtualWatchdog::start()
|
Watchdog::~Watchdog()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VirtualWatchdog::kick()
|
bool Watchdog::start(uint32_t timeout)
|
||||||
{
|
{
|
||||||
|
_timeout = timeout;
|
||||||
|
_running = true;
|
||||||
|
return _running;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VirtualWatchdog::stop()
|
bool Watchdog::stop()
|
||||||
{
|
{
|
||||||
|
_running = false;
|
||||||
|
return _running;
|
||||||
}
|
}
|
||||||
|
|
||||||
VirtualWatchdog::~VirtualWatchdog()
|
void Watchdog::kick()
|
||||||
{
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Watchdog::is_running() const
|
||||||
|
{
|
||||||
|
return _running;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t Watchdog::get_timeout() const
|
||||||
|
{
|
||||||
|
return _timeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t Watchdog::get_max_timeout() const
|
||||||
|
{
|
||||||
|
return 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace mbed
|
} // namespace mbed
|
||||||
|
|
||||||
#endif // DEVICE_WATCHDOG
|
#endif // DEVICE_WATCHDOG
|
|
@ -16,7 +16,7 @@
|
||||||
*/
|
*/
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "gmock/gmock.h"
|
#include "gmock/gmock.h"
|
||||||
#include "drivers/VirtualWatchdog.h"
|
#include "VirtualWatchdog.h"
|
||||||
|
|
||||||
class TestVirtualWatchdog : public testing::Test {
|
class TestVirtualWatchdog : public testing::Test {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -13,12 +13,12 @@ set(unittest-includes ${unittest-includes}
|
||||||
# Source files
|
# Source files
|
||||||
set(unittest-sources
|
set(unittest-sources
|
||||||
../drivers/VirtualWatchdog.cpp
|
../drivers/VirtualWatchdog.cpp
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Test files
|
# Test files
|
||||||
set(unittest-test-sources
|
set(unittest-test-sources
|
||||||
drivers/VirtualWatchdog/test_virtualwatchdog.cpp
|
drivers/VirtualWatchdog/test_virtualwatchdog.cpp
|
||||||
|
drivers/VirtualWatchdog/Watchdog.cpp
|
||||||
stubs/mbed_critical_stub.c
|
stubs/mbed_critical_stub.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,14 @@ set(unittest-includes ${unittest-includes}
|
||||||
# Source files
|
# Source files
|
||||||
set(unittest-sources
|
set(unittest-sources
|
||||||
../drivers/Watchdog.cpp
|
../drivers/Watchdog.cpp
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Test files
|
# Test files
|
||||||
set(unittest-test-sources
|
set(unittest-test-sources
|
||||||
drivers/Watchdog/test_watchdog.cpp
|
drivers/Watchdog/test_watchdog.cpp
|
||||||
stubs/mbed_critical_stub.c
|
stubs/mbed_critical_stub.c
|
||||||
|
stubs/mbed_assert_stub.c
|
||||||
|
stubs/watchdog_api_stub.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# defines
|
# defines
|
||||||
|
|
|
@ -26,7 +26,12 @@
|
||||||
#include "platform/mbed_power_mgmt.h"
|
#include "platform/mbed_power_mgmt.h"
|
||||||
#include "platform/mbed_assert.h"
|
#include "platform/mbed_assert.h"
|
||||||
#include "platform/SingletonPtr.h"
|
#include "platform/SingletonPtr.h"
|
||||||
|
|
||||||
|
#if DEVICE_LPTICKER
|
||||||
#include "drivers/LowPowerTicker.h"
|
#include "drivers/LowPowerTicker.h"
|
||||||
|
#else
|
||||||
|
#include "drivers/Ticker.h"
|
||||||
|
#endif
|
||||||
namespace mbed {
|
namespace mbed {
|
||||||
|
|
||||||
/** \addtogroup drivers */
|
/** \addtogroup drivers */
|
||||||
|
|
Loading…
Reference in New Issue