Changeset 8319 for trunk/ippdb/tests
- Timestamp:
- Aug 14, 2006, 11:56:03 AM (20 years ago)
- Location:
- trunk/ippdb/tests
- Files:
-
- 6 edited
-
alloc.c (modified) (4 diffs)
-
insert.c (modified) (2 diffs)
-
insertobject.c (modified) (2 diffs)
-
metadatafromobject.c (modified) (4 diffs)
-
objectfrommetadata.c (modified) (4 diffs)
-
pop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/tests/alloc.c
r8283 r8319 645 645 rawImfileRow *object; 646 646 647 object = rawImfileRowAlloc("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 );647 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 ); 648 648 649 649 if (!object) { … … 663 663 exit(EXIT_FAILURE); 664 664 } 665 if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) { 666 psFree(object); 667 exit(EXIT_FAILURE); 668 } 665 669 if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) { 666 670 psFree(object); … … 962 966 detProcessedImfileRow *object; 963 967 964 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string" );968 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64 ); 965 969 966 970 if (!object) { … … 985 989 } 986 990 if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) { 991 psFree(object); 992 exit(EXIT_FAILURE); 993 } 994 if (!object->bg == 64.64) { 995 psFree(object); 996 exit(EXIT_FAILURE); 997 } 998 if (!object->bg_stdev == 64.64) { 999 psFree(object); 1000 exit(EXIT_FAILURE); 1001 } 1002 if (!object->bg_mean_stdev == 64.64) { 987 1003 psFree(object); 988 1004 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r8283 r8319 238 238 } 239 239 240 if (!rawImfileInsert(dbh, "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)) {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)) { 241 241 exit(EXIT_FAILURE); 242 242 } … … 373 373 } 374 374 375 if (!detProcessedImfileInsert(dbh, -32, "a string", "a string", "a string", "a string" )) {375 if (!detProcessedImfileInsert(dbh, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64)) { 376 376 exit(EXIT_FAILURE); 377 377 } -
trunk/ippdb/tests/insertobject.c
r8283 r8319 344 344 } 345 345 346 object = rawImfileRowAlloc("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); 347 347 if (!object) { 348 348 exit(EXIT_FAILURE); … … 542 542 } 543 543 544 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string" );544 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64); 545 545 if (!object) { 546 546 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r8283 r8319 768 768 bool status; 769 769 770 object = rawImfileRowAlloc("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);770 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); 771 771 if (!object) { 772 772 exit(EXIT_FAILURE); … … 792 792 exit(EXIT_FAILURE); 793 793 } 794 if (strncmp(psMetadataLookupPtr(&status, md, "exp_type"), "a string", MAX_STRING_LENGTH)) { 795 psFree(md); 796 exit(EXIT_FAILURE); 797 } 794 798 if (strncmp(psMetadataLookupPtr(&status, md, "uri"), "a string", MAX_STRING_LENGTH)) { 795 799 psFree(md); … … 1157 1161 bool status; 1158 1162 1159 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string" );1163 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64); 1160 1164 if (!object) { 1161 1165 exit(EXIT_FAILURE); … … 1186 1190 } 1187 1191 if (strncmp(psMetadataLookupPtr(&status, md, "recipe"), "a string", MAX_STRING_LENGTH)) { 1192 psFree(md); 1193 exit(EXIT_FAILURE); 1194 } 1195 if (!psMetadataLookupF64(&status, md, "bg") == 64.64) { 1196 psFree(md); 1197 exit(EXIT_FAILURE); 1198 } 1199 if (!psMetadataLookupF64(&status, md, "bg_stdev") == 64.64) { 1200 psFree(md); 1201 exit(EXIT_FAILURE); 1202 } 1203 if (!psMetadataLookupF64(&status, md, "bg_mean_stdev") == 64.64) { 1188 1204 psFree(md); 1189 1205 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r8283 r8319 1175 1175 exit(EXIT_FAILURE); 1176 1176 } 1177 if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) { 1178 psFree(md); 1179 exit(EXIT_FAILURE); 1180 } 1177 1181 if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) { 1178 1182 psFree(md); … … 1248 1252 exit(EXIT_FAILURE); 1249 1253 } 1254 if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) { 1255 psFree(object); 1256 exit(EXIT_FAILURE); 1257 } 1250 1258 if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) { 1251 1259 psFree(object); … … 1745 1753 exit(EXIT_FAILURE); 1746 1754 } 1755 if (!psMetadataAddF64(md, PS_LIST_TAIL, "bg", 0, NULL, 64.64)) { 1756 psFree(md); 1757 exit(EXIT_FAILURE); 1758 } 1759 if (!psMetadataAddF64(md, PS_LIST_TAIL, "bg_stdev", 0, NULL, 64.64)) { 1760 psFree(md); 1761 exit(EXIT_FAILURE); 1762 } 1763 if (!psMetadataAddF64(md, PS_LIST_TAIL, "bg_mean_stdev", 0, NULL, 64.64)) { 1764 psFree(md); 1765 exit(EXIT_FAILURE); 1766 } 1747 1767 1748 1768 object = detProcessedImfileObjectFromMetadata(md); … … 1771 1791 } 1772 1792 if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) { 1793 psFree(object); 1794 exit(EXIT_FAILURE); 1795 } 1796 if (!object->bg == 64.64) { 1797 psFree(object); 1798 exit(EXIT_FAILURE); 1799 } 1800 if (!object->bg_stdev == 64.64) { 1801 psFree(object); 1802 exit(EXIT_FAILURE); 1803 } 1804 if (!object->bg_mean_stdev == 64.64) { 1773 1805 psFree(object); 1774 1806 exit(EXIT_FAILURE); -
trunk/ippdb/tests/pop.c
r8283 r8319 345 345 char class[256]; 346 346 char class_id[256]; 347 char exp_type[256]; 347 348 char uri[256]; 348 349 char filter[256]; … … 364 365 } 365 366 366 if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)& uri, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {367 if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)&exp_type, (char **)&uri, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) { 367 368 exit(EXIT_FAILURE); 368 369 } … … 532 533 char uri[256]; 533 534 char recipe[256]; 534 535 dbh = psDBInit("localhost", "test", NULL, "test"); 536 if (!dbh) { 537 exit(EXIT_FAILURE); 538 } 539 540 if (!detProcessedImfilePop(dbh, &det_id, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)&recipe)) { 535 psF64 bg; 536 psF64 bg_stdev; 537 psF64 bg_mean_stdev; 538 539 dbh = psDBInit("localhost", "test", NULL, "test"); 540 if (!dbh) { 541 exit(EXIT_FAILURE); 542 } 543 544 if (!detProcessedImfilePop(dbh, &det_id, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev)) { 541 545 exit(EXIT_FAILURE); 542 546 }
Note:
See TracChangeset
for help on using the changeset viewer.
