Changeset 2855 for trunk/psLib/test/astronomy/tst_psAstrometry.c
- Timestamp:
- Dec 30, 2004, 10:18:37 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/astronomy/tst_psAstrometry.c (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astronomy/tst_psAstrometry.c
r2536 r2855 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-1 1-30 21:47:19$7 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-12-30 20:18:36 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 278 278 279 279 /* 280 2. Call psFPAAlloc with nChips = 0. Verify that the chips array is 280 2. Call psFPAAlloc with nChips = 0. Verify that the chips array is 281 281 zero in size and the program execution does not stop. 282 282 */ … … 291 291 292 292 /* 293 3. Call psFPAAlloc with a NULL psExposure. Verify that the program 293 3. Call psFPAAlloc with a NULL psExposure. Verify that the program 294 294 execution doe not stop and the exposure attribute is NULL. 295 295 */ … … 303 303 304 304 /* 305 4. Call psFPAAlloc and set all references in the struct to a memory 306 buffer. Verify that psFree cleans up all the buffers referenced in 305 4. Call psFPAAlloc and set all references in the struct to a memory 306 buffer. Verify that psFree cleans up all the buffers referenced in 307 307 the struct, i.e., there is no memory leaks generated. 308 308 */ … … 353 353 354 354 /* 355 1. invoke psChipAlloc with nCells > 0 and parentFPA non-NULL. Verify 355 1. invoke psChipAlloc with nCells > 0 and parentFPA non-NULL. Verify 356 356 that: 357 357 a. the cells array is of the size nCells and all elements are NULL. 358 b. parent attribute is set to parentFPA parameter and the ref. count 358 b. parent attribute is set to parentFPA parameter and the ref. count 359 359 was incremented. 360 360 c. all other attributes are initialized to NULL or 0. … … 368 368 } 369 369 370 if (chip->cells->n != 8) {370 if (chip->cells->n != 0) { 371 371 psLogMsg(__func__,PS_LOG_ERROR, 372 372 "psChipAlloc did not set the number of cells properly."); 373 return 2; 374 } 375 376 if (chip->cells->nalloc != 8) { 377 psLogMsg(__func__,PS_LOG_ERROR, 378 "psChipAlloc did not allocate cell array size properly."); 373 379 return 2; 374 380 } … … 382 388 chip->cells->data[lcv] = psAlloc(4); // to check if these are freed. 383 389 } 390 chip->cells->n = 8; 384 391 385 392 if (chip->parent != fpa) { … … 419 426 2. invoke psChipAlloc with nCells = 0. Verify that: 420 427 a. execution does not halt 421 b. the cells array is of the size of zero.428 b. the cells array is of the size of one. 422 429 */ 423 430 … … 435 442 } 436 443 444 if (chip2->cells->nalloc != 1) { 445 psLogMsg(__func__,PS_LOG_ERROR, 446 "psChipAlloc did not allocate cell array size properly."); 447 return 12; 448 } 449 437 450 if (chip2->parent != fpa) { 438 451 psLogMsg(__func__,PS_LOG_ERROR, … … 448 461 449 462 /* 450 3. invoke psChipAlloc with parentFPA = NULL. Verify that parent 463 3. invoke psChipAlloc with parentFPA = NULL. Verify that parent 451 464 attribute is NULL and no error is generated. 452 465 */ … … 459 472 } 460 473 461 if (chip3->cells->n != 8) {474 if (chip3->cells->n != 0) { 462 475 psLogMsg(__func__,PS_LOG_ERROR, 463 476 "psChipAlloc did not set the number of cells properly."); 464 477 return 22; 478 } 479 480 if (chip3->cells->nalloc != 8) { 481 psLogMsg(__func__,PS_LOG_ERROR, 482 "psChipAlloc did not allocate cell array properly."); 483 return 23; 465 484 } 466 485 … … 487 506 488 507 psObservatory* obs = psObservatoryAlloc(name, 489 20.7*M_PI/180.0, 156.3*M_PI/180.0, 3055.0, 0.0065f); 490 491 psExposure* exp = psExposureAlloc(1.0, 2.0, 3.0, 4.0, 5.0, 492 now, 6.0f, 260.0f, 1013.0f, 0.7f, 10.0f, 0.650f, obs); 508 20.7*M_PI/180.0, 509 156.3*M_PI/180.0, 510 3055.0, 511 0.0065f); 512 513 psExposure* exp = psExposureAlloc(1.0, 514 2.0, 515 3.0, 516 4.0, 517 5.0, 518 now, 519 6.0f, 520 260.0f, 521 1013.0f, 522 0.7f, 523 10.0f, 524 0.650f, 525 obs); 493 526 494 527 psFPA* fpa = psFPAAlloc(8, exp); … … 507 540 1. invoke psCellAlloc with nReadouts > 0 and parentChip non-NULL. Verify that: 508 541 a. the readouts array is of the size nReadouts and all elements are NULL. 509 b. parent attribute is set to parentChip parameter and the ref. count 542 b. parent attribute is set to parentChip parameter and the ref. count 510 543 was incremented. 511 544 c. all other attributes are initialized to NULL or 0. … … 519 552 } 520 553 521 if (cell1->readouts->n != 8) {554 if (cell1->readouts->n != 0) { 522 555 psLogMsg(__func__,PS_LOG_ERROR, 523 556 "psCellAlloc did not set the number of readouts properly."); 557 return 2; 558 } 559 560 if (cell1->readouts->nalloc != 8) { 561 psLogMsg(__func__,PS_LOG_ERROR, 562 "psCellAlloc did not allocat the readout array properly."); 524 563 return 2; 525 564 } … … 533 572 cell1->readouts->data[lcv] = psAlloc(4); // to check if these are freed. 534 573 } 574 cell1->readouts->n = 8; 535 575 536 576 if (cell1->parent != chip) { … … 584 624 2. invoke psChipAlloc with nCells = 0. Verify that: 585 625 a. execution does not halt 586 b. the cells array is of the size of zero.626 b. the cells array is of the size of one. 587 627 */ 588 628 … … 600 640 } 601 641 642 if (cell2->readouts->nalloc != 1) { 643 psLogMsg(__func__,PS_LOG_ERROR, 644 "psCellAlloc did not allocate the readout array properly."); 645 return 13; 646 } 647 602 648 if (cell2->parent != chip) { 603 649 psLogMsg(__func__,PS_LOG_ERROR, … … 613 659 614 660 /* 615 3. invoke psChipAlloc with parentFPA = NULL. Verify that parent 661 3. invoke psChipAlloc with parentFPA = NULL. Verify that parent 616 662 attribute is NULL and no error is generated. 617 663 */ … … 624 670 } 625 671 626 if (cell3->readouts->n != 8) {672 if (cell3->readouts->n != 0) { 627 673 psLogMsg(__func__,PS_LOG_ERROR, 628 674 "psCellAlloc did not set the number of cells properly."); 629 675 return 22; 676 } 677 678 if (cell3->readouts->nalloc != 8) { 679 psLogMsg(__func__,PS_LOG_ERROR, 680 "psCellAlloc did not set the number of cells properly."); 681 return 23; 630 682 } 631 683 … … 647 699 static psS32 testReadoutAlloc(void) 648 700 { 649 psImage* image = psImageAlloc(64,64,PS_TYPE_S8); 650 651 652 /* 653 1. invoke psReadoutAlloc with unique/non-zero x0,y0 and non-NULL image. Verify that: 654 a. col0 & row0 are set to the parameters x0 and y0, respectively. 655 b. image attribute is set to image parameter and referenece is incremented 656 c. mask, objects, and metadata attributes are all NULL 657 */ 658 psReadout* readout = psReadoutAlloc(1,2,image); 701 psReadout* readout = psReadoutAlloc(); 659 702 660 703 if (readout == NULL) { … … 663 706 } 664 707 665 if (readout->col0 != 1) {708 if (readout->col0 != 0) { 666 709 psLogMsg(__func__,PS_LOG_ERROR, 667 710 "psReadoutAlloc did not set col0 properly."); … … 669 712 } 670 713 671 if (readout->row0 != 2) {714 if (readout->row0 != 0) { 672 715 psLogMsg(__func__,PS_LOG_ERROR, 673 716 "psReadoutAlloc did not set row0 properly."); … … 675 718 } 676 719 677 if (readout->image != image) {720 if (readout->image != NULL) { 678 721 psLogMsg(__func__,PS_LOG_ERROR, 679 722 "psReadoutAlloc did not set the image properly."); … … 681 724 } 682 725 683 if (psMemGetRefCounter(image) != 1) { 684 psLogMsg(__func__,PS_LOG_ERROR, 685 "psReadoutAlloc incremented reference counter for image."); 686 return 5; 687 } 726 readout->image = psAlloc(4); // to check if these are freed. 688 727 689 728 if (readout->metadata != NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.
