Changeset fe0286a in rtems


Ignore:
Timestamp:
Dec 10, 2009, 8:25:39 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
dc09e380
Parents:
ba3e987e
Message:

2009-12-10 Joel Sherrill <joel.sherrill@…>

  • sp69/init.c, sp69/sp69.doc, sp69/sp69.scn: Add test for statistics on expired periods. This detected the recently introduced PR1480.
Location:
testsuites/sptests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/ChangeLog

    rba3e987e rfe0286a  
     12009-12-10      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * sp69/init.c, sp69/sp69.doc, sp69/sp69.scn: Add test for statistics on
     4        expired periods. This detected the recently introduced PR1480.
     5
    162009-12-10      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • testsuites/sptests/sp69/init.c

    rba3e987e rfe0286a  
    1818)
    1919{
    20   rtems_id                            period_id;
    21   rtems_name                          period_name;
    22   rtems_rate_monotonic_period_status  period_status;
    23   rtems_status_code                   status;
     20  rtems_id                                period_id;
     21  rtems_name                              period_name;
     22  rtems_rate_monotonic_period_status      period_status;
     23  rtems_status_code                       status;
     24  rtems_rate_monotonic_period_statistics  statistics;
     25  int                                     i;
    2426
    2527  period_name = rtems_build_name('P','E','R','1');
     
    8991   * Check normal get_status results.
    9092   */
    91   puts(
    92     "rtems_rate_monotonic_get_status - verify values of an active period"
    93   );
     93  puts( "rtems_rate_monotonic_get_status - verify values of an active period" );
    9494  rtems_test_spin_until_next_tick();
    9595  status = rtems_rate_monotonic_period( period_id, 100 );
     
    141141  #endif
    142142
    143   puts("*** END OF TEST 69 ***");
     143  /* ensure the missed periods are properly accounted for */
     144  puts( "rtems_rate_monotonic_cancel -  OK" );
     145  status = rtems_rate_monotonic_cancel( period_id );
     146  directive_failed( status, "rate_monotonic_cancel" );
     147
     148  puts( "Testing statistics on missed periods" );
     149  rtems_test_spin_until_next_tick();
     150  status = rtems_rate_monotonic_period( period_id, 50 );
     151  directive_failed( status, "rate_monotonic_period above loop" );
     152
     153  for ( i=1 ; i <= 3 ; i++ ) {
     154    status = rtems_task_wake_after( 100 );
     155    directive_failed( status, "rtems_task_wake_after(100)" );
     156
     157    rtems_test_spin_until_next_tick();
     158    status = rtems_rate_monotonic_period( period_id, 50 );
     159    fatal_directive_status(
     160      status,
     161      RTEMS_TIMEOUT,
     162      "rtems_rate_monotonic_period 2-n"
     163    );
     164
     165    status = rtems_rate_monotonic_get_statistics( period_id, &statistics );
     166    directive_failed( status, "rate_monotonic_get_statistics" );
     167    if ( statistics.missed_count != i ) {
     168      printf(
     169        "Expected %d got %d for missed_count\n",
     170        i,
     171        statistics.missed_count
     172      );
     173    }
     174   
     175    rtems_test_assert( statistics.missed_count == i );
     176  }
     177 
     178  puts( "*** END OF TEST 69 ***" );
    144179
    145180  rtems_test_exit(0);
  • testsuites/sptests/sp69/sp69.scn

    rba3e987e rfe0286a  
    55wall time should be ~600000000 is 609216000
    66cpu time should be ~100000000 is 109217000
     7rtems_rate_monotonic_cancel -  OK
     8Testing statistics on missed periods
    79*** END OF TEST 69 ***
Note: See TracChangeset for help on using the changeset viewer.