Changeset b2c626f0 in rtems


Ignore:
Timestamp:
Sep 2, 2021, 6:50:40 AM (5 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
01d22f7f
Parents:
a93d0ce2
git-author:
Sebastian Huber <sebastian.huber@…> (09/02/21 06:50:40)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/02/21 06:54:58)
Message:

Improve test of rtems_interrupt_get_affinity()

Use a CPU set which is larger than the internal processor set
representation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/validation/tc-intr-get-affinity.c

    ra93d0ce2 rb2c626f0  
    140140   *   parameter.
    141141   */
    142   cpu_set_t cpuset_obj;
     142  cpu_set_t cpuset_obj[ 2 ];;
    143143
    144144  /**
     
    237237{
    238238  rtems_status_code sc;
    239   cpu_set_t         set;
     239  cpu_set_t         set[ 2 ];
    240240
    241241  if ( attr->can_get_affinity ) {
    242     CPU_ZERO( &ctx->cpuset_obj );
     242    CPU_ZERO_S( sizeof( ctx->cpuset_obj ), ctx->cpuset_obj );
    243243  } else {
    244     CPU_FILL( &ctx->cpuset_obj );
     244    CPU_FILL_S( sizeof( ctx->cpuset_obj ), ctx->cpuset_obj );
    245245  }
    246246
     
    251251  );
    252252
    253   CPU_ZERO( &set );
     253  CPU_ZERO_S( sizeof( set ), set );
    254254
    255255  if ( attr->can_get_affinity ) {
    256256    T_rsc_success( sc );
    257     T_ne_int( CPU_CMP( &ctx->cpuset_obj, &set ), 0 );
     257    T_false( CPU_EQUAL_S( sizeof( set ), ctx->cpuset_obj, set ) );
    258258  } else {
    259259    T_rsc( sc, RTEMS_UNSATISFIED );
    260     T_eq_int( CPU_CMP( &ctx->cpuset_obj, &set ), 0 );
     260    T_true( CPU_EQUAL_S( sizeof( set ), ctx->cpuset_obj, set ) );
    261261  }
    262262}
     
    299299      /*
    300300       * While the ``affinity_size`` parameter is an integral multiple of the
    301        * size of long, while the ``affinity_size`` parameter specifies a
     301       * size of ``long``, while the ``affinity_size`` parameter specifies a
    302302       * processor set which is large enough to contain the processor affinity
    303303       * set of the interrupt specified by ``vector``.
     
    310310      /*
    311311       * While the ``affinity_size`` parameter is an integral multiple of the
    312        * size of long, while the ``affinity_size`` parameter specifies a
     312       * size of ``long``, while the ``affinity_size`` parameter specifies a
    313313       * processor set which is not large enough to contain the processor
    314314       * affinity set of the interrupt specified by ``vector``.
     
    321321      /*
    322322       * While the ``affinity_size`` parameter is not an integral multiple of
    323        * the size of long.
     323       * the size of ``long``.
    324324       */
    325325      ctx->cpusetsize = SIZE_MAX;
     
    343343       * cpu_set_t.
    344344       */
    345       ctx->cpuset = &ctx->cpuset_obj;
     345      ctx->cpuset = ctx->cpuset_obj;
    346346      break;
    347347    }
     
    530530  if (
    531531    ctx->valid_vector && ctx->cpusetsize == sizeof( ctx->cpuset_obj ) &&
    532     ctx->cpuset == &ctx->cpuset_obj
     532    ctx->cpuset == ctx->cpuset_obj
    533533  ) {
    534534    for (
     
    552552    }
    553553  } else {
    554     cpu_set_t set;
     554    cpu_set_t set[ 2 ];
    555555
    556556    if ( ctx->valid_vector ) {
     
    560560    }
    561561
    562     CPU_FILL( &ctx->cpuset_obj );
     562    CPU_FILL_S( sizeof( ctx->cpuset_obj ), ctx->cpuset_obj );
    563563
    564564    ctx->status = rtems_interrupt_get_affinity(
     
    568568    );
    569569
    570     if ( ctx->cpuset == NULL || ctx->cpusetsize != sizeof( ctx->cpuset ) ) {
    571       CPU_FILL( &set );
     570    if (
     571      ctx->cpuset == NULL ||
     572      ctx->cpusetsize != sizeof( ctx->cpuset_obj )
     573    ) {
     574      CPU_FILL_S( sizeof( set ), set );
    572575    } else {
    573       CPU_ZERO( &set );
    574     }
    575 
    576     T_eq_int( CPU_CMP( &ctx->cpuset_obj, &set ), 0 );
     576      CPU_ZERO_S( sizeof( set ), set );
     577    }
     578
     579    T_true( CPU_EQUAL_S( sizeof( set ), ctx->cpuset_obj, set ) );
    577580  }
    578581}
Note: See TracChangeset for help on using the changeset viewer.