Changeset 841b54e in rtems for testsuites


Ignore:
Timestamp:
Nov 15, 2018, 10:31:21 PM (12 months ago)
Author:
Himanshu40 <himanshuwindows8.1@…>
Branches:
master
Children:
ccf11ce
Parents:
8abb230b
git-author:
Himanshu40 <himanshuwindows8.1@…> (11/15/18 22:31:21)
git-committer:
Joel Sherrill <joel@…> (11/15/18 22:40:47)
Message:

psxtmthreadattr01: Correct mistakes in previous merge (GCI 2018)

Joel admits to grabbing one iteration too early of the patch. :(

Location:
testsuites/psxtmtests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtmtests/psxtmtests_plan.csv

    r8abb230b r841b54e  
    2929"pthread_create: no preempt","psxtmthread01","psxtmtest_single","Yes"
    3030"pthread_create: preempt","psxtmthread02","psxtmtest_single","Yes"
    31 "pthread_attr_init: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
    32 "pthread_attr_destroy: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
     31
     32"pthread_attr_init: only case", "psxtmthreadattr01", "psxtmtest_init_destroy","Yes"
     33"pthread_attr_destroy: only case", "psxtmthreadattr01", "psxtmtest_init_destroy","Yes"
    3334"pthread_attr_getdetachstate: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
    3435"pthread_attr_getguardsize: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
     
    3839"pthread_attr_getscope: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
    3940"pthread_attr_getstack: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
    40 "pthread_attr_getstacksize: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
     41"pthread_attr_getstacksize: only case", "psxtmthreadattr01", "psxtmtest_single","yes"
    4142"pthread_attr_setdetachstate: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
    4243"pthread_attr_setguardsize: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
     
    4647"pthread_attr_setscope: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
    4748"pthread_attr_setstack: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
     49
    4850
    4951"pthread_join"
  • testsuites/psxtmtests/psxtmthreadattr01/init.c

    r8abb230b r841b54e  
    2626#include <timesys.h>
    2727#include <sched.h>
     28
    2829#define GUARDSIZE_TEST_VALUE 512
    2930#define STACKSIZE_TEST_VALUE 1024
     
    3839static size_t stacksize = STACKSIZE_TEST_VALUE;
    3940static struct sched_param param;
    40 static int var = 2;
    4141static void *stackaddr;
    4242
     
    8585  benchmark_timer_t end_time;
    8686  int  status;
    87   int tmp_var;
    88 
    89   benchmark_timer_initialize();
    90   status = pthread_attr_getdetachstate(&attr, &tmp_var);
    91   end_time = benchmark_timer_read();
    92   rtems_test_assert( status == 0 );
    93   rtems_test_assert( tmp_var == PTHREAD_CREATE_DETACHED );
     87  int detachstate;
     88
     89  benchmark_timer_initialize();
     90  status = pthread_attr_getdetachstate(&attr, &detachstate);
     91  end_time = benchmark_timer_read();
     92  rtems_test_assert( status == 0 );
     93  rtems_test_assert( detachstate == PTHREAD_CREATE_DETACHED );
    9494
    9595  put_time(
     
    169169  benchmark_timer_t end_time;
    170170  int  status;
    171   int tmp_var;
    172 
    173   benchmark_timer_initialize();
    174   status = pthread_attr_getinheritsched(&attr, &tmp_var);
    175   end_time = benchmark_timer_read();
    176   rtems_test_assert( status == 0 );
    177   rtems_test_assert( tmp_var == PTHREAD_EXPLICIT_SCHED );
     171  int inheritsched;
     172
     173  benchmark_timer_initialize();
     174  status = pthread_attr_getinheritsched(&attr, &inheritsched);
     175  end_time = benchmark_timer_read();
     176  rtems_test_assert( status == 0 );
     177  rtems_test_assert( inheritsched == PTHREAD_EXPLICIT_SCHED );
    178178
    179179  put_time(
     
    241241
    242242  benchmark_timer_initialize();
    243   status = pthread_attr_setschedpolicy(&attr, var);
     243  status = pthread_attr_setschedpolicy(&attr, SCHED_RR);
    244244  end_time = benchmark_timer_read();
    245245  rtems_test_assert( status == 0 );
     
    259259  benchmark_timer_t end_time;
    260260  int  status;
    261   int tmp_var;
    262 
    263   benchmark_timer_initialize();
    264   status = pthread_attr_getschedpolicy(&attr, &tmp_var);
    265   end_time = benchmark_timer_read();
    266   rtems_test_assert( status == 0 );
    267   rtems_test_assert( tmp_var == var );
     261  int policy;
     262
     263  benchmark_timer_initialize();
     264  status = pthread_attr_getschedpolicy(&attr, &policy);
     265  end_time = benchmark_timer_read();
     266  rtems_test_assert( status == 0 );
     267  rtems_test_assert( policy == SCHED_RR );
    268268
    269269  put_time(
Note: See TracChangeset for help on using the changeset viewer.