Changeset 66c348cb in rtems
- Timestamp:
- Feb 1, 2008, 12:45:08 AM (13 years ago)
- Branches:
- 4.10, 4.11, 4.9, 5, master
- Children:
- 2186ba80
- Parents:
- 81fed4b
- Location:
- testsuites/psxtests
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/psxtests/ChangeLog
r81fed4b r66c348cb 1 2008-01-31 Joel Sherrill <joel.sherrill@OARcorp.com> 2 3 * include/pmacros.h, psx01/init.c, psx01/system.h, psx13/main.c, 4 psxbarrier01/main.c, psxchroot01/main.c, psxfatal_support/init.c, 5 psxfile01/main.c, psxfile01/test.c, psxmount/main.c, psxrdwrv/main.c, 6 psxreaddir/main.c, psxrwlock01/main.c, psxspin01/main.c, 7 psxstat/main.c, psxtime/main.c: Change TEST_INIT to CONFIGURE_INIT. 8 Make tmacros.h available to all POSIX tests. Add a clock_settime case 9 for < 1988. 10 1 11 2008-01-31 Joel Sherrill <joel.sherrill@OARcorp.com> 2 12 -
testsuites/psxtests/include/pmacros.h
r81fed4b r66c348cb 16 16 #include <unistd.h> 17 17 18 #include <tmacros.h> 18 19 #include <buffer_test_io.h> 19 20 … … 43 44 #define TM_DECEMBER 12 44 45 45 #ifndef build_time46 #define build_time( TM, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ) \46 #ifndef tm_build_time 47 #define tm_build_time( TM, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ) \ 47 48 { (TM)->tm_year = YR; \ 48 49 (TM)->tm_mon = MON; \ … … 60 61 int status; \ 61 62 \ 62 build_time( &tm, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ); \63 tm_build_time( &tm, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ); \ 63 64 \ 64 65 tv.tv_sec = mktime( &tm ); \ -
testsuites/psxtests/psx01/init.c
r81fed4b r66c348cb 33 33 puts( "\n\n*** POSIX TEST 1 ***" ); 34 34 35 build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );35 tm_build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); 36 36 37 37 /* print some system information */ … … 39 39 puts( "Init: uname - EFAULT (invalid uts pointer argument)" ); 40 40 status = uname( NULL ); 41 assert( status == -1 );42 assert( errno == EFAULT );41 rtems_test_assert( status == -1 ); 42 rtems_test_assert( errno == EFAULT ); 43 43 44 44 status = uname( &uts ); 45 assert( !status );45 rtems_test_assert( !status ); 46 46 printf( "Init: uts.sysname: %s\n", uts.sysname ); 47 47 printf( "Init: uts.nodename: %s\n", uts.nodename ); … … 55 55 puts( "Init: clock_gettime - EINVAL (NULL timespec)" ); 56 56 status = clock_gettime( CLOCK_REALTIME, NULL ); 57 assert( status == -1 );58 assert( errno == EINVAL );57 rtems_test_assert( status == -1 ); 58 rtems_test_assert( errno == EINVAL ); 59 59 60 60 puts( "Init: clock_gettime - EINVAL (invalid clockid)" ); 61 61 status = clock_gettime( -1, &tv ); 62 assert( status == -1 );63 assert( errno == EINVAL );62 rtems_test_assert( status == -1 ); 63 rtems_test_assert( errno == EINVAL ); 64 64 65 65 puts( "Init: clock_settime - EINVAL (invalid clockid)" ); 66 66 status = clock_settime( -1, &tv ); 67 assert( status == -1 ); 68 assert( errno == EINVAL ); 67 rtems_test_assert( status == -1 ); 68 rtems_test_assert( errno == EINVAL ); 69 70 /* way back near the dawn of time :D */ 71 tv.tv_sec = 1; 72 tv.tv_nsec = 0; 73 printf( ctime( &tv.tv_sec ) ); 74 puts( "Init: clock_settime - before 1988 EINVAL" ); 75 status = clock_settime( CLOCK_REALTIME, &tv ); 76 rtems_test_assert( status == -1 ); 77 rtems_test_assert( errno == EINVAL ); 69 78 70 79 /* exercise clock_getres */ … … 72 81 puts( "Init: clock_getres - EINVAL (invalid clockid)" ); 73 82 status = clock_getres( -1, &tv ); 74 assert( status == -1 );75 assert( errno == EINVAL );83 rtems_test_assert( status == -1 ); 84 rtems_test_assert( errno == EINVAL ); 76 85 77 86 puts( "Init: clock_getres - EINVAL (NULL resolution)" ); 78 87 status = clock_getres( CLOCK_REALTIME, NULL ); 79 assert( status == -1 );80 assert( errno == EINVAL );88 rtems_test_assert( status == -1 ); 89 rtems_test_assert( errno == EINVAL ); 81 90 82 91 puts( "Init: clock_getres - SUCCESSFUL" ); 83 92 status = clock_getres( CLOCK_REALTIME, &tv ); 84 93 printf( "Init: resolution = sec (%ld), nsec (%ld)\n", tv.tv_sec, tv.tv_nsec ); 85 assert( !status );94 rtems_test_assert( !status ); 86 95 87 96 /* set the time of day, and print our buffer in multiple ways */ 88 97 89 98 tv.tv_sec = mktime( &tm ); 90 assert( tv.tv_sec != -1 );99 rtems_test_assert( tv.tv_sec != -1 ); 91 100 92 101 tv.tv_nsec = 0; … … 99 108 puts( "Init: clock_settime - SUCCESSFUL" ); 100 109 status = clock_settime( CLOCK_REALTIME, &tv ); 101 assert( !status );110 rtems_test_assert( !status ); 102 111 103 112 printf( asctime( &tm ) ); … … 107 116 108 117 remaining = sleep( 3 ); 109 assert( !remaining );118 rtems_test_assert( !remaining ); 110 119 111 120 /* print new times to make sure it has changed and we can get the realtime */ 112 121 status = clock_gettime( CLOCK_PROCESS_CPUTIME, &tv ); 113 assert( !status );122 rtems_test_assert( !status ); 114 123 printf("Time since boot: (%d, %d)\n", tv.tv_sec,tv.tv_nsec ); 115 124 116 125 status = clock_gettime( CLOCK_REALTIME, &tv ); 117 assert( !status );126 rtems_test_assert( !status ); 118 127 119 128 printf( ctime( &tv.tv_sec ) ); … … 125 134 126 135 seconds = time( &seconds1 ); 127 assert( seconds == seconds1 );136 rtems_test_assert( seconds == seconds1 ); 128 137 129 138 /* check the time remaining */ 130 139 131 140 printf( "Init: seconds remaining (%d)\n", (int)remaining ); 132 assert( !remaining );141 rtems_test_assert( !remaining ); 133 142 134 143 /* error cases in nanosleep */ … … 137 146 puts( "Init: nanosleep - EINVAL (NULL time)" ); 138 147 status = nanosleep ( NULL, &tr ); 139 assert( status == -1 );140 assert( errno == EINVAL );148 rtems_test_assert( status == -1 ); 149 rtems_test_assert( errno == EINVAL ); 141 150 142 151 tv.tv_sec = 0; … … 144 153 puts( "Init: nanosleep - EINVAL (too many nanoseconds)" ); 145 154 status = nanosleep ( &tv, &tr ); 146 assert( status == -1 );147 assert( errno == EINVAL );155 rtems_test_assert( status == -1 ); 156 rtems_test_assert( errno == EINVAL ); 148 157 149 158 /* this is actually a small delay or yield */ … … 152 161 puts( "Init: nanosleep - negative seconds small delay " ); 153 162 status = nanosleep ( &tv, &tr ); 154 assert( status == -1 );155 assert( errno == EINVAL );163 rtems_test_assert( status == -1 ); 164 rtems_test_assert( errno == EINVAL ); 156 165 157 166 /* use nanosleep to yield */ … … 162 171 puts( "Init: nanosleep - yield" ); 163 172 status = nanosleep ( &tv, &tr ); 164 assert( !status );165 assert( !tr.tv_sec );166 assert( !tr.tv_nsec );173 rtems_test_assert( !status ); 174 rtems_test_assert( !tr.tv_sec ); 175 rtems_test_assert( !tr.tv_nsec ); 167 176 168 177 /* use nanosleep to delay */ … … 173 182 puts( "Init: nanosleep - 1.05 seconds" ); 174 183 status = nanosleep ( &tv, &tr ); 175 assert( !status );184 rtems_test_assert( !status ); 176 185 177 186 /* print the current real time again */ 178 187 status = clock_gettime( CLOCK_REALTIME, &tv ); 179 assert( !status );188 rtems_test_assert( !status ); 180 189 printf( ctime( &tv.tv_sec ) ); 181 190 … … 183 192 184 193 printf( "Init: sec (%ld), nsec (%ld) remaining\n", tr.tv_sec, tr.tv_nsec ); 185 assert( !tr.tv_sec && !tr.tv_nsec );194 rtems_test_assert( !tr.tv_sec && !tr.tv_nsec ); 186 195 187 196 puts( "Init: usleep - 1.35 seconds" ); 188 197 useconds = usleep ( 1350000 ); 189 assert( useconds < 1350000);198 rtems_test_assert( useconds < 1350000); 190 199 191 200 /* print the current real time again */ 192 201 status = clock_gettime( CLOCK_REALTIME, &tv ); 193 assert( !status );202 rtems_test_assert( !status ); 194 203 printf( ctime( &tv.tv_sec ) ); 195 204 … … 203 212 priority = sched_get_priority_min( SCHED_FIFO ); 204 213 printf( "Init: sched_get_priority_min (SCHED_FIFO) -- %d\n", priority ); 205 assert( priority != -1 );214 rtems_test_assert( priority != -1 ); 206 215 207 216 puts( "Init: sched_get_priority_min -- EINVAL (invalid policy)" ); 208 217 priority = sched_get_priority_min( -1 ); 209 assert( priority == -1 );210 assert( errno == EINVAL );218 rtems_test_assert( priority == -1 ); 219 rtems_test_assert( errno == EINVAL ); 211 220 212 221 /* exercise get maximum priority */ … … 214 223 priority = sched_get_priority_max( SCHED_FIFO ); 215 224 printf( "Init: sched_get_priority_max (SCHED_FIFO) -- %d\n", priority ); 216 assert( priority != -1 );225 rtems_test_assert( priority != -1 ); 217 226 218 227 puts( "Init: sched_get_priority_max -- EINVAL (invalid policy)" ); 219 228 priority = sched_get_priority_max( -1 ); 220 assert( priority == -1 );221 assert( errno == EINVAL );229 rtems_test_assert( priority == -1 ); 230 rtems_test_assert( errno == EINVAL ); 222 231 223 232 puts( "Init: sched_rr_get_interval -- ESRCH (invalid PID)" ); 224 233 status = sched_rr_get_interval( 4, &tr ); 225 assert( status == -1 );226 assert( errno == ESRCH );234 rtems_test_assert( status == -1 ); 235 rtems_test_assert( errno == ESRCH ); 227 236 228 237 puts( "Init: sched_rr_get_interval -- EINVAL (invalid interval pointer)" ); 229 238 status = sched_rr_get_interval( getpid(), NULL ); 230 assert( status == -1 );231 assert( errno == EINVAL );239 rtems_test_assert( status == -1 ); 240 rtems_test_assert( errno == EINVAL ); 232 241 233 242 /* print the round robin time quantum */ … … 239 248 tr.tv_nsec 240 249 ); 241 assert( !status );250 rtems_test_assert( !status ); 242 251 243 252 /* create a thread */ … … 245 254 puts( "Init: pthread_create - SUCCESSFUL" ); 246 255 status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL ); 247 assert( !status );256 rtems_test_assert( !status ); 248 257 249 258 /* too may threads error */ … … 251 260 puts( "Init: pthread_create - EAGAIN (too many threads)" ); 252 261 status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL ); 253 assert( status == EAGAIN );262 rtems_test_assert( status == EAGAIN ); 254 263 255 264 puts( "Init: sched_yield to Task_1" ); 256 265 status = sched_yield(); 257 assert( !status );266 rtems_test_assert( !status ); 258 267 259 268 /* switch to Task_1 */ -
testsuites/psxtests/psx01/system.h
r81fed4b r66c348cb 42 42 /* global variables */ 43 43 44 #ifdef CONFIGURE_INIT45 #define TEST_EXTERN46 #else47 #define TEST_EXTERN extern48 #endif49 50 44 TEST_EXTERN pthread_t Init_id; 51 45 TEST_EXTERN pthread_t Task_id; -
testsuites/psxtests/psx13/main.c
r81fed4b r66c348cb 12 12 */ 13 13 14 #define TEST_INIT14 #define CONFIGURE_INIT 15 15 16 16 #include <bsp.h> -
testsuites/psxtests/psxbarrier01/main.c
r81fed4b r66c348cb 12 12 */ 13 13 14 #define TEST_INIT14 #define CONFIGURE_INIT 15 15 16 16 #include <bsp.h> -
testsuites/psxtests/psxchroot01/main.c
r81fed4b r66c348cb 3 3 */ 4 4 5 #define TEST_INIT5 #define CONFIGURE_INIT 6 6 7 7 #include <bsp.h> -
testsuites/psxtests/psxfatal_support/init.c
r81fed4b r66c348cb 22 22 */ 23 23 24 #define TEST_INIT24 #define CONFIGURE_INIT 25 25 #include "system.h" 26 26 -
testsuites/psxtests/psxfile01/main.c
r81fed4b r66c348cb 12 12 */ 13 13 14 #define TEST_INIT14 #define CONFIGURE_INIT 15 15 16 16 #include <bsp.h> -
testsuites/psxtests/psxfile01/test.c
r81fed4b r66c348cb 23 23 #include <stdio.h> 24 24 25 #include < tmacros.h>25 #include <pmacros.h> 26 26 #include <sys/types.h> 27 27 #include <sys/stat.h> -
testsuites/psxtests/psxmount/main.c
r81fed4b r66c348cb 5 5 */ 6 6 7 #define TEST_INIT7 #define CONFIGURE_INIT 8 8 9 9 #include <bsp.h> -
testsuites/psxtests/psxrdwrv/main.c
r81fed4b r66c348cb 12 12 */ 13 13 14 #define TEST_INIT14 #define CONFIGURE_INIT 15 15 16 16 #include <bsp.h> -
testsuites/psxtests/psxreaddir/main.c
r81fed4b r66c348cb 3 3 */ 4 4 5 #define TEST_INIT5 #define CONFIGURE_INIT 6 6 7 7 #include <bsp.h> -
testsuites/psxtests/psxrwlock01/main.c
r81fed4b r66c348cb 12 12 */ 13 13 14 #define TEST_INIT14 #define CONFIGURE_INIT 15 15 16 16 #include <bsp.h> -
testsuites/psxtests/psxspin01/main.c
r81fed4b r66c348cb 12 12 */ 13 13 14 #define TEST_INIT14 #define CONFIGURE_INIT 15 15 16 16 #include <bsp.h> -
testsuites/psxtests/psxstat/main.c
r81fed4b r66c348cb 12 12 */ 13 13 14 #define TEST_INIT14 #define CONFIGURE_INIT 15 15 16 16 #include <bsp.h> -
testsuites/psxtests/psxtime/main.c
r81fed4b r66c348cb 12 12 */ 13 13 14 #define TEST_INIT14 #define CONFIGURE_INIT 15 15 16 16 #include <bsp.h>
Note: See TracChangeset
for help on using the changeset viewer.