Changeset 6770 for trunk/psLib/test/imageops
- Timestamp:
- Apr 4, 2006, 12:04:46 PM (20 years ago)
- Location:
- trunk/psLib/test/imageops
- Files:
-
- 2 edited
-
tst_psImagePixelExtract.c (modified) (3 diffs)
-
verified/tst_psImagePixelExtract.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/imageops/tst_psImagePixelExtract.c
r6750 r6770 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-04-0 1 02:43:57$8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-04 22:04:46 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 773 773 int num = 0; 774 774 775 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message ");775 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)"); 776 776 out = psImageRow(NULL, image, num); 777 777 if (out != NULL) { 778 778 return 1; 779 779 } 780 780 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)"); 781 out = psImageCol(NULL, image, num); 782 if (out != NULL) { 783 return 1; 784 } 781 785 782 786 image = psImageAlloc(3, 3, PS_TYPE_F64); 787 788 //Test for invalid row0. 789 *(psS32*)&(image->row0) = -1; 790 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)"); 791 out = psImageRow(NULL, image, num); 792 if (out != NULL) { 793 return 2; 794 } 795 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)"); 796 out = psImageCol(NULL, image, num); 797 if (out != NULL) { 798 return 2; 799 } 800 801 //Test for invalid col0. 783 802 *(psS32*)&(image->row0) = 5; 803 *(psS32*)&(image->col0) = -1; 804 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)"); 805 out = psImageRow(NULL, image, num); 806 if (out != NULL) { 807 return 3; 808 } 809 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)"); 810 out = psImageCol(NULL, image, num); 811 if (out != NULL) { 812 return 3; 813 } 814 815 //Test for invalid numRows 784 816 *(psS32*)&(image->col0) = 10; 817 *(int*)&(image->numRows) = -1; 818 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)"); 819 out = psImageRow(NULL, image, num); 820 if (out != NULL) { 821 return 4; 822 } 823 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)"); 824 out = psImageCol(NULL, image, num); 825 if (out != NULL) { 826 return 4; 827 } 828 //Test for invalid numCols 829 *(int*)&(image->numRows) = 3; 830 *(int*)&(image->numCols) = -1; 831 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)"); 832 out = psImageRow(NULL, image, num); 833 if (out != NULL) { 834 return 5; 835 } 836 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)"); 837 out = psImageCol(NULL, image, num); 838 if (out != NULL) { 839 return 5; 840 } 841 //Test for invalid row/col number specified. 842 *(int*)&(image->numCols) = 3; 843 num = 8; 844 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)"); 845 out = psImageRow(NULL, image, num); 846 if (out != NULL) { 847 return 6; 848 } 849 num = 13; 850 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)"); 851 out = psImageCol(NULL, image, num); 852 if (out != NULL) { 853 return 6; 854 } 855 num = 3; 856 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)"); 857 out = psImageRow(NULL, image, num); 858 if (out != NULL) { 859 return 7; 860 } 861 num = 8; 862 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)"); 863 out = psImageCol(NULL, image, num); 864 if (out != NULL) { 865 return 7; 866 } 867 num = -10; 868 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)"); 869 out = psImageRow(NULL, image, num); 870 if (out != NULL) { 871 return 8; 872 } 873 num = -14; 874 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)"); 875 out = psImageCol(NULL, image, num); 876 if (out != NULL) { 877 return 8; 878 } 879 880 //Test valid cases. 881 image->col0 = 10; 882 image->row0 = 5; 883 *(int*)&(image->numRows) = 3; 884 *(int*)&(image->numCols) = 3; 785 885 image->data.F64[0][0] = 666.666; 786 886 image->data.F64[1][0] = 66.6; … … 792 892 image->data.F64[1][2] = 666.66; 793 893 image->data.F64[2][2] = 66.66; 794 795 796 894 num = 7; 895 out = psImageRow(out, image, num); 896 if (out == NULL) { 897 psError(PS_ERR_BAD_PARAMETER_NULL, false, 898 "psImageRow failed to return correct psVector output.\n"); 899 return 10; 900 } else { 901 psFree(out); 902 out = NULL; 903 } 904 num = 11; 905 out = psImageCol(NULL, image, num); 906 if (out == NULL) { 907 psError(PS_ERR_BAD_PARAMETER_NULL, false, 908 "psImageCol failed to return correct psVector output.\n"); 909 return 10; 910 } else { 911 psFree(out); 912 out = NULL; 913 } 914 915 num = -3; 916 out = psImageRow(out, image, num); 917 if (out == NULL) { 918 psError(PS_ERR_BAD_PARAMETER_NULL, false, 919 "psImageRow failed to return correct psVector output.\n"); 920 return 10; 921 } else { 922 psFree(out); 923 out = NULL; 924 } 925 num = -1; 926 out = psImageCol(NULL, image, num); 927 if (out == NULL) { 928 psError(PS_ERR_BAD_PARAMETER_NULL, false, 929 "psImageCol failed to return correct psVector output.\n"); 930 return 10; 931 } 797 932 psFree(out); 798 933 psFree(image); -
trunk/psLib/test/imageops/verified/tst_psImagePixelExtract.stderr
r6750 r6770 145 145 146 146 <DATE><TIME>|<HOST>|I|testImageRowColError 147 Following should generate error message 148 <DATE><TIME>|<HOST>|E|psImageRow (FILE:LINENO) 149 Can not operate on a NULL psImage. 147 Following should generate error message(for row) 148 <DATE><TIME>|<HOST>|E|psImageRow (FILE:LINENO) 149 Can not operate on a NULL psImage. 150 <DATE><TIME>|<HOST>|I|testImageRowColError 151 Following should generate error message(for col) 152 <DATE><TIME>|<HOST>|E|psImageCol (FILE:LINENO) 153 Can not operate on a NULL psImage. 154 <DATE><TIME>|<HOST>|I|testImageRowColError 155 Following should generate error message(for row) 156 <DATE><TIME>|<HOST>|E|psImageRow (FILE:LINENO) 157 psImage input is invalid. row0 cannot be negative. 158 <DATE><TIME>|<HOST>|I|testImageRowColError 159 Following should generate error message(for col) 160 <DATE><TIME>|<HOST>|E|psImageCol (FILE:LINENO) 161 psImage input is invalid. row0 cannot be negative. 162 <DATE><TIME>|<HOST>|I|testImageRowColError 163 Following should generate error message(for row) 164 <DATE><TIME>|<HOST>|E|psImageRow (FILE:LINENO) 165 psImage input is invalid. col0 cannot be negative. 166 <DATE><TIME>|<HOST>|I|testImageRowColError 167 Following should generate error message(for col) 168 <DATE><TIME>|<HOST>|E|psImageCol (FILE:LINENO) 169 psImage input is invalid. col0 cannot be negative. 170 <DATE><TIME>|<HOST>|I|testImageRowColError 171 Following should generate error message(for row) 172 <DATE><TIME>|<HOST>|E|psImageRow (FILE:LINENO) 173 psImage input is invalid. numRows must be greater than 0. 174 <DATE><TIME>|<HOST>|I|testImageRowColError 175 Following should generate error message(for col) 176 <DATE><TIME>|<HOST>|E|psImageCol (FILE:LINENO) 177 psImage input is invalid. numRows must be greater than 0. 178 <DATE><TIME>|<HOST>|I|testImageRowColError 179 Following should generate error message(for row) 180 <DATE><TIME>|<HOST>|E|psImageRow (FILE:LINENO) 181 psImage input is invalid. numCols must be greater than 0. 182 <DATE><TIME>|<HOST>|I|testImageRowColError 183 Following should generate error message(for col) 184 <DATE><TIME>|<HOST>|E|psImageCol (FILE:LINENO) 185 psImage input is invalid. numCols must be greater than 0. 186 <DATE><TIME>|<HOST>|I|testImageRowColError 187 Following should generate error message(for row) 188 <DATE><TIME>|<HOST>|E|psImageRow (FILE:LINENO) 189 Specified row number is out of range for specified image. 190 <DATE><TIME>|<HOST>|I|testImageRowColError 191 Following should generate error message(for col) 192 <DATE><TIME>|<HOST>|E|psImageCol (FILE:LINENO) 193 Specified column number is out of range for specified image. 194 <DATE><TIME>|<HOST>|I|testImageRowColError 195 Following should generate error message(for row) 196 <DATE><TIME>|<HOST>|E|psImageRow (FILE:LINENO) 197 Specified row number is out of range for specified image. 198 <DATE><TIME>|<HOST>|I|testImageRowColError 199 Following should generate error message(for col) 200 <DATE><TIME>|<HOST>|E|psImageCol (FILE:LINENO) 201 Specified column number is out of range for specified image. 202 <DATE><TIME>|<HOST>|I|testImageRowColError 203 Following should generate error message(for row) 204 <DATE><TIME>|<HOST>|E|psImageRow (FILE:LINENO) 205 Specified row number is out of range for specified image. 206 <DATE><TIME>|<HOST>|I|testImageRowColError 207 Following should generate error message(for col) 208 <DATE><TIME>|<HOST>|E|psImageCol (FILE:LINENO) 209 Specified column number is out of range for specified image. 150 210 151 211 ---> TESTPOINT PASSED (psImage{testImageRowColError} | tst_psImagePixelExtract.c)
Note:
See TracChangeset
for help on using the changeset viewer.
