Changeset 6251 for trunk/psLib/test/astro/tst_psCoord.c
- Timestamp:
- Jan 30, 2006, 10:28:34 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/astro/tst_psCoord.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astro/tst_psCoord.c
r5549 r6251 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 200 5-11-18 21:23:21$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-01-30 20:28:34 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 18 18 static psS32 testPlaneTransformApply(void); 19 19 static psS32 testPlaneDistortApply(void); 20 static psS32 testPixelsTransform(void); 20 21 21 22 testDescription tests[] = { … … 24 25 {testPlaneTransformApply, 831, "psPlaneTransformApply()", 0, false}, 25 26 {testPlaneDistortApply, 832, "psPlaneDistortApply()", 0, false}, 27 {testPixelsTransform, 833, "psPixelsTransform()", 0, false}, 26 28 {NULL} 27 29 }; … … 371 373 } 372 374 375 psS32 testPixelsTransform(void) 376 { 377 psPixels *input = NULL; 378 psPixels *output = NULL; 379 psPlaneTransform *trans = psPlaneTransformAlloc(2, 0); 380 381 //Return NULL for NULL input pixels 382 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 383 output = psPixelsTransform(output, input, trans); 384 if (output != NULL) { 385 psError(PS_ERR_BAD_PARAMETER_NULL, false, 386 "psPixelsTransform failed to return NULL for NULL input pixels.\n"); 387 return 1; 388 } 389 //Return NULL for NULL input PlaneTransform 390 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 391 output = psPixelsTransform(output, input, NULL); 392 if (output != NULL) { 393 psError(PS_ERR_BAD_PARAMETER_NULL, false, 394 "psPixelsTransform failed to return NULL for NULL psPlaneTransform.\n"); 395 return 2; 396 } 397 398 input = psPixelsAlloc(5); 399 /* for (int i = 0; i < 2; i++) { 400 input->data[i].x = i*1.0; 401 input->data[i].y = i*1.0; 402 } 403 */ 404 input->data[0].x = 1.0; 405 input->data[0].y = 2.0; 406 input->data[1].x = 1.0; 407 input->data[1].y = 3.0; 408 trans->x->nX = 1; 409 trans->x->nY = 0; 410 trans->y->nX = 1; 411 trans->y->nY = 0; 412 trans->x->coeff[0][0] = 0; 413 trans->x->coeff[1][0] = 1; 414 trans->y->coeff[0][0] = 0; 415 trans->y->coeff[1][0] = 2; 416 417 //Verify that the output pixels are what we expected 418 output = psPixelsTransform(output, input, trans); 419 printf("\n output return %ld pixels\n\n", output->n); 420 int nExpected = 1; 421 if (output->n != nExpected) { 422 psError(PS_ERR_BAD_PARAMETER_SIZE, false, 423 "psPixelsTransform failed to return the expected number of pixels.\n"); 424 return 3; 425 } 426 427 psFree(input); 428 psFree(output); 429 psFree(trans); 430 431 return 0; 432 } 433
Note:
See TracChangeset
for help on using the changeset viewer.
