Changeset 3d9fd2ce in rtems
- Timestamp:
- 06/21/16 12:30:13 (7 years ago)
- Branches:
- 5, master
- Children:
- 655ce0fb
- Parents:
- 22c3a54b
- git-author:
- Sebastian Huber <sebastian.huber@…> (06/21/16 12:30:13)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (06/22/16 05:45:49)
- Location:
- testsuites/sptests/sp20
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/sptests/sp20/init.c
r22c3a54b r3d9fd2ce 29 29 const char rtems_test_name[] = "SP 20"; 30 30 31 rtems_printer rtems_test_printer; 32 33 #define BUFFER_COUNT 20 34 35 #define BUFFER_SIZE 100 36 37 static rtems_printer_task_context printer_task; 38 39 static long buffers[ BUFFER_COUNT ][ BUFFER_SIZE / sizeof(long) ]; 40 41 void end_of_test( void ) 42 { 43 rtems_test_printf( TEST_END_STRING ); 44 rtems_printer_task_drain( &printer_task ); 45 rtems_test_exit( 0 ); 46 } 47 31 48 rtems_task Init( 32 49 rtems_task_argument argument 33 50 ) 34 51 { 35 uint32_t index; 52 int error; 53 uint32_t index; 36 54 rtems_status_code status; 37 55 38 TEST_BEGIN(); 56 rtems_printer_task_set_priority( &printer_task, 254 ); 57 rtems_printer_task_set_file_descriptor( &printer_task, 1 ); 58 rtems_printer_task_set_buffer_table( &printer_task, &buffers[ 0 ][ 0 ] ); 59 rtems_printer_task_set_buffer_count( &printer_task, BUFFER_COUNT ); 60 rtems_printer_task_set_buffer_size( &printer_task, BUFFER_SIZE ); 61 error = rtems_print_printer_task( &rtems_test_printer, &printer_task ); 62 rtems_test_assert( error == 0 ); 63 64 rtems_test_printf( TEST_BEGIN_STRING ); 39 65 40 66 Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); -
testsuites/sptests/sp20/sp20.scn
r22c3a54b r3d9fd2ce 1 *** TEST20 ***1 *** BEGIN OF TEST SP 20 *** 2 2 TA1 - rtems_rate_monotonic_create id = 0x42010001 3 3 TA1 - rtems_rate_monotonic_ident id = 0x42010001 4 TA1 - (0x 2c010001) period 24 TA1 - (0x42010001) period 2 5 5 TA2 - rtems_rate_monotonic_create id = 0x42010002 6 6 TA2 - rtems_rate_monotonic_ident id = 0x42010002 7 TA2 - (0x 2c010002) period 27 TA2 - (0x42010002) period 2 8 8 TA3 - rtems_rate_monotonic_create id = 0x42010003 9 9 TA3 - rtems_rate_monotonic_ident id = 0x42010003 10 TA3 - (0x 2c010003) period 210 TA3 - (0x42010003) period 2 11 11 TA4 - rtems_rate_monotonic_create id = 0x42010004 12 12 TA4 - rtems_rate_monotonic_ident id = 0x42010004 13 TA4 - (0x 2c010004) period 213 TA4 - (0x42010004) period 2 14 14 TA5 - rtems_rate_monotonic_create id = 0x42010005 15 15 TA5 - rtems_rate_monotonic_ident id = 0x42010005 16 TA5 - (0x 2c010005) period 10016 TA5 - (0x42010005) period 100 17 17 TA6 - rtems_rate_monotonic_create id = 0x42010006 18 18 TA6 - rtems_rate_monotonic_ident id = 0x42010006 19 TA6 - (0x 2c010006) period 019 TA6 - (0x42010006) period 0 20 20 TA5 - PERIODS CHECK OK (1) 21 21 TA5 - PERIODS CHECK OK (2) … … 23 23 TA5 - PERIODS CHECK OK (4) 24 24 TA5 - PERIODS CHECK OK (5) 25 TA6 - Actual: 10 26 TA6 - Actual: 20 27 TA6 - Actual: 30 28 TA6 - Actual: 40 29 TA6 - Actual: 50 30 TA6 - Actual: 60 31 TA6 - Actual: 70 32 TA6 - Actual: 80 33 TA6 - Actual: 90 34 TA6 - Actual: 100 25 TA6 - Actual: 10 Expected: 10 - OK 26 TA6 - Actual: 20 Expected: 20 - OK 27 TA6 - Actual: 30 Expected: 30 - OK 28 TA6 - Actual: 40 Expected: 40 - OK 29 TA6 - Actual: 50 Expected: 50 - OK 30 TA6 - Actual: 60 Expected: 60 - OK 31 TA6 - Actual: 70 Expected: 70 - OK 32 TA6 - Actual: 80 Expected: 80 - OK 33 TA6 - Actual: 90 Expected: 90 - OK 34 TA6 - Actual: 100 Expected: 100 - OK 35 35 TA5 - PERIODS CHECK OK (6) 36 36 TA5 - PERIODS CHECK OK (7) … … 38 38 TA5 - PERIODS CHECK OK (9) 39 39 TA5 - PERIODS CHECK OK (10) 40 *** END OF TEST 20 ***40 *** END OF TEST SP 20 *** -
testsuites/sptests/sp20/system.h
r22c3a54b r3d9fd2ce 39 39 #define CONFIGURE_MICROSECONDS_PER_TICK 100000 40 40 41 #define CONFIGURE_MAXIMUM_TASKS 741 #define CONFIGURE_MAXIMUM_TASKS 8 42 42 #define CONFIGURE_MAXIMUM_PERIODS 10 43 43 … … 59 59 extern rtems_task_priority Priorities[ 7 ]; 60 60 61 void end_of_test( void ); 62 61 63 /* end of include file */ -
testsuites/sptests/sp20/task1.c
r22c3a54b r3d9fd2ce 26 26 rtems_task_priority Priorities[7] = { 0, 1, 1, 3, 4, 5, 1 }; 27 27 28 static char *name( size_t i, char buf[ 4 ] ) 29 { 30 rtems_name_to_characters( 31 Task_name[ i ], 32 &buf[ 0 ], 33 &buf[ 1 ], 34 &buf[ 2 ], 35 &buf[ 3 ] 36 ); 37 buf[ 3 ] = '\0'; 38 return &buf[ 0 ]; 39 } 40 28 41 rtems_task Task_1_through_6( 29 42 rtems_task_argument argument … … 36 49 uint32_t failed; 37 50 rtems_status_code status; 51 char buf[ 4 ]; 38 52 39 53 status = rtems_rate_monotonic_create( argument, &rmid ); 40 54 directive_failed( status, "rtems_rate_monotonic_create" ); 41 put_name( Task_name[ argument ], FALSE ); 42 printf( "- rtems_rate_monotonic_create id = 0x%08" PRIxrtems_id "\n", rmid ); 55 rtems_test_printf( 56 "%s - rtems_rate_monotonic_create id = 0x%08" PRIxrtems_id "\n", 57 name( argument, buf ), 58 rmid 59 ); 43 60 44 61 status = rtems_rate_monotonic_ident( argument, &test_rmid ); 45 62 directive_failed( status, "rtems_rate_monotonic_ident" ); 46 put_name( Task_name[ argument ], FALSE );47 printf(48 "- rtems_rate_monotonic_ident id = 0x%08" PRIxrtems_id "\n",63 rtems_test_printf( 64 "%s - rtems_rate_monotonic_ident id = 0x%08" PRIxrtems_id "\n", 65 name( argument, buf ), 49 66 test_rmid 50 67 ); 51 68 52 69 if ( rmid != test_rmid ) { 53 printf(70 rtems_test_printf( 54 71 "RMID's DO NOT MATCH (0x%" PRIxrtems_id " and 0x%" PRIxrtems_id ")\n", 55 72 rmid, … … 59 76 } 60 77 61 put_name( Task_name[ argument ], FALSE );62 printf(63 "- (0x%08" PRIxrtems_id ") period %" PRIu32 "\n",78 rtems_test_printf( 79 "%s - (0x%08" PRIxrtems_id ") period %" PRIu32 "\n", 80 name( argument, buf ), 64 81 rmid, 65 82 Periods[ argument ] … … 99 116 for( index = 1 ; index <= 4 ; index++ ) { 100 117 if ( Temporary_count.count[ index ] != Iterations[ index ] ) { 101 puts_nocr( "FAIL -- " );102 put_name ( Task_name[ index ], FALSE );103 printf ( " Actual=%" PRIu32 ", Expected=%" PRIu32 "\n",104 105 106 118 rtems_test_printf( 119 "%s - FAIL - Actual=%" PRIu32 ", Expected=%" PRIu32 "\n", 120 name( index, buf ), 121 Temporary_count.count[ index ], 122 Iterations[ index ] 123 ); 107 124 failed += 1; 108 125 } … … 114 131 pass += 1; 115 132 116 printf( "TA5 - PERIODS CHECK OK (%d)\n", pass ); 117 118 fflush( stdout ); 133 rtems_test_printf( "TA5 - PERIODS CHECK OK (%d)\n", pass ); 119 134 120 135 if ( pass == 10 ) { 121 TEST_END(); 122 rtems_test_exit( 0 ); 136 end_of_test(); 123 137 } 124 138 … … 135 149 directive_failed( status, "rtems_rate_monotonic_period of TA6" ); 136 150 time[0] = _Watchdog_Ticks_since_boot; /* timestamp */ 137 /* printf("%d - %d\n", period, time[0]);*/151 /*rtems_test_printf("%d - %d\n", period, time[0]);*/ 138 152 139 153 for (index = 1; index <= TA6_ITERATIONS; index++) { … … 142 156 directive_failed( status, "rtems_rate_monotonic_period of TA6" ); 143 157 time[index] = _Watchdog_Ticks_since_boot; /* timestamp */ 144 /* printf("%d - %d\n", period, time[index]);*/158 /*rtems_test_printf("%d - %d\n", period, time[index]);*/ 145 159 } 146 160 … … 148 162 rtems_interval meas = time[index] - time[index-1]; 149 163 period = index*TA6_PERIOD_FACTOR; 150 printf(164 rtems_test_printf( 151 165 "TA6 - Actual: %" PRIdrtems_interval 152 166 " Expected: %" PRIdrtems_interval, … … 154 168 period 155 169 ); 156 if (period == meas) printf(" - OK\n");157 else printf(" - FAILED\n");170 if (period == meas) rtems_test_printf(" - OK\n"); 171 else rtems_test_printf(" - FAILED\n"); 158 172 } 159 173 }
Note: See TracChangeset
for help on using the changeset viewer.