forked from Imagelibrary/rtems
2010-07-25 Joel Sherrill <joel.sherrill@oarcorp.com>
* gxx01/gxx01.scn, gxx01/init.c: Add more testcases.
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2010-07-25 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
|
* gxx01/gxx01.scn, gxx01/init.c: Add more testcases.
|
||||||
|
|
||||||
2010-07-22 Bharath Suri <bharath.s.jois@gmail.com>
|
2010-07-22 Bharath Suri <bharath.s.jois@gmail.com>
|
||||||
|
|
||||||
* devfs02/init.c, devfs02/devfs02.doc, devfs02/devfs02.scn,
|
* devfs02/init.c, devfs02/devfs02.doc, devfs02/devfs02.scn,
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ rtems_gxx_recursive_mutex_unlock() - Unnest
|
|||||||
rtems_gxx_recursive_mutex_unlock() - OK
|
rtems_gxx_recursive_mutex_unlock() - OK
|
||||||
rtems_gxx_recursive_mutex_lock() - OK
|
rtems_gxx_recursive_mutex_lock() - OK
|
||||||
rtems_gxx_recursive_mutex_unlock() - OK
|
rtems_gxx_recursive_mutex_unlock() - OK
|
||||||
|
rtems_gxx_mutex_destroy(mutex) - OK
|
||||||
|
rtems_gxx_mutex_destroy(mutex) - NOT OK
|
||||||
|
|
||||||
Call once method the first time
|
Call once method the first time
|
||||||
Running once method
|
Running once method
|
||||||
@@ -21,6 +23,12 @@ rtems_gxx_key_create(&key, NULL) - OK
|
|||||||
rtems_gxx_key_delete(key) - OK
|
rtems_gxx_key_delete(key) - OK
|
||||||
rtems_gxx_key_create(&key, key_dtor) - OK
|
rtems_gxx_key_create(&key, key_dtor) - OK
|
||||||
rtems_gxx_setspecific() - OK
|
rtems_gxx_setspecific() - OK
|
||||||
rtems_gxx_petspecific() - OK
|
rtems_gxx_getspecific(key) already existing - OK
|
||||||
rtems_gxx_key_delete(key) - OK
|
rtems_gxx_key_delete(key) - OK
|
||||||
|
rtems_gxx_getspecific(key_for_testing) non-existent - OK
|
||||||
|
rtems_gxx_key_delete(key_for_testing) - OK
|
||||||
|
|
||||||
|
rtems_gxx_mutex_init() until exhausted and panic
|
||||||
|
rtems_gxx_mutex_init
|
||||||
|
fatal error, exiting
|
||||||
*** END OF TEST GXX 01 ***
|
*** END OF TEST GXX 01 ***
|
||||||
|
|||||||
@@ -46,6 +46,14 @@ void test_recursive_mutex(void)
|
|||||||
puts( "rtems_gxx_recursive_mutex_unlock() - OK" );
|
puts( "rtems_gxx_recursive_mutex_unlock() - OK" );
|
||||||
sc = rtems_gxx_recursive_mutex_unlock(&mutex);
|
sc = rtems_gxx_recursive_mutex_unlock(&mutex);
|
||||||
rtems_test_assert( sc == 0 );
|
rtems_test_assert( sc == 0 );
|
||||||
|
|
||||||
|
puts( "rtems_gxx_mutex_destroy(mutex) - OK" );
|
||||||
|
sc = rtems_gxx_mutex_destroy(&mutex);
|
||||||
|
rtems_test_assert( sc == 0 );
|
||||||
|
|
||||||
|
puts( "rtems_gxx_mutex_destroy(mutex) - NOT OK" );
|
||||||
|
sc = rtems_gxx_mutex_destroy(&mutex);
|
||||||
|
rtems_test_assert( sc == -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_mutex(void)
|
void test_mutex(void)
|
||||||
@@ -97,6 +105,7 @@ void test_once(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
volatile bool key_dtor_ran;
|
volatile bool key_dtor_ran;
|
||||||
|
void *key_for_testing;
|
||||||
|
|
||||||
void key_dtor(void *ptr)
|
void key_dtor(void *ptr)
|
||||||
{
|
{
|
||||||
@@ -125,7 +134,7 @@ void test_key(void)
|
|||||||
sc = rtems_gxx_setspecific(key, (void *)0x1234);
|
sc = rtems_gxx_setspecific(key, (void *)0x1234);
|
||||||
rtems_test_assert( sc == 0 );
|
rtems_test_assert( sc == 0 );
|
||||||
|
|
||||||
puts( "rtems_gxx_petspecific() - OK" );
|
puts( "rtems_gxx_getspecific(key) already existing - OK" );
|
||||||
p = rtems_gxx_getspecific(key);
|
p = rtems_gxx_getspecific(key);
|
||||||
rtems_test_assert( p == (void *)0x1234 );
|
rtems_test_assert( p == (void *)0x1234 );
|
||||||
|
|
||||||
@@ -134,12 +143,38 @@ void test_key(void)
|
|||||||
rtems_test_assert( sc == 0 );
|
rtems_test_assert( sc == 0 );
|
||||||
rtems_test_assert( key_dtor_ran == true );
|
rtems_test_assert( key_dtor_ran == true );
|
||||||
|
|
||||||
#if 0
|
puts( "rtems_gxx_getspecific(key_for_testing) non-existent - OK" );
|
||||||
|
p = rtems_gxx_getspecific((__gthread_key_t) &key_for_testing);
|
||||||
|
rtems_test_assert( p == NULL );
|
||||||
|
rtems_test_assert( key_for_testing == NULL );
|
||||||
|
|
||||||
void *rtems_gxx_getspecific(__gthread_key_t key);
|
key_for_testing = malloc(4);
|
||||||
|
rtems_test_assert( key_for_testing != NULL );
|
||||||
|
|
||||||
int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr);
|
puts( "rtems_gxx_key_delete(key_for_testing) - OK" );
|
||||||
#endif
|
sc = rtems_gxx_key_delete((__gthread_key_t) &key_for_testing);
|
||||||
|
rtems_test_assert( sc == 0 );
|
||||||
|
rtems_test_assert( key_for_testing == NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void _exit(int status) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
|
||||||
|
|
||||||
|
void _exit(int status)
|
||||||
|
{
|
||||||
|
puts( "*** END OF TEST GXX 01 ***" );
|
||||||
|
|
||||||
|
rtems_shutdown_executive(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_out_of_mutexes(void)
|
||||||
|
{
|
||||||
|
__gthread_mutex_t mutex;
|
||||||
|
|
||||||
|
puts( "rtems_gxx_mutex_init() until exhausted and panic" );
|
||||||
|
while (1) {
|
||||||
|
rtems_gxx_mutex_init(&mutex);
|
||||||
|
rtems_test_assert( mutex != 0 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rtems_task Init(
|
rtems_task Init(
|
||||||
@@ -158,10 +193,11 @@ rtems_task Init(
|
|||||||
puts( "" );
|
puts( "" );
|
||||||
|
|
||||||
test_key();
|
test_key();
|
||||||
|
puts( "" );
|
||||||
|
|
||||||
puts( "*** END OF TEST GXX 01 ***" );
|
test_out_of_mutexes();
|
||||||
|
|
||||||
rtems_test_exit(0);
|
/* does not return */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* configuration information */
|
/* configuration information */
|
||||||
|
|||||||
Reference in New Issue
Block a user