Changeset 3367
- Timestamp:
- Mar 2, 2005, 1:00:17 PM (21 years ago)
- Location:
- trunk/psLib/test/astronomy
- Files:
-
- 3 edited
-
tst_psCoord.c (modified) (5 diffs)
-
verified/tst_psCoord.stderr (modified) (1 diff)
-
verified/tst_psCoord.stdout (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astronomy/tst_psCoord.c
r3366 r3367 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-03-02 2 1:03:20$8 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-03-02 23:00:17 $ 10 10 * 11 11 * XXX: THe psProject() and psDeproject() functions do not work fully. They … … 23 23 static psS32 testSphereTransformAlloc( void ); 24 24 static psS32 testPlaneTransformAlloc( void ); 25 static psS32 test 1c( void );25 static psS32 testPlaneDistortAlloc( void ); 26 26 static psS32 test2( void ); 27 27 static psS32 test3( void ); … … 45 45 {testSphereTransformAlloc, 819, "psSphereTransformAlloc()", 0, false}, 46 46 {testPlaneTransformAlloc, 826, "psPlaneTransformAlloc()", 0, false}, 47 {test 1c, 0000, "psPlaneDistortAlloc()", 0, false},47 {testPlaneDistortAlloc, 827, "psPlaneDistortAlloc()", 0, false}, 48 48 {test2, 0000, "psPlaneTransformApply()", 0, false}, 49 49 {test3, 0000, "psPlaneDistortApply()", 0, false}, … … 148 148 psS32 testPlaneTransformAlloc( void ) 149 149 { 150 // psS32 testStatus = 0;151 150 // Allocate psPlaneTransform with known x and y terms 152 151 psPlaneTransform *myPT = psPlaneTransformAlloc(NX_TERMS, NY_TERMS); … … 205 204 206 205 207 psS32 test 1c( void )208 { 209 psS32 testStatus = 0;206 psS32 testPlaneDistortAlloc( void ) 207 { 208 // Invoke function with known parameters 210 209 psPlaneDistort *myPD = psPlaneDistortAlloc(NW_TERMS, NX_TERMS, NY_TERMS, NZ_TERMS); 211 210 211 // Verify NULL is not returned 212 if(myPD == NULL) { 213 psError(PS_ERR_UNKNOWN,true,"Return of NULL not expected"); 214 return 1; 215 } 216 // Verify the terms are properly set after allocation 212 217 if (myPD->x->nW != NW_TERMS) { 213 printf("ERROR: myPD->x->nW is %d, should be %d\n", myPD->x->nW, NW_TERMS); 214 testStatus = 1; 218 psError(PS_ERR_UNKNOWN,true,"myPD->x->nW is %d, should be %d", 219 myPD->x->nW, NW_TERMS); 220 return 2; 215 221 } 216 222 if (myPD->y->nW != NW_TERMS) { 217 p rintf("ERROR: myPD->y->nW is %d, should be %d\n", myPD->y->nW, NW_TERMS);218 testStatus = 1;219 }220 223 psError(PS_ERR_UNKNOWN,true,"myPD->y->nW is %d, should be %d", 224 myPD->y->nW, NW_TERMS); 225 return 3; 226 } 221 227 if (myPD->x->nX != NX_TERMS) { 222 printf("ERROR: myPD->x->nX is %d, should be %d\n", myPD->x->nX, NX_TERMS); 223 testStatus = 1; 228 psError(PS_ERR_UNKNOWN,true,"myPD->x->nX is %d, should be %d", 229 myPD->x->nX, NX_TERMS); 230 return 4; 224 231 } 225 232 if (myPD->y->nX != NX_TERMS) { 226 p rintf("ERROR: myPD->y->nX is %d, should be %d\n", myPD->y->nX, NX_TERMS);227 testStatus = 1;228 }229 233 psError(PS_ERR_UNKNOWN,true,"myPD->y->nX is %d, should be %d", 234 myPD->y->nX, NX_TERMS); 235 return 5; 236 } 230 237 if (myPD->x->nY != NY_TERMS) { 231 printf("ERROR: myPD->x->nY is %d, should be %d\n", myPD->x->nY, NY_TERMS); 232 testStatus = 1; 238 psError(PS_ERR_UNKNOWN,true,"myPD->x->nY is %d, should be %d", 239 myPD->x->nY, NY_TERMS); 240 return 6; 233 241 } 234 242 if (myPD->y->nY != NY_TERMS) { 235 p rintf("ERROR: myPD->y->nY is %d, should be %d\n", myPD->y->nY, NY_TERMS);236 testStatus = 1;237 }238 243 psError(PS_ERR_UNKNOWN,true,"myPD->y->nY is %d, should be %d", 244 myPD->y->nY, NY_TERMS); 245 return 7; 246 } 239 247 if (myPD->x->nZ != NZ_TERMS) { 240 printf("ERROR: myPD->x->nZ is %d, should be %d\n", myPD->x->nZ, NZ_TERMS); 241 testStatus = 1; 248 psError(PS_ERR_UNKNOWN,true,"myPD->x->nZ is %d, should be %d", 249 myPD->x->nZ, NZ_TERMS); 250 return 8; 242 251 } 243 252 if (myPD->y->nZ != NZ_TERMS) { 244 printf("ERROR: myPD->y->nZ is %d, should be %d\n", myPD->y->nZ, NZ_TERMS); 245 testStatus = 1; 246 } 247 253 psError(PS_ERR_UNKNOWN,true,"myPD->y->nZ is %d, should be %d", 254 myPD->y->nZ, NZ_TERMS); 255 return 9; 256 } 257 // Free psPlaneTransform 248 258 psFree(myPD); 249 259 250 printf("-------------------------------------------------------------------\n");251 p rintf("Calling psPlaneDistortAlloc() with negative-order polynomial request. Should generate error, return NULL.\n");260 // Invoke function with negative x term parameter 261 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative x term"); 252 262 myPD = psPlaneDistortAlloc(-1.0, 1.0, 1.0, 1.0); 253 263 if (myPD != NULL) { 254 printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n"); 255 testStatus = false; 256 myPD = NULL; 257 } 258 259 printf("-------------------------------------------------------------------\n"); 260 printf("Calling psPlaneDistortAlloc() with negative-order polynomial request. Should generate error, return NULL.\n"); 264 psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL."); 265 return 10; 266 } 267 268 // Invoke function with negative y term parameter 269 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative y term"); 261 270 myPD = psPlaneDistortAlloc(1.0, -1.0, 1.0, 1.0); 262 271 if (myPD != NULL) { 263 printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n"); 264 testStatus = false; 265 myPD = NULL; 266 } 267 268 printf("-------------------------------------------------------------------\n"); 269 printf("Calling psPlaneDistortAlloc() with negative-order polynomial request. Should generate error, return NULL.\n"); 272 psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL."); 273 return 11; 274 } 275 276 // Invoke function with negative z term parameter 277 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative z term"); 270 278 myPD = psPlaneDistortAlloc(1.0, 1.0, -1.0, 1.0); 271 279 if (myPD != NULL) { 272 printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n"); 273 testStatus = false; 274 myPD = NULL; 275 } 276 277 printf("-------------------------------------------------------------------\n"); 278 printf("Calling psPlaneDistortAlloc() with negative-order polynomial request. Should generate error, return NULL.\n"); 280 psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL."); 281 return 12; 282 } 283 284 // Invoke function with negative w term parameter 285 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative w term"); 279 286 myPD = psPlaneDistortAlloc(1.0, 1.0, 1.0, -1.0); 280 287 if (myPD != NULL) { 281 printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n"); 282 testStatus = false; 283 myPD = NULL; 284 } 285 printf("-------------------------------------------------------------------\n"); 286 287 return(testStatus); 288 psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL."); 289 } 290 291 return 0; 288 292 } 289 293 -
trunk/psLib/test/astronomy/verified/tst_psCoord.stderr
r3366 r3367 31 31 \**********************************************************************************/ 32 32 33 <DATE><TIME>|<HOST>|I|testPlaneDistortAlloc 34 Following should generate an error message for negative x term 33 35 <DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO) 34 36 Error: n1 is less than 0. 37 <DATE><TIME>|<HOST>|I|testPlaneDistortAlloc 38 Following should generate an error message for negative y term 35 39 <DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO) 36 40 Error: n2 is less than 0. 41 <DATE><TIME>|<HOST>|I|testPlaneDistortAlloc 42 Following should generate an error message for negative z term 37 43 <DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO) 38 44 Error: n3 is less than 0. 45 <DATE><TIME>|<HOST>|I|testPlaneDistortAlloc 46 Following should generate an error message for negative w term 39 47 <DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO) 40 48 Error: n4 is less than 0. -
trunk/psLib/test/astronomy/verified/tst_psCoord.stdout
r3366 r3367 1 -------------------------------------------------------------------2 Calling psPlaneDistortAlloc() with negative-order polynomial request. Should generate error, return NULL.3 -------------------------------------------------------------------4 Calling psPlaneDistortAlloc() with negative-order polynomial request. Should generate error, return NULL.5 -------------------------------------------------------------------6 Calling psPlaneDistortAlloc() with negative-order polynomial request. Should generate error, return NULL.7 -------------------------------------------------------------------8 Calling psPlaneDistortAlloc() with negative-order polynomial request. Should generate error, return NULL.9 -------------------------------------------------------------------10 1 ------------------------------------------------------------------- 11 2 Calling psPlaneTransformApply() with NULL psPlaneTransform. Should generate error, return NULL.
Note:
See TracChangeset
for help on using the changeset viewer.
