Changeset 5515
- Timestamp:
- Nov 14, 2005, 6:03:36 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 2 edited
-
src/types/psLookupTable.c (modified) (7 diffs)
-
test/astro/tst_psEarthOrientation.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psLookupTable.c
r4898 r5515 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2005- 08-30 01:14:13$9 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-11-15 04:03:36 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 152 152 153 153 value = (psS32)strtol(inString, &end, 0); 154 if(*end != '\0' ) {154 if(*end != '\0' && !isspace(*end)) { 155 155 *status = PS_PARSE_ERROR_VALUE; 156 156 } else if(inString==end) { … … 169 169 170 170 value = (psS64)strtoll(inString, &end, 0); 171 if(*end != '\0' ) {171 if(*end != '\0' && !isspace(*end)) { 172 172 *status = PS_PARSE_ERROR_VALUE; 173 173 } else if(inString==end) { … … 186 186 187 187 value = (psF32)strtof(inString, &end); 188 if(*end != '\0' ) {188 if(*end != '\0' && !isspace(*end)) { 189 189 *status = PS_PARSE_ERROR_VALUE; 190 190 } else if(inString==end) { … … 203 203 204 204 value = (psF64)strtod(inString, &end); 205 if(*end != '\0' ) {205 if(*end != '\0' && !isspace(*end)) { 206 206 *status = PS_PARSE_ERROR_VALUE; 207 207 } else if(inString==end) { … … 444 444 // Parse the format string to determine how many vectors 445 445 // and whether the format string is valid 446 while((strValue=getToken((char**)&tempFormat," ",&parseStatus))) {446 while((strValue=getToken((char**)&tempFormat," ",&parseStatus))) { 447 447 448 448 // Check for %d format sub string … … 511 511 512 512 // Loop through format and line strings to get values in text table file 513 while((strValue=getToken((char**)&tempFormat," ",&parseStatus)) &&514 (strNum=getToken((char**)&linePtr," ",&parseStatus)) ) {513 while((strValue=getToken((char**)&tempFormat," ",&parseStatus)) && 514 (strNum=getToken((char**)&linePtr," ",&parseStatus)) ) { 515 515 516 516 // Set column vector -
trunk/psLib/test/astro/tst_psEarthOrientation.c
r5507 r5515 5 5 * @author d-Rob, MHPCC 6 6 * 7 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-11-1 2 03:37:34$7 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-11-15 04:03:36 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 15 15 16 16 //static psS32 testEOCParallax(void); 17 static psS32 testEOCInit_Final(void); 17 18 static psS32 testAberration(void); 18 19 static psS32 testGravityDeflect(void); … … 25 26 26 27 testDescription tests[] = { 28 {testEOCInit_Final, 665, "psEOCInit_Final", 0, false}, 27 29 {testAberration, 666, "psAberration()", 0, false}, 28 30 {testGravityDeflect, 667, "psGravityDeflect()", 0, false}, … … 56 58 } 57 59 60 psS32 testEOCInit_Final(void) 61 { 62 return 0; 63 } 64 58 65 psS32 testAberration(void) 59 66 { … … 145 152 time->leapsecond = false; 146 153 154 //Tests for Precession Model // 155 psEarthPole *pmodel = NULL; 156 //Return NULL for NULL time input 157 pmodel = psEOC_PrecessionModel(empty); 158 if (pmodel != NULL) { 159 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 160 "psEOC_PrecessionModel failed to return NULL for NULL time input.\n"); 161 return 1; 162 } 163 //Return NULL for UT1 time input 164 psTime *UT1time = psTimeAlloc(PS_TIME_UT1); 165 pmodel = psEOC_PrecessionModel(UT1time); 166 if (pmodel != NULL) { 167 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 168 "psEOC_PrecessionModel failed to return NULL for UT1 input time.\n"); 169 return 2; 170 } 171 psFree(UT1time); 172 //Check return values from valid precession input 173 pmodel = psEOC_PrecessionModel(time); 174 if ( pmodel == NULL ) { 175 psError(PS_ERR_BAD_PARAMETER_NULL, false, 176 "psEOC_PrecessionModel returned NULL for valid input.\n"); 177 return 3; 178 } else { 179 printf("Precession Model output = x,y,s = %.8g, %.8g, %.8g\n", 180 pmodel->x, pmodel->y, pmodel->s); 181 } 182 psFree(pmodel); 183 147 184 148 185 //Tests for Precession Correction function//
Note:
See TracChangeset
for help on using the changeset viewer.
