Changeset 5681 for trunk/psModules/test/objects/tst_pmObjects01.c
- Timestamp:
- Dec 5, 2005, 11:28:55 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/test/objects/tst_pmObjects01.c (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/test/objects/tst_pmObjects01.c
r5516 r5681 20 20 * XXX: Memory leaks are not being caught. If I allocated a psVector in these functions 21 21 * and never deallocate, no error is generated. 22 * 23 * XXX: Much of this file is commented out due to the API changes in rel 7. 24 * 25 * 22 26 Fully Tested: 23 27 pmPeakAlloc() … … 27 31 most of psObjects.c is not tested 28 32 * 29 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $30 * @date $Date: 2005-1 1-15 20:09:03$33 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 34 * @date $Date: 2005-12-05 21:28:55 $ 31 35 * 32 36 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 50 54 //static int test07(void); 51 55 //static int test08(void); 52 static int test09(void);53 static int test15(void);54 static int test16(void);55 static int test20(void);56 //static int test09(void); 57 //static int test15(void); 58 //static int test16(void); 59 //static int test20(void); 56 60 testDescription tests[] = { 57 61 {test00, 000, "pmObjects: structure allocators and deallocators", true, false}, … … 64 68 // {test07, 001, "pmObjects: pmMin()", true, false}, 65 69 // {test08, 001, "pmObjects: pmSourceModelGuess()", true, false}, 66 {test09, 001, "pmObjects: pmSourceContour()", true, false},67 {test15, 001, "pmObjects: pmSourceAddModel()", true, false},68 {test16, 001, "pmObjects: pmSourceSubModel()", true, false},69 {test20, 001, "pmObjects: pmSourceSubModel()", true, false},70 //{test09, 001, "pmObjects: pmSourceContour()", true, false}, 71 //{test15, 001, "pmObjects: pmSourceAddModel()", true, false}, 72 //{test16, 001, "pmObjects: pmSourceSubModel()", true, false}, 73 //{test20, 001, "pmObjects: pmSourceSubModel()", true, false}, 70 74 {NULL} 71 75 }; … … 1063 1067 XXX: We don't verify the numbers. 1064 1068 *****************************************************************************/ 1069 /* 1065 1070 int test15( void ) 1066 1071 { … … 1083 1088 testStatus = false; 1084 1089 } 1085 1086 1090 1091 1087 1092 tmpSource->modelPSF = pmModelAlloc(PS_MODEL_GAUSS); 1088 1093 tmpSource->modelPSF->params->data.F32[0] = 5.0; … … 1093 1098 tmpSource->modelPSF->params->data.F32[5] = 1.0; 1094 1099 tmpSource->modelPSF->params->data.F32[6] = 2.0; 1095 1100 1096 1101 printf("----------------------------------------------------------------------------------\n"); 1097 1102 printf("Calling pmSourceAddModel with NULL psImage. Should generate error, return FALSE.\n"); … … 1101 1106 testStatus = false; 1102 1107 } 1103 1108 1104 1109 printf("----------------------------------------------------------------------------------\n"); 1105 1110 printf("Calling pmSourceAddModel with NULL psSrc. Should generate error, return FALSE.\n"); … … 1109 1114 testStatus = false; 1110 1115 } 1111 1116 1112 1117 printf("----------------------------------------------------------------------------------\n"); 1113 1118 printf("Calling pmSourceAddModel with acceptable data.\n"); … … 1117 1122 testStatus = false; 1118 1123 } 1119 1124 1120 1125 psFree(tmpSource); 1121 1126 psFree(imgData); 1122 1127 return(testStatus); 1123 1128 } 1129 */ 1124 1130 1125 1131 #define TST16_NUM_ROWS 100 … … 1134 1140 XXX: We don't verify the numbers. 1135 1141 *****************************************************************************/ 1142 /* 1136 1143 int test16( void ) 1137 1144 { … … 1145 1152 pmSource *tmpSource = NULL; 1146 1153 psBool rc = false; 1147 1154 1148 1155 pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST16_NUM_ROWS / 2), 1149 1156 (psF32) (TST16_NUM_COLS / 2), 1150 1157 200.0, 1151 1158 PM_PEAK_LONE); 1152 1159 1153 1160 printf("Calling pmSourceLocalSky with valid data.\n"); 1154 1161 tmpPeak->x = (psF32) (TST16_NUM_ROWS / 2); … … 1159 1166 (psF32) TST16_INNER_RADIUS, 1160 1167 (psF32) TST16_OUTER_RADIUS); 1161 1168 1162 1169 if (tmpSource == NULL) { 1163 1170 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n"); 1164 1171 testStatus = false; 1165 1172 } 1166 1173 1167 1174 tmpSource->modelPSF = pmModelAlloc(PS_MODEL_GAUSS); 1168 1175 tmpSource->modelPSF->params->data.F32[0] = 5.0; … … 1173 1180 tmpSource->modelPSF->params->data.F32[5] = 1.0; 1174 1181 tmpSource->modelPSF->params->data.F32[6] = 2.0; 1175 1182 1176 1183 printf("----------------------------------------------------------------------------------\n"); 1177 1184 printf("Calling pmSourceSubModel with NULL psImage. Should generate error, return FALSE.\n"); … … 1181 1188 testStatus = false; 1182 1189 } 1183 1190 1184 1191 printf("----------------------------------------------------------------------------------\n"); 1185 1192 printf("Calling pmSourceSubModel with NULL psSrc. Should generate error, return FALSE.\n"); … … 1189 1196 testStatus = false; 1190 1197 } 1191 1198 1192 1199 printf("----------------------------------------------------------------------------------\n"); 1193 1200 printf("Calling pmSourceSubModel with acceptable data.\n"); … … 1197 1204 testStatus = false; 1198 1205 } 1199 1206 1200 1207 psFree(tmpSource); 1201 1208 psFree(imgData); 1202 1209 return(testStatus); 1203 1210 } 1211 */ 1204 1212 1205 1213 #define TST20_NUM_ROWS 100 … … 1214 1222 XXX: We don't verify the numbers. 1215 1223 *****************************************************************************/ 1224 /* 1216 1225 int test20( void ) 1217 1226 { … … 1225 1234 pmSource *tmpSource = NULL; 1226 1235 psBool rc = false; 1227 1236 1228 1237 pmPeak *tmpPeak = pmPeakAlloc((psF32) (TST20_NUM_ROWS / 2), 1229 1238 (psF32) (TST20_NUM_COLS / 2), 1230 1239 200.0, 1231 1240 PM_PEAK_LONE); 1232 1241 1233 1242 printf("Calling pmSourceLocalSky with valid data.\n"); 1234 1243 tmpPeak->x = (psF32) (TST20_NUM_ROWS / 2); … … 1239 1248 (psF32) TST20_INNER_RADIUS, 1240 1249 (psF32) TST20_OUTER_RADIUS); 1241 1250 1242 1251 if (tmpSource == NULL) { 1243 1252 printf("TEST ERROR: pmSourceLocalSky() returned a NULL pmSource.\n"); 1244 1253 testStatus = false; 1245 1254 } 1246 1255 1247 1256 tmpSource->modelPSF = pmModelAlloc(PS_MODEL_GAUSS); 1248 1249 1257 1258 1250 1259 tmpSource->modelPSF->params->data.F32[0] = 5.0; 1251 1260 tmpSource->modelPSF->params->data.F32[1] = 70.0; … … 1255 1264 tmpSource->modelPSF->params->data.F32[5] = 1.0; 1256 1265 tmpSource->modelPSF->params->data.F32[6] = 2.0; 1257 1266 1258 1267 printf("----------------------------------------------------------------------------------\n"); 1259 1268 printf("Calling pmSourceFitModel with NULL psImage. Should generate error, return FALSE.\n"); … … 1263 1272 testStatus = false; 1264 1273 } 1265 1274 1266 1275 printf("----------------------------------------------------------------------------------\n"); 1267 1276 printf("Calling pmSourceFitModel with NULL pmSource. Should generate error, return FALSE.\n"); … … 1271 1280 testStatus = false; 1272 1281 } 1273 1282 1274 1283 printf("----------------------------------------------------------------------------------\n"); 1275 1284 printf("Calling pmSourceFitModel with acceptable data.\n"); 1276 1285 rc = pmSourceFitModel(tmpSource, imgData); 1277 1286 printf("pmSourceFitModel returned %d\n", rc); 1278 1287 1279 1288 // XXX: Memory leaks are not being tested 1280 1289 psVector *junk = psVectorAlloc(10, PS_TYPE_F32); 1281 1290 junk->data.F32[0] = 0.0; 1282 1291 1283 1292 psFree(tmpSource); 1284 1293 psFree(imgData); 1285 1294 return(testStatus); 1286 1295 } 1287 1288 1296 */ 1297
Note:
See TracChangeset
for help on using the changeset viewer.
