Changeset 21275b58 in rtems for testsuites


Ignore:
Timestamp:
Nov 22, 2018, 6:14:51 PM (13 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
6b0a729b
Parents:
0f5b2c09
git-author:
Sebastian Huber <sebastian.huber@…> (11/22/18 18:14:51)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/14/18 06:03:29)
Message:

score: Static Objects_Information initialization

Statically allocate the objects information together with the initial
set of objects either via <rtems/confdefs.h>. Provide default object
informations with zero objects via librtemscpu.a. This greatly
simplifies the workspace size estimate. RTEMS applications which do not
use the unlimited objects option are easier to debug since all objects
reside now in statically allocated objects of the right types.

Close #3621.

Location:
testsuites
Files:
3 deleted
7 edited

Legend:

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

    r0f5b2c09 r21275b58  
    2323const char rtems_test_name[] = "PSXOBJ 1";
    2424
    25 /* forward declarations to avoid warnings */
    26 rtems_task Init(rtems_task_argument ignored);
     25typedef struct {
     26  Objects_Control Object;
     27} Test_Control;
    2728
    28 rtems_task Init(
     29/* very fake object class to test with */
     30OBJECTS_INFORMATION_DEFINE( Test, 1, 4, Test_Control, 0, 10, NULL );
     31
     32static rtems_task Init(
    2933  rtems_task_argument ignored
    3034)
    3135{
    3236  Objects_Get_by_name_error  error;
    33   Objects_Information        TestClass;
    3437  Objects_Control           *the_object;
    3538  char                       name[64];
     
    3942  TEST_BEGIN();
    4043
    41   /* very fake object class to test with */
    42   _Objects_Initialize_information(
    43     &TestClass,
    44     1,           /* the_api */
    45     4,           /* the_class */
    46     0,           /* maximum */
    47     4,           /* size */
    48     10,          /* maximum_name_length */
    49     NULL         /* Objects_Thread_queue_Extract_callout extract */
    50   );
    51 
    52 
    5344  puts( "INIT - _Objects_Get_by_name - NULL name" );
    5445  _Objects_Allocator_lock();
    55   the_object = _Objects_Get_by_name( &TestClass, NULL, NULL, &error );
     46  the_object = _Objects_Get_by_name( &Test_Information, NULL, NULL, &error );
    5647  _Objects_Allocator_unlock();
    5748  rtems_test_assert( the_object == NULL );
     
    6152  strcpy( name, "TOOOOOOOOOOOOOOOOOO LONG" );
    6253  _Objects_Allocator_lock();
    63   the_object = _Objects_Get_by_name( &TestClass, name, NULL, &error );
     54  the_object = _Objects_Get_by_name( &Test_Information, name, NULL, &error );
    6455  _Objects_Allocator_unlock();
    6556  rtems_test_assert( the_object == NULL );
     
    7061  name_len = 123;
    7162  _Objects_Allocator_lock();
    72   the_object = _Objects_Get_by_name( &TestClass, name, &name_len, &error );
     63  the_object = _Objects_Get_by_name( &Test_Information, name, &name_len, &error );
    7364  _Objects_Allocator_unlock();
    7465  rtems_test_assert( the_object == NULL );
     
    8071  rtems_workspace_greedy_allocate( NULL, 0 );
    8172
    82   bc = _Objects_Set_name( &TestClass, &_Thread_Get_executing()->Object, name );
     73  bc = _Objects_Set_name(
     74    &Test_Information,
     75    &_Thread_Get_executing()->Object,
     76    name
     77  );
    8378  rtems_test_assert( bc == false );
    8479
  • testsuites/sptests/Makefile.am

    r0f5b2c09 r21275b58  
    984984spfatal12_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal12) \
    985985        $(support_includes) -I$(top_srcdir)/spfatal12
    986 endif
    987 
    988 if TEST_spfatal13
    989 sp_tests += spfatal13
    990 sp_screens += spfatal13/spfatal13.scn
    991 sp_docs += spfatal13/spfatal13.doc
    992 spfatal13_SOURCES = spfatal_support/init.c spfatal_support/system.h \
    993         spfatal13/testcase.h
    994 spfatal13_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal13) \
    995         $(support_includes) -I$(top_srcdir)/spfatal13
    996986endif
    997987
  • testsuites/sptests/configure.ac

    r0f5b2c09 r21275b58  
    147147RTEMS_TEST_CHECK([spfatal11])
    148148RTEMS_TEST_CHECK([spfatal12])
    149 RTEMS_TEST_CHECK([spfatal13])
    150149RTEMS_TEST_CHECK([spfatal14])
    151150RTEMS_TEST_CHECK([spfatal15])
  • testsuites/sptests/spfreechain01/init.c

    r0f5b2c09 r21275b58  
    2626    Freechain_Control fc;
    2727    test_node *node;
     28    test_node node2;
    2829
    2930    TEST_BEGIN();
    3031
     32    _Freechain_Initialize(&fc, &node2, 1, sizeof(node2));
     33    rtems_test_assert(_Chain_Node_count_unprotected(&fc.Free) == 1);
     34    rtems_test_assert(_Chain_First(&fc.Free) == &node2.Node);
     35    rtems_test_assert(_Chain_Last(&fc.Free) == &node2.Node);
     36
    3137    _Freechain_Initialize(&fc, NULL, 0, sizeof(test_node));
    32     rtems_test_assert(_Chain_Is_empty(&fc.Free));
    33 
    34     _Freechain_Initialize(&fc, malloc, 1, SIZE_MAX);
    3538    rtems_test_assert(_Chain_Is_empty(&fc.Free));
    3639
  • testsuites/sptests/spsimplesched02/init.c

    r0f5b2c09 r21275b58  
    8282
    8383  status = _Objects_Name_to_id_u32(
    84     &_Thread_Internal_information.Objects,
     84    &_Thread_Information.Objects,
    8585    rtems_build_name( 'I', 'D', 'L', 'E' ),
    8686    RTEMS_SEARCH_LOCAL_NODE,
  • testsuites/sptests/spsize/size.c

    r0f5b2c09 r21275b58  
    369369                (sizeof _Thread_Allocated_fp)             +
    370370#endif
    371                 (sizeof _Thread_Internal_information)     +
     371                (sizeof _Thread_Information)     +
    372372
    373373/*threadq.h*/
  • testsuites/sptests/spsysinit01/init.c

    r0f5b2c09 r21275b58  
    2020
    2121#include <sys/types.h>
     22#include <sys/mman.h>
    2223#include <sys/stat.h>
    2324
    2425#include <assert.h>
     26#include <fcntl.h>
     27#include <mqueue.h>
    2528#include <pthread.h>
     29#include <semaphore.h>
     30#include <signal.h>
     31#include <stdlib.h>
    2632#include <string.h>
    27 #include <stdlib.h>
     33#include <time.h>
    2834#include <unistd.h>
    2935
     
    189195}
    190196
     197static bool info_not_init(const Objects_Information *info)
     198{
     199  return _Chain_Is_empty(&info->Inactive);
     200}
     201
     202static bool info_is_init(const Objects_Information *info, size_t count)
     203{
     204  return _Chain_Node_count_unprotected(&info->Inactive) == count;
     205}
     206
    191207FIRST(RTEMS_SYSINIT_BSP_WORK_AREAS)
    192208{
     
    249265FIRST(RTEMS_SYSINIT_DATA_STRUCTURES)
    250266{
    251   assert(
    252     _Objects_Get_maximum_index(&_Thread_Internal_information.Objects) == 0
    253   );
     267  assert(info_not_init(&_Thread_Information.Objects));
    254268  next_step(DATA_STRUCTURES_PRE);
    255269}
     
    257271LAST(RTEMS_SYSINIT_DATA_STRUCTURES)
    258272{
    259   assert(
    260     _Objects_Get_maximum_index(&_Thread_Internal_information.Objects) != 0
    261   );
     273  assert(info_is_init(&_Thread_Information.Objects, 1));
    262274  next_step(DATA_STRUCTURES_POST);
    263275}
     
    265277FIRST(RTEMS_SYSINIT_USER_EXTENSIONS)
    266278{
    267   assert(_Objects_Get_maximum_index(&_Extension_Information) == 0);
     279  assert(info_not_init(&_Extension_Information));
    268280  next_step(USER_EXTENSIONS_PRE);
    269281}
     
    271283LAST(RTEMS_SYSINIT_USER_EXTENSIONS)
    272284{
    273   assert(_Objects_Get_maximum_index(&_Extension_Information) != 0);
     285  assert(info_is_init(&_Extension_Information, 1));
    274286  next_step(USER_EXTENSIONS_POST);
    275287}
     
    277289FIRST(RTEMS_SYSINIT_CLASSIC_TASKS)
    278290{
    279   assert(_Objects_Get_maximum_index(&_RTEMS_tasks_Information.Objects) == 0);
     291  assert(info_not_init(&_RTEMS_tasks_Information.Objects));
    280292  next_step(CLASSIC_TASKS_PRE);
    281293}
     
    283295LAST(RTEMS_SYSINIT_CLASSIC_TASKS)
    284296{
    285   assert(_Objects_Get_maximum_index(&_RTEMS_tasks_Information.Objects) != 0);
     297  assert(info_is_init(&_RTEMS_tasks_Information.Objects, 2));
    286298  next_step(CLASSIC_TASKS_POST);
    287299}
     
    289301FIRST(RTEMS_SYSINIT_CLASSIC_TIMER)
    290302{
    291   assert(_Objects_Get_maximum_index(&_Timer_Information) == 0);
     303  assert(info_not_init(&_Timer_Information));
    292304  next_step(CLASSIC_TIMER_PRE);
    293305}
     
    295307LAST(RTEMS_SYSINIT_CLASSIC_TIMER)
    296308{
    297   assert(_Objects_Get_maximum_index(&_Timer_Information) != 0);
     309  assert(info_is_init(&_Timer_Information, 1));
    298310  next_step(CLASSIC_TIMER_POST);
    299311}
     
    323335FIRST(RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE)
    324336{
    325   assert(_Objects_Get_maximum_index(&_Message_queue_Information) == 0);
     337  assert(info_not_init(&_Message_queue_Information));
    326338  next_step(CLASSIC_MESSAGE_QUEUE_PRE);
    327339}
     
    329341LAST(RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE)
    330342{
    331   assert(_Objects_Get_maximum_index(&_Message_queue_Information) != 0);
     343  assert(info_is_init(&_Message_queue_Information, 1));
    332344  next_step(CLASSIC_MESSAGE_QUEUE_POST);
    333345}
     
    335347FIRST(RTEMS_SYSINIT_CLASSIC_SEMAPHORE)
    336348{
    337   assert(_Objects_Get_maximum_index(&_Semaphore_Information) == 0);
     349  assert(_Semaphore_Information.initial_objects[0].id == 0);
    338350  next_step(CLASSIC_SEMAPHORE_PRE);
    339351}
     
    341353LAST(RTEMS_SYSINIT_CLASSIC_SEMAPHORE)
    342354{
    343   assert(_Objects_Get_maximum_index(&_Semaphore_Information) != 0);
     355  assert(_Semaphore_Information.initial_objects[0].id != 0);
    344356  next_step(CLASSIC_SEMAPHORE_POST);
    345357}
     
    347359FIRST(RTEMS_SYSINIT_CLASSIC_PARTITION)
    348360{
    349   assert(_Objects_Get_maximum_index(&_Partition_Information) == 0);
     361  assert(info_not_init(&_Partition_Information));
    350362  next_step(CLASSIC_PARTITION_PRE);
    351363}
     
    353365LAST(RTEMS_SYSINIT_CLASSIC_PARTITION)
    354366{
    355   assert(_Objects_Get_maximum_index(&_Partition_Information) != 0);
     367  assert(info_is_init(&_Partition_Information, 1));
    356368  next_step(CLASSIC_PARTITION_POST);
    357369}
     
    359371FIRST(RTEMS_SYSINIT_CLASSIC_REGION)
    360372{
    361   assert(_Objects_Get_maximum_index(&_Region_Information) == 0);
     373  assert(info_not_init(&_Region_Information));
    362374  next_step(CLASSIC_REGION_PRE);
    363375}
     
    365377LAST(RTEMS_SYSINIT_CLASSIC_REGION)
    366378{
    367   assert(_Objects_Get_maximum_index(&_Region_Information) != 0);
     379  assert(info_is_init(&_Region_Information, 1));
    368380  next_step(CLASSIC_REGION_POST);
    369381}
     
    371383FIRST(RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY)
    372384{
    373   assert(_Objects_Get_maximum_index(&_Dual_ported_memory_Information) == 0);
     385  assert(info_not_init(&_Dual_ported_memory_Information));
    374386  next_step(CLASSIC_DUAL_PORTED_MEMORY_PRE);
    375387}
     
    377389LAST(RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY)
    378390{
    379   assert(_Objects_Get_maximum_index(&_Dual_ported_memory_Information) != 0);
     391  assert(info_is_init(&_Dual_ported_memory_Information, 1));
    380392  next_step(CLASSIC_DUAL_PORTED_MEMORY_POST);
    381393}
     
    383395FIRST(RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC)
    384396{
    385   assert(_Objects_Get_maximum_index(&_Rate_monotonic_Information) == 0);
     397  assert(info_not_init(&_Rate_monotonic_Information));
    386398  next_step(CLASSIC_RATE_MONOTONIC_PRE);
    387399}
     
    389401LAST(RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC)
    390402{
    391   assert(_Objects_Get_maximum_index(&_Rate_monotonic_Information) != 0);
     403  assert(info_is_init(&_Rate_monotonic_Information, 1));
    392404  next_step(CLASSIC_RATE_MONOTONIC_POST);
    393405}
     
    395407FIRST(RTEMS_SYSINIT_CLASSIC_BARRIER)
    396408{
    397   assert(_Objects_Get_maximum_index(&_Barrier_Information) == 0);
     409  assert(info_not_init(&_Barrier_Information));
    398410  next_step(CLASSIC_BARRIER_PRE);
    399411}
     
    401413LAST(RTEMS_SYSINIT_CLASSIC_BARRIER)
    402414{
    403   assert(_Objects_Get_maximum_index(&_Barrier_Information) != 0);
     415  assert(info_is_init(&_Barrier_Information, 1));
    404416  next_step(CLASSIC_BARRIER_POST);
    405417}
     
    433445FIRST(RTEMS_SYSINIT_POSIX_THREADS)
    434446{
    435   assert(_Objects_Get_maximum_index(&_POSIX_Threads_Information.Objects) == 0);
     447  assert(info_not_init(&_POSIX_Threads_Information.Objects));
    436448  next_step(POSIX_THREADS_PRE);
    437449}
     
    439451LAST(RTEMS_SYSINIT_POSIX_THREADS)
    440452{
    441   assert(_Objects_Get_maximum_index(&_POSIX_Threads_Information.Objects) != 0);
     453  assert(info_is_init(&_POSIX_Threads_Information.Objects, 1));
    442454  next_step(POSIX_THREADS_POST);
    443455}
     
    445457FIRST(RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE)
    446458{
    447   assert(_Objects_Get_maximum_index(&_POSIX_Message_queue_Information) == 0);
     459  assert(info_not_init(&_POSIX_Message_queue_Information));
    448460  next_step(POSIX_MESSAGE_QUEUE_PRE);
    449461}
     
    451463LAST(RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE)
    452464{
    453   assert(_Objects_Get_maximum_index(&_POSIX_Message_queue_Information) != 0);
     465  assert(info_is_init(&_POSIX_Message_queue_Information, 1));
    454466  next_step(POSIX_MESSAGE_QUEUE_POST);
    455467}
     
    457469FIRST(RTEMS_SYSINIT_POSIX_SEMAPHORE)
    458470{
    459   assert(_Objects_Get_maximum_index(&_POSIX_Semaphore_Information) == 0);
     471  assert(info_not_init(&_POSIX_Semaphore_Information));
    460472  next_step(POSIX_SEMAPHORE_PRE);
    461473}
     
    463475LAST(RTEMS_SYSINIT_POSIX_SEMAPHORE)
    464476{
    465   assert(_Objects_Get_maximum_index(&_POSIX_Semaphore_Information) != 0);
     477  assert(info_is_init(&_POSIX_Semaphore_Information, 1));
    466478  next_step(POSIX_SEMAPHORE_POST);
    467479}
     
    470482FIRST(RTEMS_SYSINIT_POSIX_TIMER)
    471483{
    472   assert(_Objects_Get_maximum_index(&_POSIX_Timer_Information) == 0);
     484  assert(info_not_init(&_POSIX_Timer_Information));
    473485  next_step(POSIX_TIMER_PRE);
    474486}
     
    476488LAST(RTEMS_SYSINIT_POSIX_TIMER)
    477489{
    478   assert(_Objects_Get_maximum_index(&_POSIX_Timer_Information) != 0);
     490  assert(info_is_init(&_POSIX_Timer_Information, 1));
    479491  next_step(POSIX_TIMER_POST);
    480492}
     
    483495FIRST(RTEMS_SYSINIT_POSIX_SHM)
    484496{
    485   assert(_Objects_Get_maximum_index(&_POSIX_Shm_Information) == 0);
     497  assert(info_not_init(&_POSIX_Shm_Information));
    486498  next_step(POSIX_SHM_PRE);
    487499}
     
    489501LAST(RTEMS_SYSINIT_POSIX_SHM)
    490502{
    491   assert(_Objects_Get_maximum_index(&_POSIX_Shm_Information) != 0);
     503  assert(info_is_init(&_POSIX_Shm_Information, 1));
    492504  next_step(POSIX_SHM_POST);
    493505}
     
    513525FIRST(RTEMS_SYSINIT_POSIX_KEYS)
    514526{
    515   assert(_Objects_Get_maximum_index(&_POSIX_Keys_Information) == 0);
     527  assert(info_not_init(&_POSIX_Keys_Information));
    516528  next_step(POSIX_KEYS_PRE);
    517529}
     
    519531LAST(RTEMS_SYSINIT_POSIX_KEYS)
    520532{
    521   assert(_Objects_Get_maximum_index(&_POSIX_Keys_Information) != 0);
     533  assert(info_is_init(&_POSIX_Keys_Information, 2));
    522534  next_step(POSIX_KEYS_POST);
    523535}
     
    658670LAST_STEP(LAST);
    659671
    660 static void Init(rtems_task_argument arg)
     672static void do_barrier_create(void)
     673{
     674  rtems_status_code sc;
     675  rtems_id id;
     676
     677  sc = rtems_barrier_create(
     678    rtems_build_name('T', 'E', 'S', 'T'),
     679    RTEMS_DEFAULT_ATTRIBUTES,
     680    1,
     681    &id
     682  );
     683  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     684
     685  sc = rtems_barrier_delete(id);
     686  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     687}
     688
     689static void do_extensions_create(void)
     690{
     691  rtems_status_code sc;
     692  rtems_id id;
     693  rtems_extensions_table table;
     694
     695  memset(&table, 0, sizeof(table));
     696  sc = rtems_extension_create(
     697    rtems_build_name('T', 'E', 'S', 'T'),
     698    &table,
     699    &id
     700  );
     701  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     702
     703  sc = rtems_extension_delete(id);
     704  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     705}
     706
     707static void do_message_queue_create(void)
     708{
     709  rtems_status_code sc;
     710  rtems_id id;
     711
     712  sc = rtems_message_queue_create(
     713    rtems_build_name('T', 'E', 'S', 'T'),
     714    1,
     715    1,
     716    RTEMS_DEFAULT_ATTRIBUTES,
     717    &id
     718  );
     719  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     720
     721  sc = rtems_message_queue_delete(id);
     722  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     723}
     724
     725static void do_partition_create(void)
     726{
     727  rtems_status_code sc;
     728  rtems_id id;
     729  long buf[32];
     730
     731  sc = rtems_partition_create(
     732    rtems_build_name('T', 'E', 'S', 'T'),
     733    buf,
     734    sizeof(buf),
     735    sizeof(buf),
     736    RTEMS_DEFAULT_ATTRIBUTES,
     737    &id
     738  );
     739  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     740
     741  sc = rtems_partition_delete(id);
     742  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     743}
     744
     745static void do_period_create(void)
     746{
     747  rtems_status_code sc;
     748  rtems_id id;
     749
     750  sc = rtems_rate_monotonic_create(
     751    rtems_build_name('T', 'E', 'S', 'T'),
     752    &id
     753  );
     754  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     755
     756  sc = rtems_rate_monotonic_delete(id);
     757  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     758}
     759
     760static void do_port_create(void)
     761{
     762  rtems_status_code sc;
     763  rtems_id id;
     764
     765  sc = rtems_port_create(
     766    rtems_build_name('T', 'E', 'S', 'T'),
     767    NULL,
     768    NULL,
     769    1,
     770    &id
     771  );
     772  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     773
     774  sc = rtems_port_delete(id);
     775  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     776}
     777
     778static void do_region_create(void)
     779{
     780  rtems_status_code sc;
     781  rtems_id id;
     782  long buf[32];
     783
     784  sc = rtems_region_create(
     785    rtems_build_name('T', 'E', 'S', 'T'),
     786    buf,
     787    sizeof(buf),
     788    1,
     789    RTEMS_DEFAULT_ATTRIBUTES,
     790    &id
     791  );
     792  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     793
     794  sc = rtems_region_delete(id);
     795  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     796}
     797
     798static void do_semaphore_create(void)
     799{
     800  rtems_status_code sc;
     801  rtems_id id;
     802
     803  sc = rtems_semaphore_create(
     804    rtems_build_name('T', 'E', 'S', 'T'),
     805    0,
     806    RTEMS_DEFAULT_ATTRIBUTES,
     807    0,
     808    &id
     809  );
     810  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     811
     812  sc = rtems_semaphore_delete(id);
     813  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     814}
     815
     816static void do_task_create(void)
     817{
     818  rtems_status_code sc;
     819  rtems_id id;
     820
     821  sc = rtems_task_create(
     822    rtems_build_name('T', 'E', 'S', 'T'),
     823    1,
     824    RTEMS_MINIMUM_STACK_SIZE,
     825    RTEMS_DEFAULT_MODES,
     826    RTEMS_DEFAULT_ATTRIBUTES,
     827    &id
     828  );
     829  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     830
     831  sc = rtems_task_delete(id);
     832  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     833}
     834
     835static void do_timer_create(void)
     836{
     837  rtems_status_code sc;
     838  rtems_id id;
     839
     840  sc = rtems_timer_create(rtems_build_name('T', 'E', 'S', 'T'), &id);
     841  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     842
     843  sc = rtems_timer_delete(id);
     844  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     845}
     846
     847static void do_cleanup_push_pop(void)
    661848{
    662849  pthread_cleanup_push(NULL, NULL);
    663850  pthread_cleanup_pop(0);
     851}
     852
     853static void do_posix_mq_open(void)
     854{
     855  struct mq_attr attr;
     856  mqd_t mq;
     857  int rv;
     858
     859  memset(&attr, 0, sizeof(attr));
     860  attr.mq_maxmsg = 1;
     861  attr.mq_msgsize = 1;
     862  mq = mq_open("mq", O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO, &attr);
     863  rtems_test_assert(mq != (mqd_t) -1);
     864
     865  rv = mq_close(mq);
     866  rtems_test_assert(rv == 0);
     867
     868  rv = mq_unlink("mq");
     869  rtems_test_assert(rv == 0);
     870}
     871
     872static void do_posix_sem_open(void)
     873{
     874  sem_t *sem;
     875  int rv;
     876
     877  sem = sem_open("sem", O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO);
     878  rtems_test_assert(sem != SEM_FAILED);
     879
     880  rv = sem_close(sem);
     881  rtems_test_assert(rv == 0);
     882
     883  rv = sem_unlink("sem");
     884  rtems_test_assert(rv == 0);
     885}
     886
     887static void do_posix_shm_open(void)
     888{
     889  int fd;
     890  int rv;
     891
     892  fd = shm_open("/shm", O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO);
     893  rtems_test_assert(fd >= 0);
     894
     895  rv = close(fd);
     896  rtems_test_assert(rv == 0);
     897
     898  rv = shm_unlink("/shm");
     899  rtems_test_assert(rv == 0);
     900}
     901
     902static void do_posix_timer_create(void)
     903{
     904#ifdef RTEMS_POSIX_API
     905  int rv;
     906  timer_t timer;
     907
     908  rv = timer_create(CLOCK_REALTIME, NULL, &timer);
     909  rtems_test_assert(rv == 0);
     910
     911  rv = timer_delete(timer);
     912  rtems_test_assert(rv == 0);
     913#endif /* RTEMS_POSIX_API */
     914}
     915
     916static void Init(rtems_task_argument arg)
     917{
    664918  next_step(INIT_TASK);
     919  do_barrier_create();
     920  do_extensions_create();
     921  do_message_queue_create();
     922  do_partition_create();
     923  do_period_create();
     924  do_port_create();
     925  do_region_create();
     926  do_semaphore_create();
     927  do_task_create();
     928  do_timer_create();
     929  do_cleanup_push_pop();
     930  do_posix_mq_open();
     931  do_posix_sem_open();
     932  do_posix_shm_open();
     933  do_posix_timer_create();
    665934  TEST_END();
    666935  exit(0);
     
    673942
    674943#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
     944
    675945#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
    676946
     947#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
     948
    677949#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
    678950
     
    691963#define CONFIGURE_MAXIMUM_SEMAPHORES 1
    692964
    693 #define CONFIGURE_MAXIMUM_TASKS 1
     965#define CONFIGURE_MAXIMUM_TASKS 2
    694966
    695967#define CONFIGURE_MAXIMUM_TIMERS 1
     
    711983#define CONFIGURE_MAXIMUM_POSIX_KEYS 1
    712984
     985#define CONFIGURE_MESSAGE_BUFFER_MEMORY \
     986  CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(1, 1)
     987
    713988#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    714989
Note: See TracChangeset for help on using the changeset viewer.