Changeset 5da2ae8 in rtems
- Timestamp:
- 08/12/96 21:15:15 (27 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 08515de
- Parents:
- 1087564
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/tests/psxtests/psx01/init.c
r1087564 r5da2ae8 31 31 puts( "\n\n*** POSIX TEST 1 ***" ); 32 32 33 /* error cases in clock_gettime and clock_settime */ 34 35 puts( "Init: clock_gettime - EINVAL (invalid clockid)" ); 36 status = clock_settime( -1, &tv ); 37 assert( status == -1 ); 38 assert( errno == EINVAL ); 39 40 puts( "Init: clock_settime - EINVAL (invalid clockid)" ); 41 status = clock_settime( -1, &tv ); 42 assert( status == -1 ); 43 assert( errno == EINVAL ); 44 45 /* exercise clock_getres */ 46 47 puts( "Init: clock_getres - EINVAL (invalid clockid)" ); 48 status = clock_getres( -1, &tv ); 49 assert( status == -1 ); 50 assert( errno == EINVAL ); 51 52 puts( "Init: clock_getres - EINVAL (NULL resolution)" ); 53 status = clock_getres( CLOCK_REALTIME, NULL ); 54 assert( status == -1 ); 55 assert( errno == EINVAL ); 56 57 puts( "Init: clock_getres - SUCCESSFUL" ); 58 status = clock_getres( CLOCK_REALTIME, &tv ); 59 printf( "Init: resolution = sec (%ld), nsec (%ld)\n", tv.tv_sec, tv.tv_nsec ); 60 assert( !status ); 61 33 62 /* set the time of day, and print our buffer in multiple ways */ 34 35 build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );36 63 37 64 tv.tv_sec = mktime( &tm ); … … 40 67 tv.tv_nsec = 0; 41 68 42 /* error cases in clock_gettime and clock_settime */43 44 puts( "Init: clock_gettime - EINVAL (invalid clockid)" );45 status = clock_settime( -1, &tv );46 assert( status == -1 );47 assert( errno == EINVAL );48 49 puts( "Init: clock_settime - EINVAL (invalid clockid)" );50 status = clock_settime( -1, &tv );51 assert( status == -1 );52 assert( errno == EINVAL );53 54 69 /* now set the time of day */ 70 71 empty_line(); 55 72 56 73 printf( asctime( &tm ) ); … … 89 106 /* error cases in nanosleep */ 90 107 108 empty_line(); 91 109 puts( "Init: nanosleep - EINVAL (NULL time)" ); 92 110 status = nanosleep ( NULL, &tr ); -
testsuites/psxtests/psx01/init.c
r1087564 r5da2ae8 31 31 puts( "\n\n*** POSIX TEST 1 ***" ); 32 32 33 /* error cases in clock_gettime and clock_settime */ 34 35 puts( "Init: clock_gettime - EINVAL (invalid clockid)" ); 36 status = clock_settime( -1, &tv ); 37 assert( status == -1 ); 38 assert( errno == EINVAL ); 39 40 puts( "Init: clock_settime - EINVAL (invalid clockid)" ); 41 status = clock_settime( -1, &tv ); 42 assert( status == -1 ); 43 assert( errno == EINVAL ); 44 45 /* exercise clock_getres */ 46 47 puts( "Init: clock_getres - EINVAL (invalid clockid)" ); 48 status = clock_getres( -1, &tv ); 49 assert( status == -1 ); 50 assert( errno == EINVAL ); 51 52 puts( "Init: clock_getres - EINVAL (NULL resolution)" ); 53 status = clock_getres( CLOCK_REALTIME, NULL ); 54 assert( status == -1 ); 55 assert( errno == EINVAL ); 56 57 puts( "Init: clock_getres - SUCCESSFUL" ); 58 status = clock_getres( CLOCK_REALTIME, &tv ); 59 printf( "Init: resolution = sec (%ld), nsec (%ld)\n", tv.tv_sec, tv.tv_nsec ); 60 assert( !status ); 61 33 62 /* set the time of day, and print our buffer in multiple ways */ 34 35 build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );36 63 37 64 tv.tv_sec = mktime( &tm ); … … 40 67 tv.tv_nsec = 0; 41 68 42 /* error cases in clock_gettime and clock_settime */43 44 puts( "Init: clock_gettime - EINVAL (invalid clockid)" );45 status = clock_settime( -1, &tv );46 assert( status == -1 );47 assert( errno == EINVAL );48 49 puts( "Init: clock_settime - EINVAL (invalid clockid)" );50 status = clock_settime( -1, &tv );51 assert( status == -1 );52 assert( errno == EINVAL );53 54 69 /* now set the time of day */ 70 71 empty_line(); 55 72 56 73 printf( asctime( &tm ) ); … … 89 106 /* error cases in nanosleep */ 90 107 108 empty_line(); 91 109 puts( "Init: nanosleep - EINVAL (NULL time)" ); 92 110 status = nanosleep ( NULL, &tr );
Note: See TracChangeset
for help on using the changeset viewer.