From 83a66aa52f124aee17985b3bf9168a3c52b7d3a2 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 29 Jan 2008 21:53:40 +0000 Subject: 2008-01-29 Joel Sherrill * support/include/tmacros.h: Add new rtems_test_assert() which exits rather than calling fatal error. --- testsuites/support/include/tmacros.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'testsuites/support/include/tmacros.h') 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 -- cgit v1.2.3