Changeset 3366 for trunk/psLib/test/astronomy/tst_psCoord.c
- Timestamp:
- Mar 2, 2005, 11:03:20 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/astronomy/tst_psCoord.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astronomy/tst_psCoord.c
r3365 r3366 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-03-02 19:41:31$8 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-03-02 21:03:20 $ 10 10 * 11 11 * XXX: THe psProject() and psDeproject() functions do not work fully. They … … 22 22 #include "pslib.h" 23 23 static psS32 testSphereTransformAlloc( void ); 24 static psS32 test 1b( void );24 static psS32 testPlaneTransformAlloc( void ); 25 25 static psS32 test1c( void ); 26 26 static psS32 test2( void ); … … 44 44 testDescription tests[] = { 45 45 {testSphereTransformAlloc, 819, "psSphereTransformAlloc()", 0, false}, 46 {test 1b, 0000, "psPlaneTransformAlloc()", 0, false},46 {testPlaneTransformAlloc, 826, "psPlaneTransformAlloc()", 0, false}, 47 47 {test1c, 0000, "psPlaneDistortAlloc()", 0, false}, 48 48 {test2, 0000, "psPlaneTransformApply()", 0, false}, … … 145 145 #define NY_TERMS 4 146 146 #define NZ_TERMS 5 147 psS32 test1b( void ) 148 { 149 psS32 testStatus = 0; 147 148 psS32 testPlaneTransformAlloc( void ) 149 { 150 // psS32 testStatus = 0; 151 // Allocate psPlaneTransform with known x and y terms 150 152 psPlaneTransform *myPT = psPlaneTransformAlloc(NX_TERMS, NY_TERMS); 151 153 154 // Verify returned value is not NULL 155 if(myPT == NULL) { 156 psError(PS_ERR_UNKNOWN,true,"Function returned NULL not expected."); 157 return 1; 158 } 159 160 // Verify returned transform has members set properly 152 161 if (myPT->x->nX != NX_TERMS) { 153 printf("ERROR: myPT->x->nX is %d, should be %d\n", myPT->x->nX, NX_TERMS); 154 testStatus = 1; 162 psError(PS_ERR_UNKNOWN,true,"myPT->x->nX is %d, should be %d", 163 myPT->x->nX, NX_TERMS); 164 return 2; 155 165 } 156 166 if (myPT->y->nX != NX_TERMS) { 157 p rintf("ERROR: myPT->y->nX is %d, should be %d\n", myPT->y->nX, NX_TERMS);158 testStatus = 1;159 }160 167 psError(PS_ERR_UNKNOWN,true,"myPT->y->nX is %d, should be %d", 168 myPT->y->nX, NX_TERMS); 169 return 3; 170 } 161 171 if (myPT->x->nY != NY_TERMS) { 162 printf("ERROR: myPT->x->nY is %d, should be %d\n", myPT->x->nY, NY_TERMS); 163 testStatus = 1; 172 psError(PS_ERR_UNKNOWN,true,"myPT->x->nY is %d, should be %d", 173 myPT->x->nY, NY_TERMS); 174 return 4; 164 175 } 165 176 if (myPT->y->nY != NY_TERMS) { 166 printf("ERROR: myPT->y->nY is %d, should be %d\n", myPT->y->nY, NY_TERMS); 167 testStatus = 1; 168 } 177 psError(PS_ERR_UNKNOWN,true,"myPT->y->nY is %d, should be %d", 178 myPT->y->nY, NY_TERMS); 179 return 5; 180 } 181 182 // Free plane transform 169 183 psFree(myPT); 170 184 171 printf("-------------------------------------------------------------------\n");172 p rintf("Calling psPlaneTransformAlloc() with negative-order polynomial request. Should generate error, return NULL.\n");185 // Attempt to specify negative x terms and verify NULL returned and errror message generated 186 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative x terms"); 173 187 myPT = psPlaneTransformAlloc(-1.0, 1.0); 174 188 if (myPT != NULL) { 175 printf("TEST ERROR: psPlaneTransformAlloc() did not return NULL.\n"); 176 testStatus = false; 177 myPT = NULL; 178 } 179 180 printf("-------------------------------------------------------------------\n"); 181 printf("Calling psPlaneTransformAlloc() with negative-order polynomial request. Should generate error, return NULL.\n"); 189 psError(PS_ERR_UNKNOWN,true,"psPlaneTransformAlloc() did not return NULL."); 190 return 6; 191 } 192 193 // Attempt to specify negative y terms and verify NULL returned and error message generated 194 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative y terms"); 182 195 myPT = psPlaneTransformAlloc(1.0, -1.0); 183 196 if (myPT != NULL) { 184 printf("TEST ERROR: psPlaneTransformAlloc() did not return NULL.\n"); 185 testStatus = false; 186 myPT = NULL; 187 } 188 printf("-------------------------------------------------------------------\n"); 189 197 psError(PS_ERR_UNKNOWN,true,"psPlaneTransformAlloc() did not return NULL."); 198 return 7; 199 } 190 200 191 201 psFree(myPT); 192 return(testStatus); 193 } 202 203 return 0; 204 } 205 206 194 207 psS32 test1c( void ) 195 208 {
Note:
See TracChangeset
for help on using the changeset viewer.
