Changeset 13614 for trunk/psLib/test/astro/tap_psTime_02.c
- Timestamp:
- Jun 4, 2007, 10:25:32 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/astro/tap_psTime_02.c (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astro/tap_psTime_02.c
r12607 r13614 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2007-0 3-27 22:52:02 $14 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2007-06-04 20:25:32 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 64 64 { 65 65 psMemId id = psMemGetId(); 66 67 66 psF64 lmst = psTimeToLMST(NULL, 0); 68 is_double(lmst, NAN, "psTimeToLMST(time,0) returned NAN"); 69 67 is_double(lmst, NAN, "psTimeToLMST(NULL, 0) returned NAN"); 70 68 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 71 69 } … … 80 78 time->nsec = testTime1NanosecondsUTC; 81 79 time->leapsecond = false; 82 83 80 psF64 lmst = psTimeToLMST(time, 0.0); 84 81 is_double_tol(lmst, testTime1LMST0, ERROR_TOL, "psTimeToLMST() returned the correct time"); 85 86 82 psFree(time); 87 83 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 90 86 91 87 // psTimeToLMST() 92 // Attempt to get LMST with invalid input time UT188 // Attempt to get LMST with unallowed input time UT1 93 89 // Following should generate error message for incorrect type 94 90 // XXX: We do not test the error generation … … 100 96 time->leapsecond = false; 101 97 time->type = PS_TIME_UT1; 102 103 98 psF64 lmst = psTimeToLMST(time,0.0); 104 99 is_double(lmst, NAN, "psTimeToLMST() generated a NAN for incorrect type"); 105 106 100 psFree(time); 107 101 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 115 109 { 116 110 psMemId id = psMemGetId(); 117 118 111 psS64 delta = psTimeLeapSecondDelta(NULL, NULL); 119 112 is_long(delta, 0, "psTimeLeapSecondDelta(NULL, NULL) returned 0"); 120 121 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");122 } 123 124 113 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 114 } 115 116 117 // psTimeLeapSecondDelta() 125 118 // Set test time 1 126 119 // Attempt to get delta with NULL time2 argument … … 133 126 time1->nsec = testTime1NanosecondsUTC; 134 127 time1->leapsecond = false; 135 136 128 psS64 delta = psTimeLeapSecondDelta(time1, NULL); 137 129 is_long(delta, 0, "psTimeLeapSecondDelta(time1, NULL) returned 0"); 138 139 psFree(time1);140 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");141 } 142 143 144 // Set test time 2 with invalid time145 // Attempt to get delta with invalid time2146 // Following should generate an error message for invalid time130 psFree(time1); 131 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 132 } 133 134 135 // psTimeLeapSecondDelta() 136 // Set test time 2 with unallowed time 137 // Attempt to get delta with unallowed time2 138 // Following should generate an error message for unallowed time 147 139 // XXX: We do not test the error generation 148 140 { … … 156 148 time2->nsec = 2e9; 157 149 time2->leapsecond = false; 158 159 150 psS64 delta = psTimeLeapSecondDelta(time1, time2); 160 151 is_long(delta, 0, "psTimeLeapSecondDelta(time1, time2) returned 0 with incorrect time2"); 161 162 152 psFree(time1); 163 153 psFree(time2); … … 166 156 167 157 158 // psTimeLeapSecondDelta() 168 159 // Set test time 2 valid 169 // Attempt to get delta with invalid time1170 // Following should generate an error message for invalid time160 // Attempt to get delta with unallowed time1 161 // Following should generate an error message for unallowed time 171 162 // XXX: We do not test the error generation 172 163 { … … 181 172 time1->sec = 0; 182 173 time1->nsec = 2e9; 183 184 174 psS64 delta = psTimeLeapSecondDelta(time1,time2); 185 175 is_long(delta, 0, "psTimeLeapSecondDelta(time1, time2) returned 0 with incorrect time1"); 186 187 176 psFree(time1); 188 177 psFree(time2); … … 191 180 192 181 182 // psTimeLeapSecondDelta() 193 183 // Set test time 1 to greater time 194 184 { … … 202 192 time2->sec = testTime2SecondsUTC; 203 193 time2->nsec = testTime2NanosecondsUTC; 204 205 194 psS64 delta = psTimeLeapSecondDelta(time1,time2); 206 195 is_long(delta, testTimeLeapSecondDelta1, "psTimeLeapSecondDelta() produced the correct result"); 207 208 196 psFree(time1); 209 197 psFree(time2); … … 212 200 213 201 202 // psTimeLeapSecondDelta() 214 203 // Set test time 1 to lesser time 215 204 { … … 222 211 time2->sec = testTime2SecondsUTC; 223 212 time2->nsec = testTime2NanosecondsUTC; 224 225 213 psS64 delta = psTimeLeapSecondDelta(time2, time1); 226 214 is_long(delta, testTimeLeapSecondDelta1, "psTimeLeapSecondDelta() produced the correct result"); 227 228 215 psFree(time1); 229 216 psFree(time2); … … 232 219 233 220 221 // psTimeLeapSecondDelta() 234 222 // Attempt to get delta with times equal 235 223 { … … 239 227 time1->nsec = testTime1NanosecondsUTC; 240 228 time1->leapsecond = false; 241 242 229 psS64 delta = psTimeLeapSecondDelta(time1,time1); 243 230 is_long(delta, 0, "psTimeLeapSecondDelta() produced the correct result"); 244 245 231 psFree(time1); 246 232 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 254 240 { 255 241 psMemId id = psMemGetId(); 256 257 242 bool leapsecond = psTimeIsLeapSecond(NULL); 258 243 is_bool(leapsecond, false, "psTimeIsLeapSecond(NULL) returned correct value"); 259 260 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 261 } 262 263 264 // psTimeIsLeapSecond() 265 // Set time 244 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 245 } 246 247 248 // psTimeIsLeapSecond() 266 249 // Attempt to determine if leap second with non-UTC time 267 // Following should generate an error message for invalid type250 // Following should generate an error message for unallowed type 268 251 // XXX: We do not test the error generation 269 252 { … … 273 256 time->nsec = testTime1NanosecondsUTC; 274 257 time->leapsecond = false; 275 276 258 bool leapsecond = psTimeIsLeapSecond(time); 277 259 is_bool(leapsecond, false, "psTimeIsLeapSecond() returned false with incorrect type"); 278 279 260 psFree(time); 280 261 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 292 273 time->leapsecond = false; 293 274 time->type = PS_TIME_UTC; 294 295 275 bool leapsecond = psTimeIsLeapSecond(time); 296 276 is_bool(leapsecond, false, "psTimeIsLeapSecond() returned false"); 297 298 277 psFree(time); 299 278 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 309 288 time->sec = testTime3SecondsUTC; 310 289 time->nsec = testTime3NanosecondsUTC; 311 312 290 bool leapsecond = psTimeIsLeapSecond(time); 313 291 is_bool(leapsecond, true, "psTimeIsLeapSecond() returned true"); 314 315 292 psFree(time); 316 293 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 327 304 time->nsec = testTime3NanosecondsUTC; 328 305 time->sec--; 329 330 306 bool leapsecond = psTimeIsLeapSecond(time); 331 307 is_bool(leapsecond, false, "psTimeIsLeapSecond() returned false"); 332 333 308 psFree(time); 334 309 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 343 318 time->sec = testTime3SecondsUTC; 344 319 time->nsec = testTime3NanosecondsUTC; 345 time->sec ++; 346 320 time->sec++; 347 321 bool leapsecond = psTimeIsLeapSecond(time); 348 322 is_bool(leapsecond, false, "psTimeIsLeapSecond() returned false"); 349 350 323 psFree(time); 351 324 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 354 327 355 328 // psTimeFromTT() 356 // Attempt to create psTime with invalid time357 // Following should generate an error message for invalid time329 // Attempt to create psTime with unallowed time 330 // Following should generate an error message for unallowed time 358 331 // XXX: We do not test the error generation 359 332 { … … 389 362 390 363 // psTimeFromUTC() 391 // Attempt to create psTime with invalid time392 // Following should generate an error message for invalid time364 // Attempt to create psTime with unallowed time 365 // Following should generate an error message for unallowed time 393 366 // XXX: We do not test the error generation 394 367 {
Note:
See TracChangeset
for help on using the changeset viewer.
