Changeset 4b960e5 in rtems
- Timestamp:
- 11/16/99 16:21:00 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 90378e4
- Parents:
- 72d4b1d9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/tests/support/include/tmacros.h
r72d4b1d9 r4b960e5 26 26 #include <stdio.h> 27 27 #include <stdlib.h> 28 #include <assert.h> 28 29 29 30 #define FOREVER 1 /* infinite loop */ … … 36 37 #endif 37 38 38 #define directive_failed( dirstat, failmsg ) \ 39 fatal_directive_status( dirstat, RTEMS_SUCCESSFUL, failmsg ) 39 #define check_dispatch_disable_level( _expect ) \ 40 do { \ 41 extern volatile rtems_unsigned32 _Thread_Dispatch_disable_level; \ 42 if ( _Thread_Dispatch_disable_level != (_expect) ) { \ 43 printf( "\n_Thread_Dispatch_disable_level is (%d) not %d\n", \ 44 _Thread_Dispatch_disable_level, (_expect) ); \ 45 fflush(stdout); \ 46 exit( 1 ); \ 47 } \ 48 } while ( 0 ) 40 49 41 #define fatal_directive_status( stat, desired, msg ) \ 42 do { \ 43 if ( (stat) != (desired) ) { \ 44 printf( "\n%s FAILED -- expected (%d) got (%d)\n", \ 45 (msg), (desired), (stat) ); \ 46 fflush(stdout); \ 47 exit( stat ); \ 48 } \ 49 } while ( 0 ) 50 #define directive_failed( _dirstat, _failmsg ) \ 51 fatal_directive_status( _dirstat, RTEMS_SUCCESSFUL, _failmsg ) 50 52 51 #define sprint_time(str,s1,tb,s2) \ 53 #define directive_failed_with_level( _dirstat, _failmsg, _level ) \ 54 fatal_directive_status_with_level( \ 55 _dirstat, RTEMS_SUCCESSFUL, _failmsg, _level ) 56 57 #define fatal_directive_status( _stat, _desired, _msg ) \ 58 fatal_directive_status_with_level( _stat, _desired, _msg, 0 ) 59 60 #define fatal_directive_status_with_level( _stat, _desired, _msg, _level ) \ 61 do { \ 62 check_dispatch_disable_level( _level ); \ 63 if ( (_stat) != (_desired) ) { \ 64 printf( "\n%s FAILED -- expected (%d) got (%d)\n", \ 65 (_msg), (_desired), (_stat) ); \ 66 fflush(stdout); \ 67 exit( _stat ); \ 68 } \ 69 } while ( 0 ) 70 71 #define sprint_time(_str, _s1, _tb, _s2) \ 52 72 do { \ 53 73 sprintf( (str), "%s%02d:%02d:%02d %02d/%02d/%04d%s", \ 54 s1, (tb)->hour, (tb)->minute, (tb)->second, \55 ( tb)->month, (tb)->day, (tb)->year,s2 ); \74 _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \ 75 (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \ 56 76 } while ( 0 ) 57 77 58 #define print_time( s1,tb,s2) \78 #define print_time(_s1, _tb, _s2) \ 59 79 do { \ 60 80 printf( "%s%02d:%02d:%02d %02d/%02d/%04d%s", \ 61 s1, (tb)->hour, (tb)->minute, (tb)->second, \62 ( tb)->month, (tb)->day, (tb)->year,s2 ); \81 _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \ 82 (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \ 63 83 fflush(stdout); \ 64 84 } while ( 0 ) 65 85 66 #define put_dot( c ) putchar( c ); fflush( stdout ) 86 #define put_dot( _c ) \ 87 do { \ 88 putchar( _c ); \ 89 fflush( stdout ); \ 90 } while ( 0 ) 67 91 68 92 #define new_line puts( "" ) -
testsuites/support/include/tmacros.h
r72d4b1d9 r4b960e5 26 26 #include <stdio.h> 27 27 #include <stdlib.h> 28 #include <assert.h> 28 29 29 30 #define FOREVER 1 /* infinite loop */ … … 36 37 #endif 37 38 38 #define directive_failed( dirstat, failmsg ) \ 39 fatal_directive_status( dirstat, RTEMS_SUCCESSFUL, failmsg ) 39 #define check_dispatch_disable_level( _expect ) \ 40 do { \ 41 extern volatile rtems_unsigned32 _Thread_Dispatch_disable_level; \ 42 if ( _Thread_Dispatch_disable_level != (_expect) ) { \ 43 printf( "\n_Thread_Dispatch_disable_level is (%d) not %d\n", \ 44 _Thread_Dispatch_disable_level, (_expect) ); \ 45 fflush(stdout); \ 46 exit( 1 ); \ 47 } \ 48 } while ( 0 ) 40 49 41 #define fatal_directive_status( stat, desired, msg ) \ 42 do { \ 43 if ( (stat) != (desired) ) { \ 44 printf( "\n%s FAILED -- expected (%d) got (%d)\n", \ 45 (msg), (desired), (stat) ); \ 46 fflush(stdout); \ 47 exit( stat ); \ 48 } \ 49 } while ( 0 ) 50 #define directive_failed( _dirstat, _failmsg ) \ 51 fatal_directive_status( _dirstat, RTEMS_SUCCESSFUL, _failmsg ) 50 52 51 #define sprint_time(str,s1,tb,s2) \ 53 #define directive_failed_with_level( _dirstat, _failmsg, _level ) \ 54 fatal_directive_status_with_level( \ 55 _dirstat, RTEMS_SUCCESSFUL, _failmsg, _level ) 56 57 #define fatal_directive_status( _stat, _desired, _msg ) \ 58 fatal_directive_status_with_level( _stat, _desired, _msg, 0 ) 59 60 #define fatal_directive_status_with_level( _stat, _desired, _msg, _level ) \ 61 do { \ 62 check_dispatch_disable_level( _level ); \ 63 if ( (_stat) != (_desired) ) { \ 64 printf( "\n%s FAILED -- expected (%d) got (%d)\n", \ 65 (_msg), (_desired), (_stat) ); \ 66 fflush(stdout); \ 67 exit( _stat ); \ 68 } \ 69 } while ( 0 ) 70 71 #define sprint_time(_str, _s1, _tb, _s2) \ 52 72 do { \ 53 73 sprintf( (str), "%s%02d:%02d:%02d %02d/%02d/%04d%s", \ 54 s1, (tb)->hour, (tb)->minute, (tb)->second, \55 ( tb)->month, (tb)->day, (tb)->year,s2 ); \74 _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \ 75 (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \ 56 76 } while ( 0 ) 57 77 58 #define print_time( s1,tb,s2) \78 #define print_time(_s1, _tb, _s2) \ 59 79 do { \ 60 80 printf( "%s%02d:%02d:%02d %02d/%02d/%04d%s", \ 61 s1, (tb)->hour, (tb)->minute, (tb)->second, \62 ( tb)->month, (tb)->day, (tb)->year,s2 ); \81 _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \ 82 (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \ 63 83 fflush(stdout); \ 64 84 } while ( 0 ) 65 85 66 #define put_dot( c ) putchar( c ); fflush( stdout ) 86 #define put_dot( _c ) \ 87 do { \ 88 putchar( _c ); \ 89 fflush( stdout ); \ 90 } while ( 0 ) 67 91 68 92 #define new_line puts( "" )
Note: See TracChangeset
for help on using the changeset viewer.