Changeset 9187 for trunk/ippdb/tests
- Timestamp:
- Oct 3, 2006, 6:32:18 PM (20 years ago)
- Location:
- trunk/ippdb/tests
- Files:
-
- 6 edited
-
alloc.c (modified) (6 diffs)
-
insert.c (modified) (1 diff)
-
insertobject.c (modified) (3 diffs)
-
metadatafromobject.c (modified) (6 diffs)
-
objectfrommetadata.c (modified) (6 diffs)
-
pop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/tests/alloc.c
r9173 r9187 496 496 rawDetrendExpRow *object; 497 497 498 object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 );498 object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string" ); 499 499 500 500 if (!object) { … … 570 570 exit(EXIT_FAILURE); 571 571 } 572 if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) { 573 psFree(object); 574 exit(EXIT_FAILURE); 575 } 572 576 573 577 psFree(object); … … 577 581 rawScienceExpRow *object; 578 582 579 object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 );583 object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string" ); 580 584 581 585 if (!object) { … … 651 655 exit(EXIT_FAILURE); 652 656 } 657 if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) { 658 psFree(object); 659 exit(EXIT_FAILURE); 660 } 653 661 654 662 psFree(object); … … 658 666 rawImfileRow *object; 659 667 660 object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 );668 object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string" ); 661 669 662 670 if (!object) { … … 729 737 } 730 738 if (!object->posang == 64.64) { 739 psFree(object); 740 exit(EXIT_FAILURE); 741 } 742 if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) { 731 743 psFree(object); 732 744 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r9173 r9187 208 208 } 209 209 210 if (!rawDetrendExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 )) {211 exit(EXIT_FAILURE); 212 } 213 214 psDBCleanup(dbh); 215 } 216 217 { 218 psDB *dbh; 219 220 dbh = psDBInit("localhost", "test", NULL, "test"); 221 if (!dbh) { 222 exit(EXIT_FAILURE); 223 } 224 225 if (!rawScienceExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 )) {226 exit(EXIT_FAILURE); 227 } 228 229 psDBCleanup(dbh); 230 } 231 232 { 233 psDB *dbh; 234 235 dbh = psDBInit("localhost", "test", NULL, "test"); 236 if (!dbh) { 237 exit(EXIT_FAILURE); 238 } 239 240 if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 )) {210 if (!rawDetrendExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string")) { 211 exit(EXIT_FAILURE); 212 } 213 214 psDBCleanup(dbh); 215 } 216 217 { 218 psDB *dbh; 219 220 dbh = psDBInit("localhost", "test", NULL, "test"); 221 if (!dbh) { 222 exit(EXIT_FAILURE); 223 } 224 225 if (!rawScienceExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string")) { 226 exit(EXIT_FAILURE); 227 } 228 229 psDBCleanup(dbh); 230 } 231 232 { 233 psDB *dbh; 234 235 dbh = psDBInit("localhost", "test", NULL, "test"); 236 if (!dbh) { 237 exit(EXIT_FAILURE); 238 } 239 240 if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string")) { 241 241 exit(EXIT_FAILURE); 242 242 } -
trunk/ippdb/tests/insertobject.c
r9173 r9187 300 300 } 301 301 302 object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 );302 object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"); 303 303 if (!object) { 304 304 exit(EXIT_FAILURE); … … 322 322 } 323 323 324 object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 );324 object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"); 325 325 if (!object) { 326 326 exit(EXIT_FAILURE); … … 344 344 } 345 345 346 object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 );346 object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"); 347 347 if (!object) { 348 348 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r9173 r9187 602 602 bool status; 603 603 604 object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 );604 object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"); 605 605 if (!object) { 606 606 exit(EXIT_FAILURE); … … 682 682 exit(EXIT_FAILURE); 683 683 } 684 if (strncmp(psMetadataLookupPtr(&status, md, "obstype"), "a string", MAX_STRING_LENGTH)) { 685 psFree(md); 686 exit(EXIT_FAILURE); 687 } 684 688 685 689 psFree(md); … … 691 695 bool status; 692 696 693 object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 );697 object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"); 694 698 if (!object) { 695 699 exit(EXIT_FAILURE); … … 771 775 exit(EXIT_FAILURE); 772 776 } 777 if (strncmp(psMetadataLookupPtr(&status, md, "obstype"), "a string", MAX_STRING_LENGTH)) { 778 psFree(md); 779 exit(EXIT_FAILURE); 780 } 773 781 774 782 psFree(md); … … 780 788 bool status; 781 789 782 object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64 );790 object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"); 783 791 if (!object) { 784 792 exit(EXIT_FAILURE); … … 857 865 } 858 866 if (!psMetadataLookupF64(&status, md, "posang") == 64.64) { 867 psFree(md); 868 exit(EXIT_FAILURE); 869 } 870 if (strncmp(psMetadataLookupPtr(&status, md, "obstype"), "a string", MAX_STRING_LENGTH)) { 859 871 psFree(md); 860 872 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r9173 r9187 947 947 exit(EXIT_FAILURE); 948 948 } 949 if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "a string")) { 950 psFree(md); 951 exit(EXIT_FAILURE); 952 } 949 953 950 954 object = rawDetrendExpObjectFromMetadata(md); … … 1024 1028 exit(EXIT_FAILURE); 1025 1029 } 1030 if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) { 1031 psFree(object); 1032 exit(EXIT_FAILURE); 1033 } 1026 1034 1027 1035 psFree(object); … … 1101 1109 exit(EXIT_FAILURE); 1102 1110 } 1111 if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "a string")) { 1112 psFree(md); 1113 exit(EXIT_FAILURE); 1114 } 1103 1115 1104 1116 object = rawScienceExpObjectFromMetadata(md); … … 1178 1190 exit(EXIT_FAILURE); 1179 1191 } 1192 if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) { 1193 psFree(object); 1194 exit(EXIT_FAILURE); 1195 } 1180 1196 1181 1197 psFree(object); … … 1255 1271 exit(EXIT_FAILURE); 1256 1272 } 1273 if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "a string")) { 1274 psFree(md); 1275 exit(EXIT_FAILURE); 1276 } 1257 1277 1258 1278 object = rawImfileObjectFromMetadata(md); … … 1329 1349 } 1330 1350 if (!object->posang == 64.64) { 1351 psFree(object); 1352 exit(EXIT_FAILURE); 1353 } 1354 if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) { 1331 1355 psFree(object); 1332 1356 exit(EXIT_FAILURE); -
trunk/ippdb/tests/pop.c
r9173 r9187 298 298 psF32 ccd_temp; 299 299 psF64 posang; 300 301 dbh = psDBInit("localhost", "test", NULL, "test"); 302 if (!dbh) { 303 exit(EXIT_FAILURE); 304 } 305 306 if (!rawDetrendExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) { 300 char obstype[256]; 301 302 dbh = psDBInit("localhost", "test", NULL, "test"); 303 if (!dbh) { 304 exit(EXIT_FAILURE); 305 } 306 307 if (!rawDetrendExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) { 307 308 exit(EXIT_FAILURE); 308 309 } … … 330 331 psF32 ccd_temp; 331 332 psF64 posang; 332 333 dbh = psDBInit("localhost", "test", NULL, "test"); 334 if (!dbh) { 335 exit(EXIT_FAILURE); 336 } 337 338 if (!rawScienceExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) { 333 char obstype[256]; 334 335 dbh = psDBInit("localhost", "test", NULL, "test"); 336 if (!dbh) { 337 exit(EXIT_FAILURE); 338 } 339 340 if (!rawScienceExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) { 339 341 exit(EXIT_FAILURE); 340 342 } … … 362 364 psF32 ccd_temp; 363 365 psF64 posang; 364 365 dbh = psDBInit("localhost", "test", NULL, "test"); 366 if (!dbh) { 367 exit(EXIT_FAILURE); 368 } 369 370 if (!rawImfilePop(dbh, (char **)&exp_tag, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&exp_type, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) { 366 char obstype[256]; 367 368 dbh = psDBInit("localhost", "test", NULL, "test"); 369 if (!dbh) { 370 exit(EXIT_FAILURE); 371 } 372 373 if (!rawImfilePop(dbh, (char **)&exp_tag, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&exp_type, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) { 371 374 exit(EXIT_FAILURE); 372 375 }
Note:
See TracChangeset
for help on using the changeset viewer.
