Changeset e334edd in rtems


Ignore:
Timestamp:
Mar 14, 2015, 3:52:24 PM (4 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
3c69c467
Parents:
217b3f53
git-author:
Joel Sherrill <joel.sherrill@…> (03/14/15 15:52:24)
git-committer:
Joel Sherrill <joel.sherrill@…> (03/17/15 15:05:07)
Message:

tests misc: Disable deprecated method usage warning when intentional

These tests intentionally use the deprecated method. Eventually
this code in the sections can be deleted.

Location:
testsuites
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psxconfig01/init.c

    r217b3f53 re334edd  
    439439#if !defined(RTEMS_SMP)
    440440#ifdef CONFIGURE_MAXIMUM_TASK_VARIABLES
    441   for (i = 0; i < CONFIGURE_MAXIMUM_TASK_VARIABLES; ++i) {
    442     sc = rtems_task_variable_add(RTEMS_SELF, &task_var, task_var_dtor);
    443     directive_failed(sc, "rtems_task_variable_add");
    444   }
     441  /*
     442   * We know this is deprecated and don't want a warning on every BSP built.
     443   */
     444  #pragma GCC diagnostic push
     445  #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
     446    for (i = 0; i < CONFIGURE_MAXIMUM_TASK_VARIABLES; ++i) {
     447      sc = rtems_task_variable_add(RTEMS_SELF, &task_var, task_var_dtor);
     448      directive_failed(sc, "rtems_task_variable_add");
     449    }
     450  #pragma GCC diagnostic pop
    445451#endif
    446452#endif
  • testsuites/sptests/spclockget/init.c

    r217b3f53 re334edd  
    1414#include <tmacros.h>
    1515#include "pritime.h"
     16
     17#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    1618
    1719const char rtems_test_name[] = "SPCLOCKGET";
  • testsuites/sptests/spnotepad01/init.c

    r217b3f53 re334edd  
    1515
    1616const char rtems_test_name[] = "SPNOTEPAD 1";
     17
     18/*
     19 * We know this is deprecated and don't want a warning on every BSP built.
     20 */
     21#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    1722
    1823/* forward declarations to avoid warnings */
  • testsuites/sptests/sptask_err04/task1.c

    r217b3f53 re334edd  
    5151  puts( "TA1 - rtems_task_delete - RTEMS_INVALID_ID" );
    5252
    53   /* NULL return */
    54   status = rtems_task_get_note( RTEMS_SELF, RTEMS_NOTEPAD_FIRST, NULL );
    55   fatal_directive_status(
    56     status,
    57     RTEMS_INVALID_ADDRESS,
    58     "rtems_task_get_note with NULL param"
    59   );
    60   puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ADDRESS" );
    61 
    62   /* note too high */
    63   status = rtems_task_get_note( RTEMS_SELF, 100, &notepad_value );
    64   fatal_directive_status(
    65     status,
    66     RTEMS_INVALID_NUMBER,
    67     "rtems_task_get_note with illegal notepad"
    68   );
    69   puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER" );
    70 
    71   /* bad Id */
    72   status = rtems_task_get_note( 100, RTEMS_NOTEPAD_LAST, &notepad_value );
    73   fatal_directive_status(
    74     status,
    75     RTEMS_INVALID_ID,
    76     "rtems_task_get_note with illegal id"
    77   );
    78   puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" );
    79 
    80   /* unused Id so invalid now */
    81   status = rtems_task_get_note(
    82     Task_id[ 0 ],
    83     RTEMS_NOTEPAD_LAST,
    84     &notepad_value
    85   );
    86   fatal_directive_status(
    87     status,
    88     RTEMS_INVALID_ID,
    89     "rtems_task_get_note with illegal id"
    90   );
    91   puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" );
    92 
    93   status = rtems_task_get_note(
    94     _RTEMS_tasks_Information.minimum_id + (3L<<OBJECTS_API_START_BIT),
    95     RTEMS_NOTEPAD_LAST,
    96     &notepad_value
    97   );
    98   fatal_directive_status(
    99     status,
    100     RTEMS_INVALID_ID,
    101     "rtems_task_get_note with illegal id"
    102   );
    103 
    104   status = rtems_task_get_note(
    105     rtems_build_id( OBJECTS_CLASSIC_API, 2, 1, 1 ),
    106     RTEMS_NOTEPAD_LAST,
    107     &notepad_value
    108   );
    109   fatal_directive_status(
    110     status,
    111     RTEMS_INVALID_ID,
    112     "rtems_task_get_note with non-task ID"
    113   );
    114 
    115   /* NULL param */
    116   status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, NULL );
    117   fatal_directive_status(
    118     status,
    119     RTEMS_INVALID_ADDRESS,
    120     "rtems_task_ident NULL param"
    121   );
    122   puts( "TA1 - rtems_task_ident - RTEMS_INVALID_ADDRESS" );
    123 
    124   /* OK */
    125   status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &self_id );
    126   directive_failed( status, "rtems_task_ident of self" );
    127   if ( self_id != Task_id[ 1 ] ) {
    128     puts( "ERROR - rtems_task_ident - incorrect ID returned!" );
    129   }
    130   puts( "TA1 - rtems_task_ident - current task RTEMS_SUCCESSFUL" );
    131 
    132   status = rtems_task_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
    133   fatal_directive_status(
    134     status,
    135     RTEMS_INVALID_NAME,
    136     "rtems_task_ident with illegal name (local)"
    137   );
    138   puts( "TA1 - rtems_task_ident - global RTEMS_INVALID_NAME" );
    139 
    140   status = rtems_task_ident( 100, 1, &Junk_id );
    141   fatal_directive_status(
    142     status,
    143     RTEMS_INVALID_NAME,
    144     "rtems_task_ident with illegal name (global)"
    145   );
    146   puts( "TA1 - rtems_task_ident - local RTEMS_INVALID_NAME" );
     53  /** START OF NOTEPAD TESTS **/
    14754
    14855  /*
    149    *  This one case is different if MP is enabled/disabled.
     56   * We know this is deprecated and don't want a warning on every BSP built.
    15057   */
    151 
    152   status = rtems_task_ident( 100, 2, &Junk_id );
    153 #if defined(RTEMS_MULTIPROCESSING)
    154   fatal_directive_status(
    155     status,
    156     RTEMS_INVALID_NODE,
    157     "rtems_task_ident with illegal node"
    158   );
    159 #else
    160   fatal_directive_status(
    161     status,
    162     RTEMS_INVALID_NAME,
    163     "rtems_task_ident with illegal node"
    164   );
    165 #endif
    166   puts( "TA1 - rtems_task_ident - RTEMS_INVALID_NODE" );
    167 
    168   status = rtems_task_restart( 100, 0 );
    169   fatal_directive_status(
    170     status,
    171     RTEMS_INVALID_ID,
    172     "rtems_task_restart with illegal id"
    173   );
    174   puts( "TA1 - rtems_task_restart - RTEMS_INVALID_ID" );
    175 
    176   status = rtems_task_resume( 100 );
    177   fatal_directive_status(
    178     status,
    179     RTEMS_INVALID_ID,
    180     "rtems_task_resume with illegal id"
    181   );
    182   puts( "TA1 - rtems_task_resume - RTEMS_INVALID_ID" );
    183 
    184   status = rtems_task_resume( RTEMS_SELF );
    185   fatal_directive_status(
    186     status,
    187     RTEMS_INCORRECT_STATE,
    188     "rtems_task_resume of ready task"
    189   );
    190   puts( "TA1 - rtems_task_resume - RTEMS_INCORRECT_STATE" );
    191 
    192   /* NULL param */
    193   status = rtems_task_set_priority( RTEMS_SELF, RTEMS_CURRENT_PRIORITY, NULL );
    194   fatal_directive_status(
    195     status,
    196     RTEMS_INVALID_ADDRESS,
    197     "rtems_task_set_priority with NULL param"
    198   );
    199   puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_ADDRESS" );
    200 
    201   /* bad priority */
    202   status = rtems_task_set_priority( RTEMS_SELF, 512, &previous_priority );
    203   fatal_directive_status(
    204     status,
    205     RTEMS_INVALID_PRIORITY,
    206     "rtems_task_set_priority with illegal priority"
    207   );
    208   puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_PRIORITY" );
    209 
    210   /* bad Id */
    211   status = rtems_task_set_priority( 100, 8, &previous_priority );
    212   fatal_directive_status(
    213     status,
    214     RTEMS_INVALID_ID,
    215     "rtems_task_set_priority with illegal id"
    216   );
    217   puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_ID" );
    218 
    219   status = rtems_task_set_note(
    220     RTEMS_SELF,
    221     RTEMS_NOTEPAD_LAST+10,
    222     notepad_value
    223   );
    224   fatal_directive_status(
    225     status,
    226     RTEMS_INVALID_NUMBER,
    227     "rtems_task_set_note with illegal notepad"
    228   );
    229   puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_NUMBER" );
    230 
    231   status = rtems_task_set_note( 100, RTEMS_NOTEPAD_LAST, notepad_value );
    232   fatal_directive_status(
    233     status,
    234     RTEMS_INVALID_ID,
    235     "rtems_task_set_note with illegal id"
    236   );
    237   puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_ID" );
     58  #pragma GCC diagnostic push
     59  #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
     60
     61    /* NULL return */
     62    status = rtems_task_get_note( RTEMS_SELF, RTEMS_NOTEPAD_FIRST, NULL );
     63    fatal_directive_status(
     64      status,
     65      RTEMS_INVALID_ADDRESS,
     66      "rtems_task_get_note with NULL param"
     67    );
     68    puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ADDRESS" );
     69
     70    /* note too high */
     71    status = rtems_task_get_note( RTEMS_SELF, 100, &notepad_value );
     72    fatal_directive_status(
     73      status,
     74      RTEMS_INVALID_NUMBER,
     75      "rtems_task_get_note with illegal notepad"
     76    );
     77    puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER" );
     78
     79    /* bad Id */
     80    status = rtems_task_get_note( 100, RTEMS_NOTEPAD_LAST, &notepad_value );
     81    fatal_directive_status(
     82      status,
     83      RTEMS_INVALID_ID,
     84      "rtems_task_get_note with illegal id"
     85    );
     86    puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" );
     87
     88    /* unused Id so invalid now */
     89    status = rtems_task_get_note(
     90      Task_id[ 0 ],
     91      RTEMS_NOTEPAD_LAST,
     92      &notepad_value
     93    );
     94    fatal_directive_status(
     95      status,
     96      RTEMS_INVALID_ID,
     97      "rtems_task_get_note with illegal id"
     98    );
     99    puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" );
     100
     101    status = rtems_task_get_note(
     102      _RTEMS_tasks_Information.minimum_id + (3L<<OBJECTS_API_START_BIT),
     103      RTEMS_NOTEPAD_LAST,
     104      &notepad_value
     105    );
     106    fatal_directive_status(
     107      status,
     108      RTEMS_INVALID_ID,
     109      "rtems_task_get_note with illegal id"
     110    );
     111
     112    status = rtems_task_get_note(
     113      rtems_build_id( OBJECTS_CLASSIC_API, 2, 1, 1 ),
     114      RTEMS_NOTEPAD_LAST,
     115      &notepad_value
     116    );
     117    fatal_directive_status(
     118      status,
     119      RTEMS_INVALID_ID,
     120      "rtems_task_get_note with non-task ID"
     121    );
     122
     123    /* NULL param */
     124    status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, NULL );
     125    fatal_directive_status(
     126      status,
     127      RTEMS_INVALID_ADDRESS,
     128      "rtems_task_ident NULL param"
     129    );
     130    puts( "TA1 - rtems_task_ident - RTEMS_INVALID_ADDRESS" );
     131
     132    /* OK */
     133    status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &self_id );
     134    directive_failed( status, "rtems_task_ident of self" );
     135    if ( self_id != Task_id[ 1 ] ) {
     136      puts( "ERROR - rtems_task_ident - incorrect ID returned!" );
     137    }
     138    puts( "TA1 - rtems_task_ident - current task RTEMS_SUCCESSFUL" );
     139
     140    status = rtems_task_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
     141    fatal_directive_status(
     142      status,
     143      RTEMS_INVALID_NAME,
     144      "rtems_task_ident with illegal name (local)"
     145    );
     146    puts( "TA1 - rtems_task_ident - global RTEMS_INVALID_NAME" );
     147
     148    status = rtems_task_ident( 100, 1, &Junk_id );
     149    fatal_directive_status(
     150      status,
     151      RTEMS_INVALID_NAME,
     152      "rtems_task_ident with illegal name (global)"
     153    );
     154    puts( "TA1 - rtems_task_ident - local RTEMS_INVALID_NAME" );
     155
     156    /*
     157     *  This one case is different if MP is enabled/disabled.
     158     */
     159
     160    status = rtems_task_ident( 100, 2, &Junk_id );
     161  #if defined(RTEMS_MULTIPROCESSING)
     162    fatal_directive_status(
     163      status,
     164      RTEMS_INVALID_NODE,
     165      "rtems_task_ident with illegal node"
     166    );
     167  #else
     168    fatal_directive_status(
     169      status,
     170      RTEMS_INVALID_NAME,
     171      "rtems_task_ident with illegal node"
     172    );
     173  #endif
     174    puts( "TA1 - rtems_task_ident - RTEMS_INVALID_NODE" );
     175
     176    status = rtems_task_restart( 100, 0 );
     177    fatal_directive_status(
     178      status,
     179      RTEMS_INVALID_ID,
     180      "rtems_task_restart with illegal id"
     181    );
     182    puts( "TA1 - rtems_task_restart - RTEMS_INVALID_ID" );
     183
     184    status = rtems_task_resume( 100 );
     185    fatal_directive_status(
     186      status,
     187      RTEMS_INVALID_ID,
     188      "rtems_task_resume with illegal id"
     189    );
     190    puts( "TA1 - rtems_task_resume - RTEMS_INVALID_ID" );
     191
     192    status = rtems_task_resume( RTEMS_SELF );
     193    fatal_directive_status(
     194      status,
     195      RTEMS_INCORRECT_STATE,
     196      "rtems_task_resume of ready task"
     197    );
     198    puts( "TA1 - rtems_task_resume - RTEMS_INCORRECT_STATE" );
     199
     200    /* NULL param */
     201    status = rtems_task_set_priority( RTEMS_SELF, RTEMS_CURRENT_PRIORITY, NULL );
     202    fatal_directive_status(
     203      status,
     204      RTEMS_INVALID_ADDRESS,
     205      "rtems_task_set_priority with NULL param"
     206    );
     207    puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_ADDRESS" );
     208
     209    /* bad priority */
     210    status = rtems_task_set_priority( RTEMS_SELF, 512, &previous_priority );
     211    fatal_directive_status(
     212      status,
     213      RTEMS_INVALID_PRIORITY,
     214      "rtems_task_set_priority with illegal priority"
     215    );
     216    puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_PRIORITY" );
     217
     218    /* bad Id */
     219    status = rtems_task_set_priority( 100, 8, &previous_priority );
     220    fatal_directive_status(
     221      status,
     222      RTEMS_INVALID_ID,
     223      "rtems_task_set_priority with illegal id"
     224    );
     225    puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_ID" );
     226
     227    status = rtems_task_set_note(
     228      RTEMS_SELF,
     229      RTEMS_NOTEPAD_LAST+10,
     230      notepad_value
     231    );
     232    fatal_directive_status(
     233      status,
     234      RTEMS_INVALID_NUMBER,
     235      "rtems_task_set_note with illegal notepad"
     236    );
     237    puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_NUMBER" );
     238
     239    status = rtems_task_set_note( 100, RTEMS_NOTEPAD_LAST, notepad_value );
     240    fatal_directive_status(
     241      status,
     242      RTEMS_INVALID_ID,
     243      "rtems_task_set_note with illegal id"
     244    );
     245    puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_ID" );
     246
     247  #pragma GCC diagnostic pop
     248
     249  /** END OF NOTEPAD TESTS **/
    238250
    239251  status = rtems_task_start( 100, Task_1, 0 );
  • testsuites/tmtests/tm08/task1.c

    r217b3f53 re334edd  
    187187    (void)  rtems_task_mode( RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode );
    188188
    189   benchmark_timer_initialize();
    190     for ( index=1 ; index <= OPERATION_COUNT ; index++ )
    191       (void) rtems_task_set_note( Test_task_id, 8, 10 );
    192   end_time = benchmark_timer_read();
    193 
    194   put_time(
    195     "rtems_task_set_note: only case",
    196     end_time,
    197     OPERATION_COUNT,
    198     overhead,
    199     CALLING_OVERHEAD_TASK_SET_NOTE
    200   );
    201 
    202   benchmark_timer_initialize();
    203     for ( index=1 ; index <= OPERATION_COUNT ; index++ )
    204       (void) rtems_task_get_note( Test_task_id, 8, &old_note );
    205   end_time = benchmark_timer_read();
    206 
    207   put_time(
    208     "rtems_task_get_note: only case",
    209     end_time,
    210     OPERATION_COUNT,
    211     overhead,
    212     CALLING_OVERHEAD_TASK_GET_NOTE
    213   );
     189  /** START OF NOTEPAD TESTS **/
     190
     191  /*
     192   * We know this is deprecated and don't want a warning on every BSP built.
     193   */
     194  #pragma GCC diagnostic push
     195  #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
     196
     197    benchmark_timer_initialize();
     198      for ( index=1 ; index <= OPERATION_COUNT ; index++ )
     199        (void) rtems_task_set_note( Test_task_id, 8, 10 );
     200    end_time = benchmark_timer_read();
     201
     202    put_time(
     203      "rtems_task_set_note: only case",
     204      end_time,
     205      OPERATION_COUNT,
     206      overhead,
     207      CALLING_OVERHEAD_TASK_SET_NOTE
     208    );
     209
     210    benchmark_timer_initialize();
     211      for ( index=1 ; index <= OPERATION_COUNT ; index++ )
     212        (void) rtems_task_get_note( Test_task_id, 8, &old_note );
     213    end_time = benchmark_timer_read();
     214
     215    put_time(
     216      "rtems_task_get_note: only case",
     217      end_time,
     218      OPERATION_COUNT,
     219      overhead,
     220      CALLING_OVERHEAD_TASK_GET_NOTE
     221    );
     222
     223  #pragma GCC diagnostic pop
     224
     225  /** END OF NOTEPAD TESTS **/
    214226
    215227  build_time( &time, 1, 1, 1988, 0, 0, 0, 0 );
Note: See TracChangeset for help on using the changeset viewer.