forked from Imagelibrary/rtems
added test case for non-NULL parameter to time()
This commit is contained in:
@@ -22,6 +22,7 @@ void *POSIX_Init(
|
|||||||
int priority;
|
int priority;
|
||||||
pthread_t thread_id;
|
pthread_t thread_id;
|
||||||
time_t seconds;
|
time_t seconds;
|
||||||
|
time_t seconds1;
|
||||||
time_t remaining;
|
time_t remaining;
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
struct timespec tv;
|
struct timespec tv;
|
||||||
@@ -59,6 +60,11 @@ void *POSIX_Init(
|
|||||||
seconds = time( NULL );
|
seconds = time( NULL );
|
||||||
printf( ctime( &seconds ) );
|
printf( ctime( &seconds ) );
|
||||||
|
|
||||||
|
/* just to have the value copied out through the parameter */
|
||||||
|
|
||||||
|
seconds = time( &seconds1 );
|
||||||
|
assert( seconds == seconds1 );
|
||||||
|
|
||||||
/* check the time remaining */
|
/* check the time remaining */
|
||||||
|
|
||||||
printf( "Init: seconds remaining (%d)\n", (int)remaining );
|
printf( "Init: seconds remaining (%d)\n", (int)remaining );
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ void *POSIX_Init(
|
|||||||
int priority;
|
int priority;
|
||||||
pthread_t thread_id;
|
pthread_t thread_id;
|
||||||
time_t seconds;
|
time_t seconds;
|
||||||
|
time_t seconds1;
|
||||||
time_t remaining;
|
time_t remaining;
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
struct timespec tv;
|
struct timespec tv;
|
||||||
@@ -59,6 +60,11 @@ void *POSIX_Init(
|
|||||||
seconds = time( NULL );
|
seconds = time( NULL );
|
||||||
printf( ctime( &seconds ) );
|
printf( ctime( &seconds ) );
|
||||||
|
|
||||||
|
/* just to have the value copied out through the parameter */
|
||||||
|
|
||||||
|
seconds = time( &seconds1 );
|
||||||
|
assert( seconds == seconds1 );
|
||||||
|
|
||||||
/* check the time remaining */
|
/* check the time remaining */
|
||||||
|
|
||||||
printf( "Init: seconds remaining (%d)\n", (int)remaining );
|
printf( "Init: seconds remaining (%d)\n", (int)remaining );
|
||||||
|
|||||||
Reference in New Issue
Block a user