diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-22 11:10:43 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-22 16:57:26 +0200 |
commit | 0eae7ba9ba8c6c60e0718e364a37081b290cc457 (patch) | |
tree | c5e6b40eaaeb4bb3a358c36ce2be6845b1528cd9 /testsuites/sptests/spwatchdog | |
parent | score: Create watchdog implementation header (diff) | |
download | rtems-0eae7ba9ba8c6c60e0718e364a37081b290cc457.tar.bz2 |
score: Add WATCHDOG_INITIALIZER()
Diffstat (limited to 'testsuites/sptests/spwatchdog')
-rw-r--r-- | testsuites/sptests/spwatchdog/init.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuites/sptests/spwatchdog/init.c b/testsuites/sptests/spwatchdog/init.c index a7a332a26c..6dae9e411a 100644 --- a/testsuites/sptests/spwatchdog/init.c +++ b/testsuites/sptests/spwatchdog/init.c @@ -24,6 +24,27 @@ #include <rtems/score/watchdogimpl.h> +static void test_watchdog_routine( Objects_Id id, void *arg ) +{ + (void) id; + (void) arg; + + rtems_test_assert( 0 ); +} + +static void test_watchdog_static_init( void ) +{ + Objects_Id id = 0x12345678; + void *arg = (void *) 0xdeadbeef; + Watchdog_Control a = WATCHDOG_INITIALIZER( test_watchdog_routine, id, arg ); + Watchdog_Control b; + + memset( &b, 0, sizeof( b ) ); + _Watchdog_Initialize( &b, test_watchdog_routine, id, arg ); + + rtems_test_assert( memcmp( &a, &b, sizeof( a ) ) == 0 ); +} + rtems_task Init( rtems_task_argument argument ) @@ -35,6 +56,9 @@ rtems_task Init( puts( "\n*** RTEMS WATCHDOG ***" ); puts( "INIT - report on empty watchdog chain" ); + + test_watchdog_static_init(); + _Chain_Initialize_empty( &empty ); _Watchdog_Report_chain( "Empty Chain", &empty ); |