Changeset 5b9dfff5 in rtems


Ignore:
Timestamp:
May 6, 2015, 2:39:12 PM (4 years ago)
Author:
Alexander Krutwig <alexander.krutwig@…>
Branches:
4.11, master
Children:
438e78e
Parents:
a6502a58
git-author:
Alexander Krutwig <alexander.krutwig@…> (05/06/15 14:39:12)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/07/15 06:34:16)
Message:

sptests/spcontext01: Check FPU task combinations

Location:
testsuites/sptests/spcontext01
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/spcontext01/init.c

    ra6502a58 r5b9dfff5  
    3232  rtems_id control_task;
    3333  rtems_id validate_tasks[2];
     34  rtems_id timer;
    3435  size_t task_index;
    3536  int iteration_counter;
     
    4748  rtems_id *id,
    4849  uintptr_t pattern,
    49   rtems_task_priority priority
     50  rtems_task_priority priority,
     51  bool fp_unit
    5052)
    5153{
    5254  rtems_status_code sc;
     55  rtems_attribute fpu_state;
     56
     57  fpu_state = fp_unit ? RTEMS_FLOATING_POINT : RTEMS_DEFAULT_ATTRIBUTES;
    5358
    5459  sc = rtems_task_create(
     
    5762    RTEMS_MINIMUM_STACK_SIZE,
    5863    RTEMS_DEFAULT_MODES,
    59     RTEMS_DEFAULT_ATTRIBUTES,
     64    fpu_state,
    6065    id
    6166  );
     
    113118  test_context *self = arg;
    114119
    115   reset_timer_or_finish(self, timer);
     120  reset_timer_or_finish(self, self->timer);
    116121  switch_priorities(self);
    117122
     
    122127{
    123128  rtems_status_code sc;
    124   rtems_id timer;
    125 
    126   sc = rtems_timer_create(rtems_build_name('C', 'L', 'S', 'W'), &timer);
    127   rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    128 
    129   sc = rtems_timer_fire_after(timer, 2, clobber_and_switch_timer, self);
     129
     130  sc = rtems_timer_create(rtems_build_name('C', 'L', 'S', 'W'), &self->timer);
     131  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     132
     133  sc = rtems_timer_fire_after(self->timer, 2, clobber_and_switch_timer, self);
    130134  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    131135}
     
    146150}
    147151
    148 static void test(test_context *self)
    149 {
     152static void test(test_context *self, bool task_0_fpu, bool task_1_fpu)
     153{
     154  rtems_status_code sc;
    150155  uintptr_t pattern_0 = (uintptr_t) 0xaaaaaaaaaaaaaaaaU;
    151156  uintptr_t pattern_1 = (uintptr_t) 0x5555555555555555U;
     
    154159
    155160  self->control_task = rtems_task_self();
    156 
    157   start_validate_task(&self->validate_tasks[0], pattern_0, PRIORITY_LOW);
    158   start_validate_task(&self->validate_tasks[1], pattern_1, PRIORITY_HIGH);
     161  start_validate_task(
     162    &self->validate_tasks[0],
     163    pattern_0,
     164    PRIORITY_LOW,
     165    task_0_fpu
     166  );
     167  start_validate_task(
     168    &self->validate_tasks[1],
     169    pattern_1,
     170    PRIORITY_HIGH,
     171    task_1_fpu
     172  );
    159173  start_timer(self);
    160174  wait_for_finish();
     175
     176  sc = rtems_task_delete(self->validate_tasks[0]);
     177  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     178
     179  sc = rtems_task_delete(self->validate_tasks[1]);
     180  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     181
     182  sc = rtems_timer_delete(self->timer);
     183  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    161184}
    162185
     
    208231
    209232  test_context_is_executing();
    210   test(self);
     233  test(self, false, false);
     234  printf("Both tasks did not use FPU: done\n");
     235  test(self, false, true);
     236  printf("One task used the FPU: done\n");
     237  test(self, true, true);
     238  printf("Both tasks used the FPU: done\n");
    211239
    212240  TEST_END();
  • testsuites/sptests/spcontext01/spcontext01.scn

    ra6502a58 r5b9dfff5  
    1 *** TEST SPCONTEXT 1 ***
     1*** BEGIN OF TEST SPCONTEXT 1 ***
     2Both tasks did not use FPU: done
     3One task used the FPU: done
     4Both tasks used the FPU: done
    25*** END OF TEST SPCONTEXT 1 ***
Note: See TracChangeset for help on using the changeset viewer.