Changeset 6189 for trunk/psLib/test/astro/tst_psEarthOrientation.c
- Timestamp:
- Jan 24, 2006, 5:02:47 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/astro/tst_psEarthOrientation.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astro/tst_psEarthOrientation.c
r6184 r6189 5 5 * @author d-Rob, MHPCC 6 6 * 7 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-01-2 3 20:04:31$7 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-01-25 03:02:47 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 305 305 psEarthPole *pmodel = NULL; 306 306 //Return NULL for NULL time input 307 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 307 308 pmodel = psEOC_PrecessionModel(empty); 308 309 if (pmodel != NULL) { … … 312 313 } 313 314 //Return NULL for UT1 time input 315 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 314 316 psTime *UT1time = psTimeAlloc(PS_TIME_UT1); 315 317 pmodel = psEOC_PrecessionModel(UT1time); … … 361 363 time2->nsec = 0; 362 364 time2->leapsecond = false; 363 364 //XXX: MAY Be an Error here... Time for Precession Correction has to be TAI or seg faults 365 time2 = psTimeConvert(time2, PS_TIME_TAI); 365 // time2 = psTimeConvert(time2, PS_TIME_TAI); 366 366 367 //Tests for Precession Correction function// 367 368 //Return NULL for NULL time input 368 369 psEarthPole *pcorr = NULL; 370 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 369 371 pcorr = psEOC_PrecessionCorr(empty, PS_IERS_A); 370 372 if (pcorr != NULL) { … … 375 377 376 378 //Return NULL for Invalid IERS table 379 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 377 380 pcorr = psEOC_PrecessionCorr(time2, 3); 378 381 if (pcorr != NULL) { … … 522 525 523 526 //Return NULL for NULL input time 527 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 524 528 polarMotion = psEOC_GetPolarMotion(empty, PS_IERS_B); 525 529 if (polarMotion != NULL) { … … 529 533 } 530 534 //Return NULL for incorrect Bulletin. 535 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 531 536 polarMotion = psEOC_GetPolarMotion(empty, 3); 532 537 if (polarMotion != NULL) { … … 625 630 psEarthPole *eop = NULL; 626 631 632 //Return NULL for NULL input time 633 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 627 634 eop = psEOC_PolarTideCorr(empty); 628 635 if (eop != NULL) { … … 658 665 659 666 //Return NULL for NULL input time. 667 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 660 668 nute = psEOC_NutationCorr(empty); 661 669 if (nute != NULL) { … … 705 713 706 714 //return NULL for NULL input time 715 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 707 716 rot = psSphereRot_TEOtoCEO(empty, NULL); 708 717 if (rot != NULL) { … … 783 792 q3 = -0.9999999897238481; 784 793 794 //Return NULL for NULL input earthpole 795 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 785 796 rot = psSphereRot_CEOtoGCRS(empty); 786 797 if (rot != NULL) { … … 793 804 if (rot == NULL) { 794 805 psError(PS_ERR_BAD_PARAMETER_NULL, false, 795 "psSphereRot_CEOtoGCRS return NULL for valid psEarthPole input.\n");806 "psSphereRot_CEOtoGCRS returned NULL for valid psEarthPole input.\n"); 796 807 return 2; 797 808 } … … 857 868 in->s = SEC_TO_RAD(in->s); 858 869 870 //Return NULL for NULL input earthpole 871 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 859 872 rot = psSphereRot_ITRStoTEO(empty); 860 873 if (rot != NULL) { … … 863 876 return 1; 864 877 } 878 865 879 rot = psSphereRot_ITRStoTEO(in); 866 880 if (rot == NULL) { … … 1050 1064 psFree(rot); 1051 1065 1052 // Invoke precess with invalid parameter 1053 /* 1054 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message"); 1055 outputCoord = psSpherePrecess(inputCoord, fromTime, NULL); 1056 if(outputCoord != NULL) { 1057 psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input"); 1058 return 10; 1059 } 1060 1061 // Invoke precess with invalid parameter 1062 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message"); 1063 outputCoord = psSpherePrecess(inputCoord, NULL, toTime); 1064 if(outputCoord != NULL) { 1065 psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input"); 1066 return 11; 1067 } 1068 */ 1066 //Test other modes (IAU2000A, COMPLETE_[A,B]) 1067 // Set input coordinate 1068 inputCoord->r = SPHERE_PRECESS_TP1_R; 1069 inputCoord->d = SPHERE_PRECESS_TP1_D; 1070 inputCoord->rErr = 0.0; 1071 inputCoord->dErr = 0.0; 1072 // Calculate precess 1073 rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_COMPLETE_A); 1074 outputCoord = psSphereRotApply(NULL, rot, inputCoord); 1075 if (outputCoord->r < -0.000001) { 1076 outputCoord->r += 2.0 * M_PI; 1077 } 1078 // Verify return is not NULL 1079 if(outputCoord == NULL) { 1080 psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected"); 1081 return 10; 1082 } 1083 psFree(outputCoord); 1084 psFree(rot); 1085 1086 rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_COMPLETE_B); 1087 outputCoord = psSphereRotApply(NULL, rot, inputCoord); 1088 if (outputCoord->r < -0.000001) { 1089 outputCoord->r += 2.0 * M_PI; 1090 } 1091 // Verify return is not NULL 1092 if(outputCoord == NULL) { 1093 psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected"); 1094 return 11; 1095 } 1096 psFree(outputCoord); 1097 psFree(rot); 1098 1099 rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_IAU2000A); 1100 outputCoord = psSphereRotApply(NULL, rot, inputCoord); 1101 if (outputCoord->r < -0.000001) { 1102 outputCoord->r += 2.0 * M_PI; 1103 } 1104 // Verify return is not NULL 1105 if(outputCoord == NULL) { 1106 psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected"); 1107 return 12; 1108 } 1109 psFree(outputCoord); 1110 psFree(rot); 1111 1069 1112 // Invoke precess with invalid parameter 1070 1113 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message"); 1071 1114 rot = psSpherePrecess(fromTime, toTime, 10); 1072 // outputCoord = psSpherePrecess(NULL, fromTime, toTime, PS_PRECESS_ROUGH);1073 1115 if(rot != NULL) { 1074 // if(outputCoord != NULL) {1075 1116 psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input"); 1117 return 14; 1118 } 1119 // Return NULL for NULL input times 1120 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message"); 1121 rot = psSpherePrecess(NULL, NULL, PS_PRECESS_ROUGH); 1122 if(rot != NULL) { 1123 psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input"); 1124 return 15; 1125 } 1126 1127 if (!p_psEOCFinalize() ) { 1128 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "EOC failed finalization!\n"); 1076 1129 return 12; 1077 1130 } 1078 psFree(rot);1079 1080 1131 // Free objects 1081 1132 psFree(fromTime);
Note:
See TracChangeset
for help on using the changeset viewer.
