Changeset 972a8dba in rtems


Ignore:
Timestamp:
Jul 25, 2010, 2:53:37 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
39d3f8d
Parents:
cb87694
Message:

2010-07-25 Joel Sherrill <joel.sherrill@…>

  • gxx01/gxx01.scn, gxx01/init.c: Add more testcases.
Location:
testsuites/libtests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/ChangeLog

    rcb87694 r972a8dba  
     12010-07-25      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * gxx01/gxx01.scn, gxx01/init.c: Add more testcases.
     4
    152010-07-22      Bharath Suri <bharath.s.jois@gmail.com>
    26
  • testsuites/libtests/gxx01/gxx01.scn

    rcb87694 r972a8dba  
    1313rtems_gxx_recursive_mutex_lock() - OK
    1414rtems_gxx_recursive_mutex_unlock() - OK
     15rtems_gxx_mutex_destroy(mutex) - OK
     16rtems_gxx_mutex_destroy(mutex) - NOT OK
    1517
    1618Call once method the first time
     
    2224rtems_gxx_key_create(&key, key_dtor) - OK
    2325rtems_gxx_setspecific() - OK
    24 rtems_gxx_petspecific() - OK
     26rtems_gxx_getspecific(key) already existing - OK
    2527rtems_gxx_key_delete(key) - OK
     28rtems_gxx_getspecific(key_for_testing) non-existent - OK
     29rtems_gxx_key_delete(key_for_testing) - OK
     30
     31rtems_gxx_mutex_init() until exhausted and panic
     32rtems_gxx_mutex_init
     33fatal error, exiting
    2634*** END OF TEST GXX 01 ***
  • testsuites/libtests/gxx01/init.c

    rcb87694 r972a8dba  
    4747  sc = rtems_gxx_recursive_mutex_unlock(&mutex);
    4848  rtems_test_assert( sc == 0 );
     49
     50  puts( "rtems_gxx_mutex_destroy(mutex) - OK" );
     51  sc = rtems_gxx_mutex_destroy(&mutex);
     52  rtems_test_assert( sc == 0 );
     53
     54  puts( "rtems_gxx_mutex_destroy(mutex) - NOT OK" );
     55  sc = rtems_gxx_mutex_destroy(&mutex);
     56  rtems_test_assert( sc == -1 );
    4957}
    5058
     
    98106
    99107volatile bool key_dtor_ran;
     108void *key_for_testing;
    100109
    101110void key_dtor(void *ptr)
     
    126135  rtems_test_assert( sc == 0 );
    127136
    128   puts( "rtems_gxx_petspecific() - OK" );
     137  puts( "rtems_gxx_getspecific(key) already existing - OK" );
    129138  p = rtems_gxx_getspecific(key);
    130139  rtems_test_assert( p == (void *)0x1234 );
     
    135144  rtems_test_assert( key_dtor_ran == true );
    136145
    137 #if 0
    138 
    139 void *rtems_gxx_getspecific(__gthread_key_t key);
    140 
    141 int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr);
    142 #endif
     146  puts( "rtems_gxx_getspecific(key_for_testing) non-existent - OK" );
     147  p = rtems_gxx_getspecific((__gthread_key_t) &key_for_testing);
     148  rtems_test_assert( p == NULL );
     149  rtems_test_assert( key_for_testing == NULL );
     150
     151  key_for_testing = malloc(4);
     152  rtems_test_assert( key_for_testing != NULL );
     153 
     154  puts( "rtems_gxx_key_delete(key_for_testing) - OK" );
     155  sc = rtems_gxx_key_delete((__gthread_key_t) &key_for_testing);
     156  rtems_test_assert( sc == 0 );
     157  rtems_test_assert( key_for_testing == NULL );
     158}
     159
     160void _exit(int status) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
     161
     162void _exit(int status)
     163{
     164  puts( "*** END OF TEST GXX 01 ***" );
     165
     166  rtems_shutdown_executive(0);
     167}
     168
     169void test_out_of_mutexes(void)
     170{
     171   __gthread_mutex_t mutex;
     172
     173  puts( "rtems_gxx_mutex_init() until exhausted and panic" );
     174  while (1) {
     175    rtems_gxx_mutex_init(&mutex);
     176    rtems_test_assert( mutex != 0 );
     177  }
    143178}
    144179
     
    159194
    160195  test_key();
    161 
    162   puts( "*** END OF TEST GXX 01 ***" );
    163 
    164   rtems_test_exit(0);
     196  puts( "" );
     197
     198  test_out_of_mutexes();
     199
     200  /* does not return */
    165201}
    166202
Note: See TracChangeset for help on using the changeset viewer.