Changeset 5174 for trunk/psLib/test/imageops/tst_psImagePixelExtract.c
- Timestamp:
- Sep 28, 2005, 3:15:38 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/imageops/tst_psImagePixelExtract.c
r4547 r5174 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 7-13 02:47:00$8 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-09-29 01:15:38 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 21 21 static psS32 testImageCut(void); 22 22 static psS32 testImageRadialCut(void); 23 static psS32 testImageRowCol(void); 23 24 24 25 … … 27 28 {testImageCut, 555, "psImageCut", 0, false}, 28 29 {testImageRadialCut, 557, "psImageRadialCut", 0, false}, 30 {testImageRowCol, 559, "psImageRowCol", 0, false}, 29 31 {NULL} 30 32 }; … … 742 744 return 0; 743 745 } 746 747 psS32 testImageRowCol(void) 748 { 749 psVector *rowcol = NULL; 750 psVector *empty = NULL; 751 psImage *image = NULL; 752 psImage *emptyImage = NULL; 753 754 image = psImageAlloc(3, 3, PS_TYPE_F64); 755 rowcol = psVectorAlloc(3, PS_TYPE_F64); 756 757 image->data.F64[0][0] = 666.666; 758 image->data.F64[1][0] = 66.6; 759 image->data.F64[2][0] = 6.66; 760 image->data.F64[0][1] = 6.6; 761 image->data.F64[1][1] = 6.666; 762 image->data.F64[2][1] = 66.666; 763 image->data.F64[0][2] = 666.6; 764 image->data.F64[1][2] = 666.66; 765 image->data.F64[2][2] = 66.66; 766 767 //Test for error with NULL image 768 empty = psImageCol(empty, emptyImage, 0); 769 if (empty != NULL) { 770 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 771 "psImageCol failed to return NULL for NULL image input.\n"); 772 return 1; 773 } 774 //Test for error with Out of Range Row 775 empty = psImageRow(empty, image, 5); 776 if (empty != NULL) { 777 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 778 "psImageRow failed to return NULL for out of range row input.\n"); 779 return 2; 780 } 781 rowcol->data.F64[0] = 1.1; 782 rowcol->data.F64[2] = 2.2; 783 //Test recycling of non-NULL vector & correct output 784 rowcol = psImageCol(rowcol, image, 1); 785 if (rowcol->data.F64[0] != 66.6 && rowcol->data.F64[2] != 666.66) { 786 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 787 "psImageCol failed to return correct values.\n"); 788 return 3; 789 } 790 791 psFree(rowcol); 792 psFree(image); 793 return 0; 794 } 795
Note:
See TracChangeset
for help on using the changeset viewer.
