Changeset 5549 for trunk/psLib/test/astro/tst_psCoord.c
- Timestamp:
- Nov 18, 2005, 11:23:21 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/astro/tst_psCoord.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astro/tst_psCoord.c
r5294 r5549 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-1 0-12 21:02:20$8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-11-18 21:23:21 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 35 35 } 36 36 37 #define NX_TERMS238 #define NY_TERMS339 #define NZ_TERMS440 #define NT_TERMS537 #define ORDER_X 2 38 #define ORDER_Y 3 39 #define ORDER_Z 4 40 #define ORDER_T 5 41 41 42 42 psS32 testPlaneTransformAlloc( void ) 43 43 { 44 44 // Allocate psPlaneTransform with known x and y terms 45 psPlaneTransform *myPT = psPlaneTransformAlloc( NX_TERMS, NY_TERMS);45 psPlaneTransform *myPT = psPlaneTransformAlloc(ORDER_X, ORDER_Y); 46 46 47 47 // Verify returned value is not NULL … … 52 52 53 53 // Verify returned transform has members set properly 54 if ( (1 + myPT->x->nX) != NX_TERMS) {54 if (myPT->x->nX != ORDER_X) { 55 55 psError(PS_ERR_UNKNOWN,true,"myPT->x->nX is %d, should be %d", 56 myPT->x->nX, NX_TERMS-1);56 myPT->x->nX, ORDER_X); 57 57 return 2; 58 58 } 59 if ( (1 + myPT->y->nX) != NX_TERMS) {59 if (myPT->y->nX != ORDER_X) { 60 60 psError(PS_ERR_UNKNOWN,true,"myPT->y->nX is %d, should be %d", 61 myPT->y->nX, NX_TERMS-1);61 myPT->y->nX, ORDER_X); 62 62 return 3; 63 63 } 64 if ( (1 + myPT->x->nY) != NY_TERMS) {64 if (myPT->x->nY != ORDER_Y) { 65 65 psError(PS_ERR_UNKNOWN,true,"myPT->x->nY is %d, should be %d", 66 myPT->x->nY, NY_TERMS-1);66 myPT->x->nY, ORDER_Y); 67 67 return 4; 68 68 } 69 if ( (1 + myPT->y->nY) != NY_TERMS) {69 if (myPT->y->nY != ORDER_Y) { 70 70 psError(PS_ERR_UNKNOWN,true,"myPT->y->nY is %d, should be %d", 71 myPT->y->nY, NY_TERMS-1);71 myPT->y->nY, ORDER_Y); 72 72 return 5; 73 73 } … … 76 76 psFree(myPT); 77 77 78 // Attempt to specify negative x termsand verify NULL returned and errror message generated79 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative x terms");80 myPT = psPlaneTransformAlloc(-1 .0, 1.0);78 // Attempt to specify negative x order and verify NULL returned and errror message generated 79 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative x order"); 80 myPT = psPlaneTransformAlloc(-1, 1); 81 81 if (myPT != NULL) { 82 82 psError(PS_ERR_UNKNOWN,true,"psPlaneTransformAlloc() did not return NULL."); … … 84 84 } 85 85 86 // Attempt to specify negative y termsand verify NULL returned and error message generated87 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative y terms");88 myPT = psPlaneTransformAlloc(1 .0, -1.0);86 // Attempt to specify negative y order and verify NULL returned and error message generated 87 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative y order"); 88 myPT = psPlaneTransformAlloc(1, -1); 89 89 if (myPT != NULL) { 90 90 psError(PS_ERR_UNKNOWN,true,"psPlaneTransformAlloc() did not return NULL."); … … 101 101 { 102 102 // Invoke function with known parameters 103 psPlaneDistort *myPD = psPlaneDistortAlloc( NX_TERMS, NY_TERMS, NZ_TERMS, NT_TERMS);103 psPlaneDistort *myPD = psPlaneDistortAlloc(ORDER_X, ORDER_Y, ORDER_Z, ORDER_T); 104 104 105 105 // Verify NULL is not returned … … 109 109 } 110 110 // Verify the terms are properly set after allocation 111 if ( (1 + myPD->x->nX) != NX_TERMS) {111 if (myPD->x->nX != ORDER_X) { 112 112 psError(PS_ERR_UNKNOWN,true,"myPD->x->nX is %d, should be %d", 113 myPD->x->nX, NX_TERMS-1);113 myPD->x->nX, ORDER_X); 114 114 return 2; 115 115 } 116 if ( (1 + myPD->y->nX) != NX_TERMS) {116 if (myPD->y->nX != ORDER_X) { 117 117 psError(PS_ERR_UNKNOWN,true,"myPD->y->nX is %d, should be %d", 118 myPD->y->nX, NX_TERMS-1);118 myPD->y->nX, ORDER_X); 119 119 return 3; 120 120 } 121 if ( (1 + myPD->x->nY) != NY_TERMS) {121 if (myPD->x->nY != ORDER_Y) { 122 122 psError(PS_ERR_UNKNOWN,true,"myPD->x->nY is %d, should be %d", 123 myPD->x->nY, NY_TERMS-1);123 myPD->x->nY, ORDER_Y); 124 124 return 4; 125 125 } 126 if ( (1 + myPD->y->nY) != NY_TERMS) {126 if (myPD->y->nY != ORDER_Y) { 127 127 psError(PS_ERR_UNKNOWN,true,"myPD->y->nY is %d, should be %d", 128 myPD->y->nY, NY_TERMS-1);128 myPD->y->nY, ORDER_Y); 129 129 return 5; 130 130 } 131 if ( (1 + myPD->x->nZ) != NZ_TERMS) {131 if (myPD->x->nZ != ORDER_Z) { 132 132 psError(PS_ERR_UNKNOWN,true,"myPD->x->nZ is %d, should be %d", 133 myPD->x->n X, NZ_TERMS-1);133 myPD->x->nZ, ORDER_Z); 134 134 return 6; 135 135 } 136 if ( (1 + myPD->y->nZ) != NZ_TERMS) {136 if (myPD->y->nZ != ORDER_Z) { 137 137 psError(PS_ERR_UNKNOWN,true,"myPD->y->nZ is %d, should be %d", 138 myPD->y->nZ, NZ_TERMS-1);138 myPD->y->nZ, ORDER_Z); 139 139 return 7; 140 140 } 141 if ( (1 + myPD->x->nT) != NT_TERMS) {141 if (myPD->x->nT != ORDER_T) { 142 142 psError(PS_ERR_UNKNOWN,true,"myPD->x->nT is %d, should be %d", 143 myPD->x->nT, NT_TERMS-1);143 myPD->x->nT, ORDER_T); 144 144 return 8; 145 145 } 146 if ( (1 + myPD->y->nT) != NT_TERMS) {146 if (myPD->y->nT != ORDER_T) { 147 147 psError(PS_ERR_UNKNOWN,true,"myPD->y->nT is %d, should be %d", 148 myPD->y->nT, NT_TERMS-1);148 myPD->y->nT, ORDER_T); 149 149 return 9; 150 150 } … … 152 152 psFree(myPD); 153 153 154 // Invoke function with negative x termparameter155 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative x term");156 myPD = psPlaneDistortAlloc(-1 .0, 1.0, 1.0, 1.0);154 // Invoke function with negative x order parameter 155 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative x order"); 156 myPD = psPlaneDistortAlloc(-1, 1, 1, 1); 157 157 if (myPD != NULL) { 158 158 psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL."); … … 160 160 } 161 161 162 // Invoke function with negative y termparameter163 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative y term");164 myPD = psPlaneDistortAlloc(1 .0, -1.0, 1.0, 1.0);162 // Invoke function with negative y order parameter 163 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative y order"); 164 myPD = psPlaneDistortAlloc(1, -1, 1, 1); 165 165 if (myPD != NULL) { 166 166 psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL."); … … 168 168 } 169 169 170 // Invoke function with negative z termparameter171 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative z term");172 myPD = psPlaneDistortAlloc(1 .0, 1.0, -1.0, 1.0);170 // Invoke function with negative z order parameter 171 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative z order"); 172 myPD = psPlaneDistortAlloc(1, 1, -1, 1); 173 173 if (myPD != NULL) { 174 174 psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL."); … … 176 176 } 177 177 178 // Invoke function with negative w termparameter179 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative w term");180 myPD = psPlaneDistortAlloc(1 .0, 1.0, 1.0, -1.0);178 // Invoke function with negative t order parameter 179 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative w order"); 180 myPD = psPlaneDistortAlloc(1, 1, 1, -1); 181 181 if (myPD != NULL) { 182 182 psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
Note:
See TracChangeset
for help on using the changeset viewer.
