Changeset 41171 for trunk/psLib/test/sys/tap_psError.c
- Timestamp:
- Nov 27, 2019, 11:57:38 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sys/tap_psError.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sys/tap_psError.c
r17515 r41171 324 324 325 325 for (psS32 i = 0; i < numErr; i++) { 326 const char* desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+1+i); 327 ok(desc != NULL, 328 "psErrorCode didn't find registered error code."); 329 330 ok(strcmp(desc,errDesc[i].description) == 0, 331 "psErrorCode didn't return the proper description. Got '%s', expected '%s'.", desc,errDesc[i].description); 332 } 333 334 /* 335 2. invoke psErrorCodeString with a static/builtin psLib error code. Verify: 326 const char *desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+1+i); 327 ok(desc, "psErrorCode found registered error code."); 328 ok(!strcmp(desc,errDesc[i].description), "psErrorCode returned the proper description. Got '%s', expected '%s'.", desc, errDesc[i].description); 329 } 330 331 /* 2. invoke psErrorCodeString with a static/builtin psLib error code. Verify: 336 332 a. the result is correct. 337 333 */ 338 const char* desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES); 339 ok(desc != NULL, "psErrorCode didn't find static error code."); 340 ok(strcmp(desc,"error classes end marker") == 0, 341 "psErrorCode didn't return the proper description. Got '%s', expected '%s'.", 342 desc,"error classes end marker"); 334 const char *desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES); 335 ok(desc, "psErrorCode found static error code."); 336 ok(!strcmp(desc, "error classes end marker"), "psErrorCode returned the proper description. Got '%s', expected '%s'.", desc, "error classes end marker"); 343 337 344 338 desc = psErrorCodeString(PS_ERR_NONE); 345 ok(desc != NULL, 346 "psErrorCode didn't find static error code."); 347 ok(strcmp(desc,"not an error") == 0, 348 "psErrorCode didn't return the proper description. Got '%s', expected '%s'.", 349 desc,"not an error"); 339 ok(desc, "psErrorCode found static error code."); 340 ok(!strcmp(desc,"not an error"), "psErrorCode returned the proper description. Got '%s', expected '%s'.", desc, "not an error"); 350 341 351 /* 352 3. invoke psErrorCodeString with an invalid code. Verify a NULL is returned. 353 */ 342 /* 3. invoke psErrorCodeString with an invalid code. Verify a NULL is returned. */ 354 343 desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+numErr+1); 355 ok(desc == NULL, 356 "psErrorCode didn't return a NULL with a bogus input code."); 357 358 /* 359 4. invoke psErrorRegister with a NULL psErrorDescription. Verify that: 344 ok(!desc, "psErrorCode returns a NULL with a bogus input code."); 345 346 /* 4. invoke psErrorRegister with a NULL psErrorDescription. Verify that: 360 347 a. the execution does not cease. 361 348 b. an appropriate error is generated. … … 366 353 psErr* err = psErrorLast(); 367 354 ok(err->code == PS_ERR_BAD_PARAMETER_NULL, 368 "psErrorCode didn't generateproper error code for NULL input.");355 "psErrorCode generated proper error code for NULL input."); 369 356 370 357 psFree(err); … … 377 364 err = psErrorLast(); 378 365 ok(err->code == PS_ERR_NONE, 379 "psErrorCode generatedan error for nErrors = 0.");366 "psErrorCode did not generate an error for nErrors = 0."); 380 367 psFree(err); 381 368 }
Note:
See TracChangeset
for help on using the changeset viewer.
