Changeset 3fb7b70b in rtems
- Timestamp:
- 11/16/99 14:39:56 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- c276c87
- Parents:
- 56e61bb8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/tests/itrontests/itrontask02/init.c
r56e61bb8 r3fb7b70b 95 95 96 96 status = chg_pri( TSK_SELF, 8 ); 97 assert( status == E_OK);97 fatal_directive_status( status, E_OK, "chg_pri of TSK_SELF"); 98 98 status = ref_tsk( &pk_rtsk, TSK_SELF ); 99 assert( status == E_OK);100 assert( pk_rtsk.tskpri == 8);99 fatal_directive_status( status, E_OK, "ref_tsk of TSK_SELF"); 100 fatal_directive_status( pk_rtsk.tskpri, 8, "task priority of SELF"); 101 101 102 102 /* … … 112 112 puts( "Init - cre_tsk - Dormant Task" ); 113 113 status = cre_tsk( DORMANT_TASK_ID, &pk_ctsk ); 114 assert( status == E_OK);114 fatal_directive_status( status, E_OK, "cre_tsk of DORMANT"); 115 115 status = ref_tsk( &pk_rtsk, DORMANT_TASK_ID ); 116 assert( status == E_OK);117 assert( pk_rtsk.tskstat == TTS_DMT);116 fatal_directive_status( status, E_OK, "ref_tsk of DORMANT"); 117 fatal_directive_status( pk_rtsk.tskstat, TTS_DMT, "task state of DORMANT"); 118 118 119 119 /* … … 124 124 puts( "Init - cre_tsk - Non-Dormant Task" ); 125 125 status = cre_tsk( NON_DORMANT_TASK_ID, &pk_ctsk ); 126 assert( status == E_OK);126 fatal_directive_status( status, E_OK, "cre_tsk of NON_DORMANT"); 127 127 status = sta_tsk( NON_DORMANT_TASK_ID, 1 ); 128 128 status = ref_tsk( &pk_rtsk, NON_DORMANT_TASK_ID ); 129 assert( status == E_OK);130 assert( pk_rtsk.tskstat == TTS_WAI);129 fatal_directive_status( status, E_OK, "ref_tsk of NON_DORMANT"); 130 fatal_directive_status( pk_rtsk.tskstat,TTS_WAI,"task state of NON_DORMANT"); 131 131 132 132 … … 139 139 puts( "Init - cre_tsk - access violation ( id less than -4) - E_OACV" ); 140 140 status = cre_tsk( -5, &pk_ctsk ); 141 assert( status == E_OACV);141 fatal_directive_status( status, E_OACV, "cre_tsk of -5"); 142 142 143 143 puts( "Init - cre_tsk - bad id (between 0 and -4) - E_ID" ); 144 144 status = cre_tsk( -2, &pk_ctsk ); 145 assert( status == E_ID);145 fatal_directive_status( status, E_ID, "cre_tsk of -2"); 146 146 147 147 puts( "Init - cre_tsk - cannot create TSK_SELF - E_ID" ); 148 148 status = cre_tsk( TSK_SELF, &pk_ctsk ); 149 assert( status == E_ID);149 fatal_directive_status( status, E_ID, "cre_tsk of TSK_SELF"); 150 150 151 151 puts( "Init - cre_tsk - invalid id; id already exists - E_OBJ" ); 152 152 status = cre_tsk( 1, &pk_ctsk ); 153 assert( status == E_OBJ);153 fatal_directive_status( status, E_OBJ, "cre_tsk of 1"); 154 154 155 155 /* … … 160 160 puts( "Init - cre_tsk - tskatr is invalid - E_RSATR" ); 161 161 status = cre_tsk( 5, &pk_ctsk ); 162 assert( status == E_RSATR);162 fatal_directive_status( status, E_RSATR, "cre_tsk with tskatr of -1"); 163 163 164 164 puts( "Init - cre_tsk - pk_ctsk is invalid - E_PAR" ); 165 165 status = cre_tsk( 5, NULL ); 166 assert( status == E_PAR);166 fatal_directive_status( status, E_PAR, "cre_tsk with NULL discription"); 167 167 168 168 pk_ctsk.tskatr = TA_HLNG; … … 170 170 puts( "Init - cre_tsk - itskpri is 0 - E_PAR" ); 171 171 status = cre_tsk( 5, &pk_ctsk ); 172 assert( status == E_PAR);172 fatal_directive_status( status, E_PAR, "cre_tsk with priority of 0"); 173 173 pk_ctsk.itskpri = 257; /* XXX Design parameter not requirement. */ 174 174 puts( "Init - cre_tsk - itskpri is 257 - E_PAR" ); 175 175 status = cre_tsk( 5, &pk_ctsk ); 176 assert( status == E_PAR);176 fatal_directive_status( status, E_PAR, "cre_tsk with priority of 257"); 177 177 178 178 pk_ctsk.stksz = -1; 179 179 puts( "Init - cre_tsk - stksz is invalid - E_PAR" ); 180 180 status = cre_tsk( 5, &pk_ctsk ); 181 assert( status == E_PAR);181 fatal_directive_status( status, E_PAR, "cre_tsk with size of -1"); 182 182 183 183 pk_ctsk.task = NULL; 184 184 puts( "Init - cre_tsk - task is invalid - E_PAR" ); 185 185 status = cre_tsk( 5, &pk_ctsk ); 186 assert( status == E_PAR);186 fatal_directive_status( status, E_PAR, "cre_tsk with null task identifier"); 187 187 188 188 189 189 #if (0) 190 190 /* these errors can not be generated for cre_tsk at this time */ 191 assert( status == E_NOMEM);192 assert( status == EN_OBJNO);193 assert( status == EN_CTXID);194 assert( status == EN_PAR);191 fatal_directive_status( status, E_NOMEM, ""); 192 fatal_directive_status( status, EN_OBJNO, ""); 193 fatal_directive_status( status, EN_CTXID, ""); 194 fatal_directive_status( status, EN_PAR, ""); 195 195 #endif 196 196 … … 210 210 puts( "Init - del_tsk - cannot delete TSK_SELF - E_OBJ" ); 211 211 status = del_tsk( TSK_SELF ); 212 assert( status == E_OBJ);212 fatal_directive_status( status, E_OBJ, "del_tsk with SELF"); 213 213 214 214 puts( "Init - del_tsk - task is not DORMANT - E_OBJ" ); 215 215 status = del_tsk( NON_DORMANT_TASK_ID ); 216 assert( status == E_OBJ);216 fatal_directive_status( status, E_OBJ, "del_tsk NON_DORMANT"); 217 217 218 218 puts( "Init - del_tsk - task does not exist - E_NOEXS" ); 219 219 status = del_tsk( 5 ); 220 assert( status == E_NOEXS);220 fatal_directive_status( status, E_NOEXS, "del_tsk 5"); 221 221 222 222 puts( "Init - del_tsk - access violation ( id less than -4) - E_OACV" ); 223 223 status = del_tsk( -5 ); 224 assert( status == E_OACV);224 fatal_directive_status( status, E_OACV, "del_tsk -5"); 225 225 226 226 puts( "Init - del_tsk - cannot delete TSK_SELF - E_OBJ" ); 227 227 status = del_tsk( TSK_SELF ); 228 assert( status == E_OBJ);228 fatal_directive_status( status, E_OBJ, "del_tsk self"); 229 229 230 230 puts( "Init - del_tsk - bad id (between 0 and -4) - E_ID" ); 231 231 status = del_tsk( -3 ); 232 assert( status == E_ID);232 fatal_directive_status( status, E_ID, "del_tsk -3"); 233 233 234 234 #if (0) 235 235 /* these errors can not be generated for del_tsk at this time */ 236 assert( status == EN_OBJNO);237 assert( status == EN_CTXID);236 fatal_directive_status( status, EN_OBJNO, "del_tsk "); 237 fatal_directive_status( status, EN_CTXID, "del_tsk "); 238 238 #endif 239 239 … … 243 243 puts( "Init - sta_tsk - access violation ( id less than -4) - E_OACV" ); 244 244 status = sta_tsk( -5, 1 ); 245 assert( status == E_OACV);245 fatal_directive_status( status, E_OACV, "sta_tsk of -5"); 246 246 247 247 puts( "Init - sta_tsk - bad id (between 0 and -4) - E_ID" ); 248 248 status = sta_tsk( -2, 1 ); 249 assert( status == E_ID);249 fatal_directive_status( status, E_ID, "sta_tsk of -2"); 250 250 251 251 puts( "Init - sta_tsk - cannot start TSK_SELF - E_OBJ" ); 252 252 status = sta_tsk( TSK_SELF, 1 ); 253 assert( status == E_OBJ);253 fatal_directive_status( status, E_OBJ, "sta_tsk of self"); 254 254 255 255 puts( "Init - sta_tsk - task is not DORMANT - E_OBJ" ); 256 256 status = sta_tsk( NON_DORMANT_TASK_ID, 1 ); 257 assert( status == E_OBJ);257 fatal_directive_status( status, E_OBJ, "sta_tsk NON_DORMANT"); 258 258 259 259 puts( "Init - sta_tsk - task does not exist - E_NOEXS" ); 260 260 status = sta_tsk( 5, 1 ); 261 assert( status == E_NOEXS);261 fatal_directive_status( status, E_NOEXS, "5"); 262 262 263 263 #if (0) 264 264 /* these errors can not be generated for sta_tsk at this time */ 265 assert( status == EN_OBJNO);266 assert( status == EN_CTXID);267 assert( status == EN_PAR);265 fatal_directive_status( status, EN_OBJNO, "sta_tsk"); 266 fatal_directive_status( status, EN_CTXID, "sta_tsk"); 267 fatal_directive_status( status, EN_PAR, "sta_tsk"); 268 268 #endif 269 269 … … 274 274 puts( "Init - ext_tsk - context error - E_CTX" ); 275 275 status = ext_tsk( ); 276 assert( status == E_CTX);276 fatal_directive_status( status, E_CTX, "ext_tsk "); 277 277 278 278 puts( "\n\n*** Exit and Delete Task Errors ***" ); 279 279 puts( "Init - exd_tsk - context error - E_CTX" ); 280 280 status = exd_tsk( ); 281 assert( status == E_CTX);281 fatal_directive_status( status, E_CTX, "exd_tsk"); 282 282 #endif 283 283 … … 287 287 puts( "Init - ter_tsk - bad id (between 0 and -4) - E_ID" ); 288 288 status = ter_tsk( -2 ); 289 assert( status == E_ID);289 fatal_directive_status( status, E_ID, "ter_tsk of -2"); 290 290 291 291 puts( "Init - ter_tsk - cannot terminate TSK_SELF (0) - E_OBJ" ); 292 292 status = ter_tsk( TSK_SELF ); 293 assert( status == E_OBJ);293 fatal_directive_status( status, E_OBJ, "ter_tsk of self"); 294 294 295 295 puts( "Init - ter_tsk - task is not DORMANT - E_OBJ" ); 296 296 status = ter_tsk( DORMANT_TASK_ID ); 297 assert( status == E_OBJ);297 fatal_directive_status( status, E_OBJ, "ter_tsk DORMANT"); 298 298 299 299 puts( "Init - ter_tsk - task does not exist - E_NOEXS" ); 300 300 status = ter_tsk( 5 ); 301 assert( status == E_NOEXS);301 fatal_directive_status( status, E_NOEXS, "ter_tsk of 5"); 302 302 303 303 puts( "Init - ter_tsk - access violation ( id less than -4) - E_OACV" ); 304 304 status = ter_tsk( -5 ); 305 assert( status == E_OACV);305 fatal_directive_status( status, E_OACV, "ter_tsk of -5"); 306 306 307 307 #if (0) 308 308 /* these errors can not be generated for ter_tsk at this time */ 309 assert( status == EN_OBJNO);310 assert( status == EN_CTXID);309 fatal_directive_status( status, EN_OBJNO, "ter_tsk"); 310 fatal_directive_status( status, EN_CTXID, "ter_tsk"); 311 311 #endif 312 312 … … 314 314 #if (0) 315 315 status = dis_dsp( ); 316 assert( status == E_CTX);316 fatal_directive_status( status, E_CTX, "dis_dsp"); 317 317 318 318 status = ena_dsp( ); 319 assert( status == E_CTX ); 320 #endif 321 319 fatal_directive_status( status, E_CTX, "ena_dsp"); 320 #endif 322 321 323 322 puts( "\n\n*** Change Priority Task Errors ***" ); … … 325 324 puts( "Init - chg_pri - bad id (between 0 and -4) - E_ID" ); 326 325 status = chg_pri( -2, 1 ); 327 assert( status == E_ID);326 fatal_directive_status( status, E_ID, "chg_pri of -2"); 328 327 329 328 /* Call from task independent portion to cause E_OBJ 330 329 puts( "Init - chg_pri - change priority of TSK_SELF - E_OBJ" ); 331 status = chg_pri( TSK_SELF, 1 );330 status = chg_pri( XXX - INTERRUPT, 1 ); 332 331 assert( status == E_OBJ ); 333 332 */ 334 333 335 /* Need a dormant task to call */ 336 puts( "Init - chg_pri - task is not DORMANT - E_OBJ" ); 334 puts( "Init - chg_pri - task is DORMANT - E_OBJ" ); 337 335 status = chg_pri( DORMANT_TASK_ID, 1 ); 338 assert( status == E_OBJ);336 fatal_directive_status( status, E_OBJ, "chg_pri of DORMANT"); 339 337 340 338 puts( "Init - chg_pri - task does not exist - E_NOEXS" ); 341 339 status = chg_pri( 5, 1 ); 342 assert( status == E_NOEXS);340 fatal_directive_status( status, E_NOEXS, "chg_pri of 5"); 343 341 344 342 puts( "Init - chg_pri - access violation ( id less than -4) - E_OACV" ); 345 343 status = chg_pri( -5, 1 ); 346 assert( status == E_OACV);344 fatal_directive_status( status, E_OACV, "chg_pri of -5"); 347 345 348 346 puts( "Init - chg_pri - invalid priority - E_PAR" ); 349 347 status = chg_pri( 1, -1 ); 350 assert( status == E_PAR);348 fatal_directive_status( status, E_PAR, "chg_pri with priority of -1"); 351 349 352 350 #if (0) 353 351 /* these errors can not be generated for chg_pri at this time */ 354 assert( status == EN_OBJNO);355 assert( status == EN_CTXID);356 assert( status == EN_PAR);352 fatal_directive_status( status, EN_OBJNO, "chg_pri"); 353 fatal_directive_status( status, EN_CTXID, "chg_pri"); 354 fatal_directive_status( status, EN_PAR, "chg_pri"); 357 355 #endif 358 356 … … 366 364 puts( "Init - rot_rdq - priority -1 - E_PAR" ); 367 365 status = rot_rdq( -1 ); 368 assert( status == E_PAR);366 fatal_directive_status( status, E_PAR, "rot_rdq -1"); 369 367 puts( "Init - rot_rdq - priority 257 - E_PAR" ); 370 368 status = rot_rdq( 257 ); 371 assert( status == E_PAR ); 372 373 #if (0) 374 /* This routine is not coded */ 375 rel_wai( ID ); 376 assert( status == E_OK ); 377 assert( status == E_ID ); 378 assert( status == E_NOEXS ); 379 assert( status == E_OACV ); 380 assert( status == E_OBJ ); 381 assert( status == EN_OBJNO ); 382 assert( status == EN_CTXID ); 383 #endif 384 385 386 #if (0) 387 get_tid( ID ); 388 assert( status == E_OK ); 389 #endif 369 fatal_directive_status( status, E_PAR, "rot_rdq 256"); 370 371 /* XXX - This routine is not coded */ 372 373 puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_OK" ); 374 status = rel_wai( ID ); 375 fatal_directive_status( status, E_OK, "rel_wai"); 376 377 puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_ID" ); 378 status = E_ID; 379 fatal_directive_status( status, E_ID, "rel_wai"); 380 381 puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_NOEXS" ); 382 status = E_NOEXS; 383 fatal_directive_status( status, E_NOEXS, "rel_wai"); 384 385 puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_OACV" ); 386 status = E_OACV; 387 fatal_directive_status( status, E_OACV, "rel_wai"); 388 389 puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_OBJ" ); 390 status = E_OBJ; 391 fatal_directive_status( status, E_OBJ, "rel_wai"); 392 393 puts( "Init - rel_rdq - XXX Add when rel_wai coded - EN_OBJNO" ); 394 status = EN_OBJNO; 395 fatal_directive_status( status, EN_OBJNO, "rel_wai"); 396 397 puts( "Init - rel_rdq - XXX Add when rel_wai coded - EN_CTXID" ); 398 status = EN_CTXID; 399 fatal_directive_status( status, EN_CTXID, "rel_wai"); 400 390 401 391 402 puts( "\n\n*** Reference Task Status Errors ***" ); 392 403 puts( "Init - ref_tsk - bad id (between 0 and -4) - E_ID" ); 393 404 status = ref_tsk( &pk_rtsk, -2 ); 394 assert( status == E_ID);395 396 /* Call from task independent portion to cause E_ID397 puts( "Init - ref_tsk - reference SELF- E_ID" );405 fatal_directive_status( status, E_ID, "ref_tsk -2"); 406 407 /* XXX Call from task independent portion to cause E_ID 408 puts( "Init - ref_tsk - reference INTERRUPT - E_ID" ); 398 409 status = ref_tsk( &pk_rtsk, TSK_SELF ); 399 410 assert( status == E_ID ); … … 402 413 puts( "Init - ref_tsk - task does not exist - E_NOEXS" ); 403 414 status = ref_tsk( &pk_rtsk, 5 ); 404 assert( status == E_NOEXS);415 fatal_directive_status( status, E_NOEXS, "ref_tsk 5"); 405 416 406 417 puts( "Init - ref_tsk - access violation ( id less than -4) - E_OACV" ); 407 418 status = ref_tsk( &pk_rtsk, -5 ); 408 assert( status == E_OACV);419 fatal_directive_status( status, E_OACV, "ref_tsk -5"); 409 420 410 421 puts( "Init - ref_tsk - packet address is bad - E_PAR" ); 411 422 status = ref_tsk( NULL, 1 ); 412 assert( status == E_PAR ); 413 423 fatal_directive_status( status, E_PAR, "ref_tsk SELF with NULL descriptor"); 414 424 415 425 #if (0) 416 426 /* these errors can not be generated for ref_tsk at this time */ 417 assert( status == EN_OBJNO ); 418 assert( status == EN_CTXID ); 419 assert( status == EN_RPAR ); 420 #endif 421 427 fatal_directive_status( status, EN_OBJNO, "ref_tsk"); 428 fatal_directive_status( status, EN_CTXID, "ref_tsk"); 429 fatal_directive_status( status, EN_RPAR, "ref_tsk"); 430 #endif 422 431 423 432 puts( "\n\n*** Suspend Task Errors ***" ); … … 425 434 puts( "Init - sus_tsk - access violation ( id less than -4) - E_OACV" ); 426 435 status = sus_tsk( -5 ); 427 assert( status == E_OACV);436 fatal_directive_status( status, E_OACV, "sus_tsk of -5"); 428 437 429 438 puts( "Init - sus_tsk - bad id (between 0 and -4) - E_ID" ); 430 439 status = sus_tsk( -2 ); 431 assert( status == E_ID);440 fatal_directive_status( status, E_ID, "sus_tsk of -2"); 432 441 433 442 puts( "Init - sus_tsk - cannot suspend SELF - E_OBJ" ); 434 443 status = sus_tsk( TSK_SELF ); 435 assert( status == E_OBJ);444 fatal_directive_status( status, E_OBJ, "sus_tsk of self"); 436 445 437 446 puts( "Init - sus_tsk - task does not exist - E_NOEXS" ); 438 447 status = sus_tsk( 5 ); 439 assert( status == E_NOEXS ); 440 #if (0) 448 fatal_directive_status( status, E_NOEXS, "sus_tsk of 5"); 449 450 /* XXX - We support nested suspends and will never return this error. 441 451 puts( "Init - sus_tsk - no support for nested SUSPENDS - E_QOVR" ); 442 452 status = sus_tsk( 1 ); 443 assert( status == E_QOVR ); 444 453 fatal_directive_status( status, E_QOVR, "sus_tsk"); 454 */ 455 456 /* XXX - Can not test this. 445 457 puts( "Init - sus_tsk - exceeded limit for nested SUSPENDS - E_QOVR" ); 446 458 status = sus_tsk( 1 ); 447 assert( status == E_QOVR);448 #endif 459 fatal_directive_status( status, E_QOVR, "sus_tsk"); 460 */ 449 461 450 462 #if (0) 451 463 /* these errors can not be generated for sus_tsk at this time */ 452 assert( status == EN_OBJNO);453 assert( status == EN_CTXID);464 fatal_directive_status( status, EN_OBJNO, "sus_tsk"); 465 fatal_directive_status( status, EN_CTXID, "sus_tsk"); 454 466 #endif 455 467 … … 459 471 puts( "Init - rsm_tsk - access violation ( id less than -4) - E_OACV" ); 460 472 status = rsm_tsk( -5 ); 461 assert( status == E_OACV);473 fatal_directive_status( status, E_OACV, "rsm_tsk -5"); 462 474 463 475 puts( "Init - rsm_tsk - bad id (between 0 and -4) - E_ID" ); 464 476 status = rsm_tsk( -2 ); 465 assert( status == E_ID);477 fatal_directive_status( status, E_ID, "rsm_tsk -2"); 466 478 467 479 puts( "Init - rsm_tsk - cannot resume SELF - E_OBJ" ); 468 480 status = rsm_tsk( TSK_SELF ); 469 assert( status == E_OBJ);481 fatal_directive_status( status, E_OBJ, "rsm_tsk self"); 470 482 471 483 puts( "Init - rsm_tsk - task is DORMANT - E_OBJ" ); 472 484 status = rsm_tsk( DORMANT_TASK_ID ); 473 assert( status == E_OBJ);485 fatal_directive_status( status, E_OBJ, "rsm_tsk DORMANT"); 474 486 475 487 puts( "Init - rsm_tsk - task does not exist - E_NOEXS" ); 476 488 status = rsm_tsk( 5 ); 477 assert( status == E_NOEXS);489 fatal_directive_status( status, E_NOEXS, "rms_tsk 5"); 478 490 479 491 #if (0) 480 492 /* these errors can not be generated for rsm_tsk at this time */ 481 assert( status == EN_OBJNO);482 assert( status == EN_CTXID);493 fatal_directive_status( status, EN_OBJNO, "rsm_tsk"); 494 fatal_directive_status( status, EN_CTXID, "rsm_tsk"); 483 495 #endif 484 496 … … 488 500 puts( "Init - frsm_tsk - access violation ( id less than -4) - E_OACV" ); 489 501 status = frsm_tsk( -5 ); 490 assert( status == E_OACV);502 fatal_directive_status( status, E_OACV, "frsm_tsk -5"); 491 503 492 504 puts( "Init - frsm_tsk - bad id (between 0 and -4) - E_ID" ); 493 505 status = frsm_tsk( -2 ); 494 assert( status == E_ID);506 fatal_directive_status( status, E_ID, "frsm_tsk -2"); 495 507 496 508 puts( "Init - frsm_tsk - cannot forcibly resume SELF - E_OBJ" ); 497 509 status = frsm_tsk( TSK_SELF ); 498 assert( status == E_OBJ);510 fatal_directive_status( status, E_OBJ, "frsm_tsk self"); 499 511 500 512 puts( "Init - frsm_tsk - task is DORMANT - E_OBJ" ); 501 513 status = frsm_tsk( DORMANT_TASK_ID ); 502 assert( status == E_OBJ);514 fatal_directive_status( status, E_OBJ, "frsm_tsk DORMANT"); 503 515 504 516 puts( "Init - frsm_tsk - task does not exist - E_NOEXS" ); 505 517 status = frsm_tsk( 5 ); 506 assert( status == E_NOEXS);518 fatal_directive_status( status, E_NOEXS, "frsm_tsk 5"); 507 519 508 520 #if (0) 509 521 /* these errors can not be generated for frsm_tsk at this time */ 510 assert( status == EN_OBJNO ); 511 assert( status == EN_CTXID ); 512 #endif 513 514 515 #if (0) 522 fatal_directive_status( status, EN_OBJNO, "frsm_tsk"); 523 fatal_directive_status( status, EN_CTXID, "frsm_tsk"); 524 #endif 525 526 527 #if (0) 528 XXXXX - FIX ME 516 529 /* these directives are not coded */ 517 530 slp_tsk( ); 518 assert( status == E_OK);519 assert( status == E_PAR);520 assert( status == E_RLWAI);521 assert( status == E_TMOUT);522 assert( status == E_CTX);531 fatal_directive_status( status, E_OK, ""); 532 fatal_directive_status( status, E_PAR, ""); 533 fatal_directive_status( status, E_RLWAI, ""); 534 fatal_directive_status( status, E_TMOUT, ""); 535 fatal_directive_status( status, E_CTX, ""); 523 536 524 537 525 538 tslp_tsk( TMO ); 526 assert( status == E_OK ); 527 assert( status == E_PAR ); 528 assert( status == E_RLWAI ); 529 assert( status == E_TMOUT ); 530 assert( status == E_CTX ); 531 539 fatal_directive_status( status, E_OK, ""); 540 fatal_directive_status( status, E_PAR, ""); 541 fatal_directive_status( status, E_RLWAI, ""); 542 fatal_directive_status( status, E_TMOUT, ""); 543 fatal_directive_status( status, E_CTX, ""); 532 544 533 545 wup_tsk( ID ); 534 assert( status == E_OK);535 assert( status == E_ID);536 assert( status == E_NOEXS);537 assert( status == E_OACV);538 assert( status == E_OBJ);539 assert( status == E_QOVR);540 assert( status == EN_OBJNO);541 assert( status == EN_CTXID);546 fatal_directive_status( status, E_OK, ""); 547 fatal_directive_status( status, E_ID, ""); 548 fatal_directive_status( status, E_NOEXS, ""); 549 fatal_directive_status( status, E_OACV, ""); 550 fatal_directive_status( status, E_OBJ, ""); 551 fatal_directive_status( status, E_QOVR, ""); 552 fatal_directive_status( status, EN_OBJNO, ""); 553 fatal_directive_status( status, EN_CTXID, ""); 542 554 543 555 544 556 can_tsk( INT, ID ); 545 assert( status == E_OK);546 assert( status == E_ID);547 assert( status == E_NOEXS);548 assert( status == E_OACV);549 assert( status == E_OBJ);550 assert( status == EN_OBJNO);551 assert( status == EN_CTXID);552 assert( status == EN_RPAR);557 fatal_directive_status( status, E_OK, ""); 558 fatal_directive_status( status, E_ID, ""); 559 fatal_directive_status( status, E_NOEXS, ""); 560 fatal_directive_status( status, E_OACV, ""); 561 fatal_directive_status( status, E_OBJ, ""); 562 fatal_directive_status( status, EN_OBJNO, ""); 563 fatal_directive_status( status, EN_CTXID, ""); 564 fatal_directive_status( status, EN_RPAR, ""); 553 565 #endif 554 566 -
testsuites/itrontests/itrontask02/init.c
r56e61bb8 r3fb7b70b 95 95 96 96 status = chg_pri( TSK_SELF, 8 ); 97 assert( status == E_OK);97 fatal_directive_status( status, E_OK, "chg_pri of TSK_SELF"); 98 98 status = ref_tsk( &pk_rtsk, TSK_SELF ); 99 assert( status == E_OK);100 assert( pk_rtsk.tskpri == 8);99 fatal_directive_status( status, E_OK, "ref_tsk of TSK_SELF"); 100 fatal_directive_status( pk_rtsk.tskpri, 8, "task priority of SELF"); 101 101 102 102 /* … … 112 112 puts( "Init - cre_tsk - Dormant Task" ); 113 113 status = cre_tsk( DORMANT_TASK_ID, &pk_ctsk ); 114 assert( status == E_OK);114 fatal_directive_status( status, E_OK, "cre_tsk of DORMANT"); 115 115 status = ref_tsk( &pk_rtsk, DORMANT_TASK_ID ); 116 assert( status == E_OK);117 assert( pk_rtsk.tskstat == TTS_DMT);116 fatal_directive_status( status, E_OK, "ref_tsk of DORMANT"); 117 fatal_directive_status( pk_rtsk.tskstat, TTS_DMT, "task state of DORMANT"); 118 118 119 119 /* … … 124 124 puts( "Init - cre_tsk - Non-Dormant Task" ); 125 125 status = cre_tsk( NON_DORMANT_TASK_ID, &pk_ctsk ); 126 assert( status == E_OK);126 fatal_directive_status( status, E_OK, "cre_tsk of NON_DORMANT"); 127 127 status = sta_tsk( NON_DORMANT_TASK_ID, 1 ); 128 128 status = ref_tsk( &pk_rtsk, NON_DORMANT_TASK_ID ); 129 assert( status == E_OK);130 assert( pk_rtsk.tskstat == TTS_WAI);129 fatal_directive_status( status, E_OK, "ref_tsk of NON_DORMANT"); 130 fatal_directive_status( pk_rtsk.tskstat,TTS_WAI,"task state of NON_DORMANT"); 131 131 132 132 … … 139 139 puts( "Init - cre_tsk - access violation ( id less than -4) - E_OACV" ); 140 140 status = cre_tsk( -5, &pk_ctsk ); 141 assert( status == E_OACV);141 fatal_directive_status( status, E_OACV, "cre_tsk of -5"); 142 142 143 143 puts( "Init - cre_tsk - bad id (between 0 and -4) - E_ID" ); 144 144 status = cre_tsk( -2, &pk_ctsk ); 145 assert( status == E_ID);145 fatal_directive_status( status, E_ID, "cre_tsk of -2"); 146 146 147 147 puts( "Init - cre_tsk - cannot create TSK_SELF - E_ID" ); 148 148 status = cre_tsk( TSK_SELF, &pk_ctsk ); 149 assert( status == E_ID);149 fatal_directive_status( status, E_ID, "cre_tsk of TSK_SELF"); 150 150 151 151 puts( "Init - cre_tsk - invalid id; id already exists - E_OBJ" ); 152 152 status = cre_tsk( 1, &pk_ctsk ); 153 assert( status == E_OBJ);153 fatal_directive_status( status, E_OBJ, "cre_tsk of 1"); 154 154 155 155 /* … … 160 160 puts( "Init - cre_tsk - tskatr is invalid - E_RSATR" ); 161 161 status = cre_tsk( 5, &pk_ctsk ); 162 assert( status == E_RSATR);162 fatal_directive_status( status, E_RSATR, "cre_tsk with tskatr of -1"); 163 163 164 164 puts( "Init - cre_tsk - pk_ctsk is invalid - E_PAR" ); 165 165 status = cre_tsk( 5, NULL ); 166 assert( status == E_PAR);166 fatal_directive_status( status, E_PAR, "cre_tsk with NULL discription"); 167 167 168 168 pk_ctsk.tskatr = TA_HLNG; … … 170 170 puts( "Init - cre_tsk - itskpri is 0 - E_PAR" ); 171 171 status = cre_tsk( 5, &pk_ctsk ); 172 assert( status == E_PAR);172 fatal_directive_status( status, E_PAR, "cre_tsk with priority of 0"); 173 173 pk_ctsk.itskpri = 257; /* XXX Design parameter not requirement. */ 174 174 puts( "Init - cre_tsk - itskpri is 257 - E_PAR" ); 175 175 status = cre_tsk( 5, &pk_ctsk ); 176 assert( status == E_PAR);176 fatal_directive_status( status, E_PAR, "cre_tsk with priority of 257"); 177 177 178 178 pk_ctsk.stksz = -1; 179 179 puts( "Init - cre_tsk - stksz is invalid - E_PAR" ); 180 180 status = cre_tsk( 5, &pk_ctsk ); 181 assert( status == E_PAR);181 fatal_directive_status( status, E_PAR, "cre_tsk with size of -1"); 182 182 183 183 pk_ctsk.task = NULL; 184 184 puts( "Init - cre_tsk - task is invalid - E_PAR" ); 185 185 status = cre_tsk( 5, &pk_ctsk ); 186 assert( status == E_PAR);186 fatal_directive_status( status, E_PAR, "cre_tsk with null task identifier"); 187 187 188 188 189 189 #if (0) 190 190 /* these errors can not be generated for cre_tsk at this time */ 191 assert( status == E_NOMEM);192 assert( status == EN_OBJNO);193 assert( status == EN_CTXID);194 assert( status == EN_PAR);191 fatal_directive_status( status, E_NOMEM, ""); 192 fatal_directive_status( status, EN_OBJNO, ""); 193 fatal_directive_status( status, EN_CTXID, ""); 194 fatal_directive_status( status, EN_PAR, ""); 195 195 #endif 196 196 … … 210 210 puts( "Init - del_tsk - cannot delete TSK_SELF - E_OBJ" ); 211 211 status = del_tsk( TSK_SELF ); 212 assert( status == E_OBJ);212 fatal_directive_status( status, E_OBJ, "del_tsk with SELF"); 213 213 214 214 puts( "Init - del_tsk - task is not DORMANT - E_OBJ" ); 215 215 status = del_tsk( NON_DORMANT_TASK_ID ); 216 assert( status == E_OBJ);216 fatal_directive_status( status, E_OBJ, "del_tsk NON_DORMANT"); 217 217 218 218 puts( "Init - del_tsk - task does not exist - E_NOEXS" ); 219 219 status = del_tsk( 5 ); 220 assert( status == E_NOEXS);220 fatal_directive_status( status, E_NOEXS, "del_tsk 5"); 221 221 222 222 puts( "Init - del_tsk - access violation ( id less than -4) - E_OACV" ); 223 223 status = del_tsk( -5 ); 224 assert( status == E_OACV);224 fatal_directive_status( status, E_OACV, "del_tsk -5"); 225 225 226 226 puts( "Init - del_tsk - cannot delete TSK_SELF - E_OBJ" ); 227 227 status = del_tsk( TSK_SELF ); 228 assert( status == E_OBJ);228 fatal_directive_status( status, E_OBJ, "del_tsk self"); 229 229 230 230 puts( "Init - del_tsk - bad id (between 0 and -4) - E_ID" ); 231 231 status = del_tsk( -3 ); 232 assert( status == E_ID);232 fatal_directive_status( status, E_ID, "del_tsk -3"); 233 233 234 234 #if (0) 235 235 /* these errors can not be generated for del_tsk at this time */ 236 assert( status == EN_OBJNO);237 assert( status == EN_CTXID);236 fatal_directive_status( status, EN_OBJNO, "del_tsk "); 237 fatal_directive_status( status, EN_CTXID, "del_tsk "); 238 238 #endif 239 239 … … 243 243 puts( "Init - sta_tsk - access violation ( id less than -4) - E_OACV" ); 244 244 status = sta_tsk( -5, 1 ); 245 assert( status == E_OACV);245 fatal_directive_status( status, E_OACV, "sta_tsk of -5"); 246 246 247 247 puts( "Init - sta_tsk - bad id (between 0 and -4) - E_ID" ); 248 248 status = sta_tsk( -2, 1 ); 249 assert( status == E_ID);249 fatal_directive_status( status, E_ID, "sta_tsk of -2"); 250 250 251 251 puts( "Init - sta_tsk - cannot start TSK_SELF - E_OBJ" ); 252 252 status = sta_tsk( TSK_SELF, 1 ); 253 assert( status == E_OBJ);253 fatal_directive_status( status, E_OBJ, "sta_tsk of self"); 254 254 255 255 puts( "Init - sta_tsk - task is not DORMANT - E_OBJ" ); 256 256 status = sta_tsk( NON_DORMANT_TASK_ID, 1 ); 257 assert( status == E_OBJ);257 fatal_directive_status( status, E_OBJ, "sta_tsk NON_DORMANT"); 258 258 259 259 puts( "Init - sta_tsk - task does not exist - E_NOEXS" ); 260 260 status = sta_tsk( 5, 1 ); 261 assert( status == E_NOEXS);261 fatal_directive_status( status, E_NOEXS, "5"); 262 262 263 263 #if (0) 264 264 /* these errors can not be generated for sta_tsk at this time */ 265 assert( status == EN_OBJNO);266 assert( status == EN_CTXID);267 assert( status == EN_PAR);265 fatal_directive_status( status, EN_OBJNO, "sta_tsk"); 266 fatal_directive_status( status, EN_CTXID, "sta_tsk"); 267 fatal_directive_status( status, EN_PAR, "sta_tsk"); 268 268 #endif 269 269 … … 274 274 puts( "Init - ext_tsk - context error - E_CTX" ); 275 275 status = ext_tsk( ); 276 assert( status == E_CTX);276 fatal_directive_status( status, E_CTX, "ext_tsk "); 277 277 278 278 puts( "\n\n*** Exit and Delete Task Errors ***" ); 279 279 puts( "Init - exd_tsk - context error - E_CTX" ); 280 280 status = exd_tsk( ); 281 assert( status == E_CTX);281 fatal_directive_status( status, E_CTX, "exd_tsk"); 282 282 #endif 283 283 … … 287 287 puts( "Init - ter_tsk - bad id (between 0 and -4) - E_ID" ); 288 288 status = ter_tsk( -2 ); 289 assert( status == E_ID);289 fatal_directive_status( status, E_ID, "ter_tsk of -2"); 290 290 291 291 puts( "Init - ter_tsk - cannot terminate TSK_SELF (0) - E_OBJ" ); 292 292 status = ter_tsk( TSK_SELF ); 293 assert( status == E_OBJ);293 fatal_directive_status( status, E_OBJ, "ter_tsk of self"); 294 294 295 295 puts( "Init - ter_tsk - task is not DORMANT - E_OBJ" ); 296 296 status = ter_tsk( DORMANT_TASK_ID ); 297 assert( status == E_OBJ);297 fatal_directive_status( status, E_OBJ, "ter_tsk DORMANT"); 298 298 299 299 puts( "Init - ter_tsk - task does not exist - E_NOEXS" ); 300 300 status = ter_tsk( 5 ); 301 assert( status == E_NOEXS);301 fatal_directive_status( status, E_NOEXS, "ter_tsk of 5"); 302 302 303 303 puts( "Init - ter_tsk - access violation ( id less than -4) - E_OACV" ); 304 304 status = ter_tsk( -5 ); 305 assert( status == E_OACV);305 fatal_directive_status( status, E_OACV, "ter_tsk of -5"); 306 306 307 307 #if (0) 308 308 /* these errors can not be generated for ter_tsk at this time */ 309 assert( status == EN_OBJNO);310 assert( status == EN_CTXID);309 fatal_directive_status( status, EN_OBJNO, "ter_tsk"); 310 fatal_directive_status( status, EN_CTXID, "ter_tsk"); 311 311 #endif 312 312 … … 314 314 #if (0) 315 315 status = dis_dsp( ); 316 assert( status == E_CTX);316 fatal_directive_status( status, E_CTX, "dis_dsp"); 317 317 318 318 status = ena_dsp( ); 319 assert( status == E_CTX ); 320 #endif 321 319 fatal_directive_status( status, E_CTX, "ena_dsp"); 320 #endif 322 321 323 322 puts( "\n\n*** Change Priority Task Errors ***" ); … … 325 324 puts( "Init - chg_pri - bad id (between 0 and -4) - E_ID" ); 326 325 status = chg_pri( -2, 1 ); 327 assert( status == E_ID);326 fatal_directive_status( status, E_ID, "chg_pri of -2"); 328 327 329 328 /* Call from task independent portion to cause E_OBJ 330 329 puts( "Init - chg_pri - change priority of TSK_SELF - E_OBJ" ); 331 status = chg_pri( TSK_SELF, 1 );330 status = chg_pri( XXX - INTERRUPT, 1 ); 332 331 assert( status == E_OBJ ); 333 332 */ 334 333 335 /* Need a dormant task to call */ 336 puts( "Init - chg_pri - task is not DORMANT - E_OBJ" ); 334 puts( "Init - chg_pri - task is DORMANT - E_OBJ" ); 337 335 status = chg_pri( DORMANT_TASK_ID, 1 ); 338 assert( status == E_OBJ);336 fatal_directive_status( status, E_OBJ, "chg_pri of DORMANT"); 339 337 340 338 puts( "Init - chg_pri - task does not exist - E_NOEXS" ); 341 339 status = chg_pri( 5, 1 ); 342 assert( status == E_NOEXS);340 fatal_directive_status( status, E_NOEXS, "chg_pri of 5"); 343 341 344 342 puts( "Init - chg_pri - access violation ( id less than -4) - E_OACV" ); 345 343 status = chg_pri( -5, 1 ); 346 assert( status == E_OACV);344 fatal_directive_status( status, E_OACV, "chg_pri of -5"); 347 345 348 346 puts( "Init - chg_pri - invalid priority - E_PAR" ); 349 347 status = chg_pri( 1, -1 ); 350 assert( status == E_PAR);348 fatal_directive_status( status, E_PAR, "chg_pri with priority of -1"); 351 349 352 350 #if (0) 353 351 /* these errors can not be generated for chg_pri at this time */ 354 assert( status == EN_OBJNO);355 assert( status == EN_CTXID);356 assert( status == EN_PAR);352 fatal_directive_status( status, EN_OBJNO, "chg_pri"); 353 fatal_directive_status( status, EN_CTXID, "chg_pri"); 354 fatal_directive_status( status, EN_PAR, "chg_pri"); 357 355 #endif 358 356 … … 366 364 puts( "Init - rot_rdq - priority -1 - E_PAR" ); 367 365 status = rot_rdq( -1 ); 368 assert( status == E_PAR);366 fatal_directive_status( status, E_PAR, "rot_rdq -1"); 369 367 puts( "Init - rot_rdq - priority 257 - E_PAR" ); 370 368 status = rot_rdq( 257 ); 371 assert( status == E_PAR ); 372 373 #if (0) 374 /* This routine is not coded */ 375 rel_wai( ID ); 376 assert( status == E_OK ); 377 assert( status == E_ID ); 378 assert( status == E_NOEXS ); 379 assert( status == E_OACV ); 380 assert( status == E_OBJ ); 381 assert( status == EN_OBJNO ); 382 assert( status == EN_CTXID ); 383 #endif 384 385 386 #if (0) 387 get_tid( ID ); 388 assert( status == E_OK ); 389 #endif 369 fatal_directive_status( status, E_PAR, "rot_rdq 256"); 370 371 /* XXX - This routine is not coded */ 372 373 puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_OK" ); 374 status = rel_wai( ID ); 375 fatal_directive_status( status, E_OK, "rel_wai"); 376 377 puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_ID" ); 378 status = E_ID; 379 fatal_directive_status( status, E_ID, "rel_wai"); 380 381 puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_NOEXS" ); 382 status = E_NOEXS; 383 fatal_directive_status( status, E_NOEXS, "rel_wai"); 384 385 puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_OACV" ); 386 status = E_OACV; 387 fatal_directive_status( status, E_OACV, "rel_wai"); 388 389 puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_OBJ" ); 390 status = E_OBJ; 391 fatal_directive_status( status, E_OBJ, "rel_wai"); 392 393 puts( "Init - rel_rdq - XXX Add when rel_wai coded - EN_OBJNO" ); 394 status = EN_OBJNO; 395 fatal_directive_status( status, EN_OBJNO, "rel_wai"); 396 397 puts( "Init - rel_rdq - XXX Add when rel_wai coded - EN_CTXID" ); 398 status = EN_CTXID; 399 fatal_directive_status( status, EN_CTXID, "rel_wai"); 400 390 401 391 402 puts( "\n\n*** Reference Task Status Errors ***" ); 392 403 puts( "Init - ref_tsk - bad id (between 0 and -4) - E_ID" ); 393 404 status = ref_tsk( &pk_rtsk, -2 ); 394 assert( status == E_ID);395 396 /* Call from task independent portion to cause E_ID397 puts( "Init - ref_tsk - reference SELF- E_ID" );405 fatal_directive_status( status, E_ID, "ref_tsk -2"); 406 407 /* XXX Call from task independent portion to cause E_ID 408 puts( "Init - ref_tsk - reference INTERRUPT - E_ID" ); 398 409 status = ref_tsk( &pk_rtsk, TSK_SELF ); 399 410 assert( status == E_ID ); … … 402 413 puts( "Init - ref_tsk - task does not exist - E_NOEXS" ); 403 414 status = ref_tsk( &pk_rtsk, 5 ); 404 assert( status == E_NOEXS);415 fatal_directive_status( status, E_NOEXS, "ref_tsk 5"); 405 416 406 417 puts( "Init - ref_tsk - access violation ( id less than -4) - E_OACV" ); 407 418 status = ref_tsk( &pk_rtsk, -5 ); 408 assert( status == E_OACV);419 fatal_directive_status( status, E_OACV, "ref_tsk -5"); 409 420 410 421 puts( "Init - ref_tsk - packet address is bad - E_PAR" ); 411 422 status = ref_tsk( NULL, 1 ); 412 assert( status == E_PAR ); 413 423 fatal_directive_status( status, E_PAR, "ref_tsk SELF with NULL descriptor"); 414 424 415 425 #if (0) 416 426 /* these errors can not be generated for ref_tsk at this time */ 417 assert( status == EN_OBJNO ); 418 assert( status == EN_CTXID ); 419 assert( status == EN_RPAR ); 420 #endif 421 427 fatal_directive_status( status, EN_OBJNO, "ref_tsk"); 428 fatal_directive_status( status, EN_CTXID, "ref_tsk"); 429 fatal_directive_status( status, EN_RPAR, "ref_tsk"); 430 #endif 422 431 423 432 puts( "\n\n*** Suspend Task Errors ***" ); … … 425 434 puts( "Init - sus_tsk - access violation ( id less than -4) - E_OACV" ); 426 435 status = sus_tsk( -5 ); 427 assert( status == E_OACV);436 fatal_directive_status( status, E_OACV, "sus_tsk of -5"); 428 437 429 438 puts( "Init - sus_tsk - bad id (between 0 and -4) - E_ID" ); 430 439 status = sus_tsk( -2 ); 431 assert( status == E_ID);440 fatal_directive_status( status, E_ID, "sus_tsk of -2"); 432 441 433 442 puts( "Init - sus_tsk - cannot suspend SELF - E_OBJ" ); 434 443 status = sus_tsk( TSK_SELF ); 435 assert( status == E_OBJ);444 fatal_directive_status( status, E_OBJ, "sus_tsk of self"); 436 445 437 446 puts( "Init - sus_tsk - task does not exist - E_NOEXS" ); 438 447 status = sus_tsk( 5 ); 439 assert( status == E_NOEXS ); 440 #if (0) 448 fatal_directive_status( status, E_NOEXS, "sus_tsk of 5"); 449 450 /* XXX - We support nested suspends and will never return this error. 441 451 puts( "Init - sus_tsk - no support for nested SUSPENDS - E_QOVR" ); 442 452 status = sus_tsk( 1 ); 443 assert( status == E_QOVR ); 444 453 fatal_directive_status( status, E_QOVR, "sus_tsk"); 454 */ 455 456 /* XXX - Can not test this. 445 457 puts( "Init - sus_tsk - exceeded limit for nested SUSPENDS - E_QOVR" ); 446 458 status = sus_tsk( 1 ); 447 assert( status == E_QOVR);448 #endif 459 fatal_directive_status( status, E_QOVR, "sus_tsk"); 460 */ 449 461 450 462 #if (0) 451 463 /* these errors can not be generated for sus_tsk at this time */ 452 assert( status == EN_OBJNO);453 assert( status == EN_CTXID);464 fatal_directive_status( status, EN_OBJNO, "sus_tsk"); 465 fatal_directive_status( status, EN_CTXID, "sus_tsk"); 454 466 #endif 455 467 … … 459 471 puts( "Init - rsm_tsk - access violation ( id less than -4) - E_OACV" ); 460 472 status = rsm_tsk( -5 ); 461 assert( status == E_OACV);473 fatal_directive_status( status, E_OACV, "rsm_tsk -5"); 462 474 463 475 puts( "Init - rsm_tsk - bad id (between 0 and -4) - E_ID" ); 464 476 status = rsm_tsk( -2 ); 465 assert( status == E_ID);477 fatal_directive_status( status, E_ID, "rsm_tsk -2"); 466 478 467 479 puts( "Init - rsm_tsk - cannot resume SELF - E_OBJ" ); 468 480 status = rsm_tsk( TSK_SELF ); 469 assert( status == E_OBJ);481 fatal_directive_status( status, E_OBJ, "rsm_tsk self"); 470 482 471 483 puts( "Init - rsm_tsk - task is DORMANT - E_OBJ" ); 472 484 status = rsm_tsk( DORMANT_TASK_ID ); 473 assert( status == E_OBJ);485 fatal_directive_status( status, E_OBJ, "rsm_tsk DORMANT"); 474 486 475 487 puts( "Init - rsm_tsk - task does not exist - E_NOEXS" ); 476 488 status = rsm_tsk( 5 ); 477 assert( status == E_NOEXS);489 fatal_directive_status( status, E_NOEXS, "rms_tsk 5"); 478 490 479 491 #if (0) 480 492 /* these errors can not be generated for rsm_tsk at this time */ 481 assert( status == EN_OBJNO);482 assert( status == EN_CTXID);493 fatal_directive_status( status, EN_OBJNO, "rsm_tsk"); 494 fatal_directive_status( status, EN_CTXID, "rsm_tsk"); 483 495 #endif 484 496 … … 488 500 puts( "Init - frsm_tsk - access violation ( id less than -4) - E_OACV" ); 489 501 status = frsm_tsk( -5 ); 490 assert( status == E_OACV);502 fatal_directive_status( status, E_OACV, "frsm_tsk -5"); 491 503 492 504 puts( "Init - frsm_tsk - bad id (between 0 and -4) - E_ID" ); 493 505 status = frsm_tsk( -2 ); 494 assert( status == E_ID);506 fatal_directive_status( status, E_ID, "frsm_tsk -2"); 495 507 496 508 puts( "Init - frsm_tsk - cannot forcibly resume SELF - E_OBJ" ); 497 509 status = frsm_tsk( TSK_SELF ); 498 assert( status == E_OBJ);510 fatal_directive_status( status, E_OBJ, "frsm_tsk self"); 499 511 500 512 puts( "Init - frsm_tsk - task is DORMANT - E_OBJ" ); 501 513 status = frsm_tsk( DORMANT_TASK_ID ); 502 assert( status == E_OBJ);514 fatal_directive_status( status, E_OBJ, "frsm_tsk DORMANT"); 503 515 504 516 puts( "Init - frsm_tsk - task does not exist - E_NOEXS" ); 505 517 status = frsm_tsk( 5 ); 506 assert( status == E_NOEXS);518 fatal_directive_status( status, E_NOEXS, "frsm_tsk 5"); 507 519 508 520 #if (0) 509 521 /* these errors can not be generated for frsm_tsk at this time */ 510 assert( status == EN_OBJNO ); 511 assert( status == EN_CTXID ); 512 #endif 513 514 515 #if (0) 522 fatal_directive_status( status, EN_OBJNO, "frsm_tsk"); 523 fatal_directive_status( status, EN_CTXID, "frsm_tsk"); 524 #endif 525 526 527 #if (0) 528 XXXXX - FIX ME 516 529 /* these directives are not coded */ 517 530 slp_tsk( ); 518 assert( status == E_OK);519 assert( status == E_PAR);520 assert( status == E_RLWAI);521 assert( status == E_TMOUT);522 assert( status == E_CTX);531 fatal_directive_status( status, E_OK, ""); 532 fatal_directive_status( status, E_PAR, ""); 533 fatal_directive_status( status, E_RLWAI, ""); 534 fatal_directive_status( status, E_TMOUT, ""); 535 fatal_directive_status( status, E_CTX, ""); 523 536 524 537 525 538 tslp_tsk( TMO ); 526 assert( status == E_OK ); 527 assert( status == E_PAR ); 528 assert( status == E_RLWAI ); 529 assert( status == E_TMOUT ); 530 assert( status == E_CTX ); 531 539 fatal_directive_status( status, E_OK, ""); 540 fatal_directive_status( status, E_PAR, ""); 541 fatal_directive_status( status, E_RLWAI, ""); 542 fatal_directive_status( status, E_TMOUT, ""); 543 fatal_directive_status( status, E_CTX, ""); 532 544 533 545 wup_tsk( ID ); 534 assert( status == E_OK);535 assert( status == E_ID);536 assert( status == E_NOEXS);537 assert( status == E_OACV);538 assert( status == E_OBJ);539 assert( status == E_QOVR);540 assert( status == EN_OBJNO);541 assert( status == EN_CTXID);546 fatal_directive_status( status, E_OK, ""); 547 fatal_directive_status( status, E_ID, ""); 548 fatal_directive_status( status, E_NOEXS, ""); 549 fatal_directive_status( status, E_OACV, ""); 550 fatal_directive_status( status, E_OBJ, ""); 551 fatal_directive_status( status, E_QOVR, ""); 552 fatal_directive_status( status, EN_OBJNO, ""); 553 fatal_directive_status( status, EN_CTXID, ""); 542 554 543 555 544 556 can_tsk( INT, ID ); 545 assert( status == E_OK);546 assert( status == E_ID);547 assert( status == E_NOEXS);548 assert( status == E_OACV);549 assert( status == E_OBJ);550 assert( status == EN_OBJNO);551 assert( status == EN_CTXID);552 assert( status == EN_RPAR);557 fatal_directive_status( status, E_OK, ""); 558 fatal_directive_status( status, E_ID, ""); 559 fatal_directive_status( status, E_NOEXS, ""); 560 fatal_directive_status( status, E_OACV, ""); 561 fatal_directive_status( status, E_OBJ, ""); 562 fatal_directive_status( status, EN_OBJNO, ""); 563 fatal_directive_status( status, EN_CTXID, ""); 564 fatal_directive_status( status, EN_RPAR, ""); 553 565 #endif 554 566
Note: See TracChangeset
for help on using the changeset viewer.