diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-01-29 21:53:40 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-01-29 21:53:40 +0000 |
commit | 83a66aa52f124aee17985b3bf9168a3c52b7d3a2 (patch) | |
tree | f89d5938a0be7b7e8fd71403e4b59fbde12010a8 /testsuites/support/include/tmacros.h | |
parent | 2008-01-29 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-83a66aa52f124aee17985b3bf9168a3c52b7d3a2.tar.bz2 |
2008-01-29 Joel Sherrill <joel.sherrill@oarcorp.com>
* support/include/tmacros.h: Add new rtems_test_assert() which exits
rather than calling fatal error.
Diffstat (limited to 'testsuites/support/include/tmacros.h')
-rw-r--r-- | testsuites/support/include/tmacros.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/testsuites/support/include/tmacros.h b/testsuites/support/include/tmacros.h index 563fcd0cb1..49bc9a768f 100644 --- a/testsuites/support/include/tmacros.h +++ b/testsuites/support/include/tmacros.h @@ -3,7 +3,7 @@ * This include file contains macros which are useful in the RTEMS * test suites. * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -234,8 +234,9 @@ extern "C" { #endif #define task_number( tid ) \ - ( rtems_get_index( tid ) - \ - rtems_configuration_get_rtems_api_configuration()->number_of_initialization_tasks ) + ( rtems_object_id_get_index( tid ) - \ + rtems_configuration_get_rtems_api_configuration()-> \ + number_of_initialization_tasks ) static inline uint32_t get_ticks_per_second( void ) { @@ -246,6 +247,12 @@ static inline uint32_t get_ticks_per_second( void ) #define TICKS_PER_SECOND get_ticks_per_second() +#define rtems_test_assert(__exp) \ + if (!(__exp)) { \ + printf( "%s: %d %s\n", __FILE__, __LINE__, #__exp ); \ + rtems_test_exit(0); \ + } + #ifdef __cplusplus } #endif |