Document API IEC60730 Library
Functions

Header file list of test cases for the verification operate functions in watchdog module. More...

Functions

void unit_test_iec60730_watchdog_set_up (void)
 
bool unit_test_iec60730_watchdog_mock_rst_por (void)
 
bool unit_test_iec60730_watchdog_mock_rst_em4 (void)
 
bool unit_test_iec60730_watchdog_mock_rst_wdog0 (void)
 
bool unit_test_iec60730_watchdog_mock_rst_wdog1 (void)
 
bool unit_test_iec60730_watchdog_mock_set_watchdog_timout_min (void)
 
void unit_test_iec60730_watchdog_mock_rstcause_clear (void)
 
uint32_t unit_test_iec60730_watchdog_mock_rstcause (void)
 
void test_sl_iec60730_watchdog_post_reset_causes_not_por_and_watchdog (void)
 
void test_sl_iec60730_watchdog_post_wachdog_reset_before_por (void)
 
void test_sl_iec60730_watchdog_post_set_watchdog_timout_min_success (void)
 
void test_sl_iec60730_watchdog_post_set_watchdog_timout_min_fail (void)
 
void test_sl_iec60730_watchdog_post_reset_resason_no_valid (void)
 
void test_sl_iec60730_watchdog_post_prevent_unexpected_changed_value (void)
 

Detailed Description

Header file list of test cases for the verification operate functions in watchdog module.

IEC60730 Watchdog Unit Tests

These test cases run unit tests to check the operation of the functions in watchdog module.

Hardware setup:

Function Documentation

◆ test_sl_iec60730_watchdog_post_prevent_unexpected_changed_value()

void test_sl_iec60730_watchdog_post_prevent_unexpected_changed_value ( void  )

Public Check sl_iec60730_watchdog_post() operate

Returns
None.

Check the function sl_iec60730_watchdog_post() operation when checking condition to prevent unexpected changed value when reset or return from power saving mode. If iec60730_watchdog_count value >= SL_IEC60730_WDOGINST_NUMB after device power on reset, the function sl_iec60730_watchdog_post() return result is SL_IEC60730_TEST_FAILED

◆ test_sl_iec60730_watchdog_post_reset_causes_not_por_and_watchdog()

void test_sl_iec60730_watchdog_post_reset_causes_not_por_and_watchdog ( void  )

Public Check sl_iec60730_watchdog_post() operate

Returns
None.

If reset causes are not POR and not watchdog reset then no action. Value return by function sl_iec60730_watchdog_post() is SL_IEC60730_TEST_PASSED.

◆ test_sl_iec60730_watchdog_post_reset_resason_no_valid()

void test_sl_iec60730_watchdog_post_reset_resason_no_valid ( void  )

Public Check sl_iec60730_watchdog_post() operate

Returns
None.

When the device is reset by power on reset first set the variable iec60730_watchdog_state to the value SL_IEC60730_WATCHDOG_TESTING, then check the watchdog reset. If sli_iec60730_set_watchdog_timout_min() is set successfully, and the device does not wake up from EM4, all Watchdogs are tested then finished. The cause of the reset is not by watchdog, the function sl_iec60730_watchdog_post() return result is SL_IEC60730_TEST_PASSED

◆ test_sl_iec60730_watchdog_post_set_watchdog_timout_min_fail()

void test_sl_iec60730_watchdog_post_set_watchdog_timout_min_fail ( void  )

Public Check sl_iec60730_watchdog_post() operate

Returns
None.

When the device is reset by power on reset first set the variable iec60730_watchdog_state to the value SL_IEC60730_WATCHDOG_TESTING, then check the watchdog reset. If sli_iec60730_set_watchdog_timout_min() is failed, then after call sl_iec60730_watchdog_post() again, return result is SL_IEC60730_TEST_FAILED

◆ test_sl_iec60730_watchdog_post_set_watchdog_timout_min_success()

void test_sl_iec60730_watchdog_post_set_watchdog_timout_min_success ( void  )

Public Check sl_iec60730_watchdog_post() operate

Returns
None.

When the device is reset by power on reset first set the variable iec60730_watchdog_state to the value SL_IEC60730_WATCHDOG_TESTING, then check the watchdog reset. If sli_iec60730_set_watchdog_timout_min() is set successfully, and the device does not wake up from EM4, all Watchdogs are tested then finished. The cause of the reset is by watchdog, the function sl_iec60730_watchdog_post() return result is SL_IEC60730_TEST_PASSED

◆ test_sl_iec60730_watchdog_post_wachdog_reset_before_por()

void test_sl_iec60730_watchdog_post_wachdog_reset_before_por ( void  )

Public Check sl_iec60730_watchdog_post() operate

Returns
None.

When the device is reset by power on reset after watchdog reset, the variable iec60730_watchdog_state does not set to the value SL_IEC60730_WATCHDOG_TESTING, then check return value is SL_IEC60730_TEST_FAILED

◆ unit_test_iec60730_watchdog_mock_rst_em4()

bool unit_test_iec60730_watchdog_mock_rst_em4 ( void  )

Public Function replaces the value for the device being reset by EM4 Wakeup. Only used for unit testing.

Returns
boolean.

◆ unit_test_iec60730_watchdog_mock_rst_por()

bool unit_test_iec60730_watchdog_mock_rst_por ( void  )

Public Function replaces the value for the device being reset by Power On Reset. Only used for unit testing.

Returns
boolean.

◆ unit_test_iec60730_watchdog_mock_rst_wdog0()

bool unit_test_iec60730_watchdog_mock_rst_wdog0 ( void  )

Public Function replaces the value for the device being reset by Watchdog 0. Only used for unit testing.

Returns
boolean.

◆ unit_test_iec60730_watchdog_mock_rst_wdog1()

bool unit_test_iec60730_watchdog_mock_rst_wdog1 ( void  )

Public Function replaces the value for the device being reset by Watchdog 1. Only used for unit testing.

Returns
boolean.

◆ unit_test_iec60730_watchdog_mock_rstcause()

uint32_t unit_test_iec60730_watchdog_mock_rstcause ( void  )

Public The function replaces the value of the RSTCAUSE register indicating the cause of the reset. Only used for unit testing

Returns
Value RSTCAUSE register.

◆ unit_test_iec60730_watchdog_mock_rstcause_clear()

void unit_test_iec60730_watchdog_mock_rstcause_clear ( void  )

Public Function replaces watchdog clear register rstcause. Only used for unit testing.

Returns
None.

◆ unit_test_iec60730_watchdog_mock_set_watchdog_timout_min()

bool unit_test_iec60730_watchdog_mock_set_watchdog_timout_min ( void  )

Public Function replaces watchdog timeout min set value successfully or not. Only used for unit testing.

Returns
boolean.

◆ unit_test_iec60730_watchdog_set_up()

void unit_test_iec60730_watchdog_set_up ( void  )

Public Function setup condition before running test case. Only used for unit testing.

Returns
None.