Changeset 3705
- Timestamp:
- Apr 18, 2005, 1:30:54 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 8 edited
-
src/astro/psTime.c (modified) (3 diffs)
-
src/astro/psTime.h (modified) (3 diffs)
-
src/astronomy/psTime.c (modified) (3 diffs)
-
src/astronomy/psTime.h (modified) (3 diffs)
-
test/astronomy/tst_psTime_01.c (modified) (4 diffs)
-
test/astronomy/tst_psTime_02.c (modified) (2 diffs)
-
test/astronomy/tst_psTime_03.c (modified) (3 diffs)
-
test/astronomy/verified/tst_psTime_02.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psTime.c
r3704 r3705 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.5 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-04-18 23: 13:37$12 * @version $Revision: 1.56 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-04-18 23:30:54 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 812 812 } 813 813 814 char* psTimeToISO Time(const psTime *time)814 char* psTimeToISO(const psTime *time) 815 815 { 816 816 psS32 ms = 0; … … 979 979 } 980 980 981 psTime* psTimeFromISO Time(const char *time)981 psTime* psTimeFromISO(const char *time) 982 982 { 983 983 psS32 millisecond; -
trunk/psLib/src/astro/psTime.h
r3704 r3705 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-04-18 23: 13:37$12 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-04-18 23:30:54 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 186 186 * @return char*: Pointer null terminated array of chars in ISO time. 187 187 */ 188 char* psTimeToISO Time(188 char* psTimeToISO( 189 189 const psTime* time ///< Input time to be converted. 190 190 ); … … 237 237 * @return psTime*: time 238 238 */ 239 psTime* psTimeFromISO Time(239 psTime* psTimeFromISO( 240 240 const char* time ///< Input time to be converted. 241 241 ); -
trunk/psLib/src/astronomy/psTime.c
r3704 r3705 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.5 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-04-18 23: 13:37$12 * @version $Revision: 1.56 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-04-18 23:30:54 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 812 812 } 813 813 814 char* psTimeToISO Time(const psTime *time)814 char* psTimeToISO(const psTime *time) 815 815 { 816 816 psS32 ms = 0; … … 979 979 } 980 980 981 psTime* psTimeFromISO Time(const char *time)981 psTime* psTimeFromISO(const char *time) 982 982 { 983 983 psS32 millisecond; -
trunk/psLib/src/astronomy/psTime.h
r3704 r3705 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-04-18 23: 13:37$12 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-04-18 23:30:54 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 186 186 * @return char*: Pointer null terminated array of chars in ISO time. 187 187 */ 188 char* psTimeToISO Time(188 char* psTimeToISO( 189 189 const psTime* time ///< Input time to be converted. 190 190 ); … … 237 237 * @return psTime*: time 238 238 */ 239 psTime* psTimeFromISO Time(239 psTime* psTimeFromISO( 240 240 const char* time ///< Input time to be converted. 241 241 ); -
trunk/psLib/test/astronomy/tst_psTime_01.c
r3682 r3705 23 23 * @author Ross Harman, MHPCC 24 24 * 25 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $26 * @date $Date: 2005-04- 07 20:27:41$25 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 26 * @date $Date: 2005-04-18 23:30:54 $ 27 27 * 28 28 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 66 66 printPositiveTestHeader(stdout,"psTime", "Convert psTime to ISO time"); 67 67 char *isoString; 68 isoString = psTimeToISO Time(testTime);68 isoString = psTimeToISO(testTime); 69 69 printf("%s\n", isoString); 70 70 if(strncmp(isoString, testString, 256)) { … … 78 78 printPositiveTestHeader(stdout,"psTime", "Convert ISO time to psTime"); 79 79 psTime *timeD = NULL; 80 timeD = psTimeFromISO Time(isoString);80 timeD = psTimeFromISO(isoString); 81 81 printf("psTime: Seconds = %lld Microseconds = %u\n", 82 82 (long long int)timeD->sec, … … 206 206 char *testString2 = "2004-09-10T1:00:00.00Z"; 207 207 psTime* testTime2 = NULL; 208 testTime2 = psTimeFromISO Time(testString2);208 testTime2 = psTimeFromISO(testString2); 209 209 double dblTime = psTimeToLST(testTime2, 1); 210 210 printf("LST (rad): %lf\n", dblTime); -
trunk/psLib/test/astronomy/tst_psTime_02.c
r3682 r3705 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-04- 07 20:27:41$12 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-04-18 23:30:54 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 25 25 // Test A - Incorrect ISO time data 26 26 printNegativeTestHeader(stdout,"psTime", "Incorrect ISO time data", "Time not allowed", 0); 27 psTimeFromISO Time("2004-99-21T18:22:24.272Z");28 psTimeFromISO Time("2004-07-99T18:22:24.272Z");29 psTimeFromISO Time("2004-07-21T99:22:24.272Z");30 psTimeFromISO Time("2004-07-21T18:99:24.272Z");31 psTimeFromISO Time("2004-07-21T18:22:99.272Z");32 psTimeFromISO Time("2004-07-21T18:22:24.-999Z");27 psTimeFromISO("2004-99-21T18:22:24.272Z"); 28 psTimeFromISO("2004-07-99T18:22:24.272Z"); 29 psTimeFromISO("2004-07-21T99:22:24.272Z"); 30 psTimeFromISO("2004-07-21T18:99:24.272Z"); 31 psTimeFromISO("2004-07-21T18:22:99.272Z"); 32 psTimeFromISO("2004-07-21T18:22:24.-999Z"); 33 33 printFooter(stdout, "psTime", "Incorrect ISO time data", true); 34 34 -
trunk/psLib/test/astronomy/tst_psTime_03.c
r3704 r3705 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $22 * @date $Date: 2005-04-18 23: 13:39$21 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2005-04-18 23:30:54 $ 23 23 * 24 24 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 155 155 psTime *time7a = NULL; 156 156 psTime *timeOut7 = NULL; 157 time7a = psTimeFromISO Time("1998-12-31T23:59:45.00");157 time7a = psTimeFromISO("1998-12-31T23:59:45.00"); 158 158 time7a->type = PS_TIME_UTC; 159 159 timeOut7 = psTimeMath(time7a, time7b); 160 out7 = psTimeToISO Time(timeOut7);160 out7 = psTimeToISO(timeOut7); 161 161 printf("%s\n", out7); 162 162 printFooter(stdout, "psTime", "Test G - Add two times across leapsecond boundary", true); … … 168 168 psTime *time8a = NULL; 169 169 psTime *time8b = NULL; 170 time8a = psTimeFromISO Time("2004-12-18T1:00:00.00");171 time8b = psTimeFromISO Time("1972-1-1T1:00:00.00");170 time8a = psTimeFromISO("2004-12-18T1:00:00.00"); 171 time8b = psTimeFromISO("1972-1-1T1:00:00.00"); 172 172 out = psTimeLeapSecondDelta(time8a, time8b); 173 173 printf("%lld\n", (long long int)out); -
trunk/psLib/test/astronomy/verified/tst_psTime_02.stderr
r3127 r3705 1 <DATE><TIME>|<HOST>|E|psTimeFromISO Time(FILE:LINENO)1 <DATE><TIME>|<HOST>|E|psTimeFromISO (FILE:LINENO) 2 2 Error: tmTime.tm_mon, 99, is out of range. Must be between 1 and 12. 3 <DATE><TIME>|<HOST>|E|psTimeFromISO Time(FILE:LINENO)3 <DATE><TIME>|<HOST>|E|psTimeFromISO (FILE:LINENO) 4 4 Error: tmTime.tm_mday, 99, is out of range. Must be between 1 and 31. 5 <DATE><TIME>|<HOST>|E|psTimeFromISO Time(FILE:LINENO)5 <DATE><TIME>|<HOST>|E|psTimeFromISO (FILE:LINENO) 6 6 Error: tmTime.tm_hour, 99, is out of range. Must be between 0 and 23. 7 <DATE><TIME>|<HOST>|E|psTimeFromISO Time(FILE:LINENO)7 <DATE><TIME>|<HOST>|E|psTimeFromISO (FILE:LINENO) 8 8 Error: tmTime.tm_min, 99, is out of range. Must be between 0 and 59. 9 <DATE><TIME>|<HOST>|E|psTimeFromISO Time(FILE:LINENO)9 <DATE><TIME>|<HOST>|E|psTimeFromISO (FILE:LINENO) 10 10 Error: tmTime.tm_sec, 99, is out of range. Must be between 0 and 59. 11 <DATE><TIME>|<HOST>|E|psTimeFromISO Time(FILE:LINENO)11 <DATE><TIME>|<HOST>|E|psTimeFromISO (FILE:LINENO) 12 12 Error: millisecond, -999, is out of range. Must be between 0 and 999. 13 13 <DATE><TIME>|<HOST>|E|psTimeFromTimeval (FILE:LINENO)
Note:
See TracChangeset
for help on using the changeset viewer.
