Changeset 11113
- Timestamp:
- Jan 16, 2007, 12:21:17 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
dbconfig/Makefile (modified) (1 diff)
-
dbconfig/config.md (modified) (1 diff)
-
ippdb/configure.ac (modified) (1 diff)
-
ippdb/src/ippdb.c (modified) (72 diffs)
-
ippdb/src/ippdb.h (modified) (27 diffs)
-
ippdb/tests/alloc.c (modified) (18 diffs)
-
ippdb/tests/insert.c (modified) (1 diff)
-
ippdb/tests/insertobject.c (modified) (9 diffs)
-
ippdb/tests/metadatafromobject.c (modified) (18 diffs)
-
ippdb/tests/objectfrommetadata.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dbconfig/Makefile
r9666 r11113 18 18 chmod +x ../ippdb/autogen.sh 19 19 20 foo: src 21 $(MAKE) -C ../ippdb install 22 20 23 build : ippdb ippdb.mdc 21 24 -
trunk/dbconfig/config.md
r11077 r11113 2 2 pkg_name STR ippdb 3 3 pkg_namespace STR ippdb 4 pkg_version STR 0.0.7 44 pkg_version STR 0.0.75 5 5 END -
trunk/ippdb/configure.ac
r11077 r11113 7 7 AC_PREREQ(2.59) 8 8 9 AC_INIT([ippdb], [0.0.7 4], [pan-starrs.ifa.hawaii.edu])9 AC_INIT([ippdb], [0.0.75], [pan-starrs.ifa.hawaii.edu]) 10 10 AC_CONFIG_SRCDIR([ippdb.pc.in]) 11 11 -
trunk/ippdb/src/ippdb.c
r11077 r11113 9224 9224 static void detProcessedImfileRowFree(detProcessedImfileRow *object); 9225 9225 9226 detProcessedImfileRow *detProcessedImfileRowAlloc(psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri )9226 detProcessedImfileRow *detProcessedImfileRowAlloc(psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault) 9227 9227 { 9228 9228 detProcessedImfileRow *_object; … … 9241 9241 _object->b1_uri = psStringCopy(b1_uri); 9242 9242 _object->b2_uri = psStringCopy(b2_uri); 9243 _object->fault = fault; 9243 9244 9244 9245 return _object; … … 9308 9309 return false; 9309 9310 } 9311 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) { 9312 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 9313 psFree(md); 9314 return false; 9315 } 9310 9316 9311 9317 bool status = psDBCreateTable(dbh, DETPROCESSEDIMFILE_TABLE_NAME, md); … … 9321 9327 } 9322 9328 9323 bool detProcessedImfileInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri )9329 bool detProcessedImfileInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault) 9324 9330 { 9325 9331 psMetadata *md = psMetadataAlloc(); … … 9371 9377 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 9372 9378 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 9379 psFree(md); 9380 return false; 9381 } 9382 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 9383 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 9373 9384 psFree(md); 9374 9385 return false; … … 9397 9408 bool detProcessedImfileInsertObject(psDB *dbh, detProcessedImfileRow *object) 9398 9409 { 9399 return detProcessedImfileInsert(dbh, object->det_id, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri );9410 return detProcessedImfileInsert(dbh, object->det_id, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->fault); 9400 9411 } 9401 9412 … … 9520 9531 return false; 9521 9532 } 9533 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 9534 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 9535 psFree(md); 9536 return false; 9537 } 9522 9538 9523 9539 … … 9579 9595 return false; 9580 9596 } 9581 9582 return detProcessedImfileRowAlloc(det_id, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri); 9597 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 9598 if (!status) { 9599 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 9600 return false; 9601 } 9602 9603 return detProcessedImfileRowAlloc(det_id, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault); 9583 9604 } 9584 9605 psArray *detProcessedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 9692 9713 static void detProcessedExpRowFree(detProcessedExpRow *object); 9693 9714 9694 detProcessedExpRow *detProcessedExpRowAlloc(psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri )9715 detProcessedExpRow *detProcessedExpRowAlloc(psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault) 9695 9716 { 9696 9717 detProcessedExpRow *_object; … … 9707 9728 _object->b1_uri = psStringCopy(b1_uri); 9708 9729 _object->b2_uri = psStringCopy(b2_uri); 9730 _object->fault = fault; 9709 9731 9710 9732 return _object; … … 9762 9784 return false; 9763 9785 } 9786 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) { 9787 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 9788 psFree(md); 9789 return false; 9790 } 9764 9791 9765 9792 bool status = psDBCreateTable(dbh, DETPROCESSEDEXP_TABLE_NAME, md); … … 9775 9802 } 9776 9803 9777 bool detProcessedExpInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri )9804 bool detProcessedExpInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault) 9778 9805 { 9779 9806 psMetadata *md = psMetadataAlloc(); … … 9815 9842 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 9816 9843 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 9844 psFree(md); 9845 return false; 9846 } 9847 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 9848 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 9817 9849 psFree(md); 9818 9850 return false; … … 9841 9873 bool detProcessedExpInsertObject(psDB *dbh, detProcessedExpRow *object) 9842 9874 { 9843 return detProcessedExpInsert(dbh, object->det_id, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri );9875 return detProcessedExpInsert(dbh, object->det_id, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->fault); 9844 9876 } 9845 9877 … … 9954 9986 return false; 9955 9987 } 9988 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 9989 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 9990 psFree(md); 9991 return false; 9992 } 9956 9993 9957 9994 … … 10003 10040 return false; 10004 10041 } 10005 10006 return detProcessedExpRowAlloc(det_id, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri); 10042 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 10043 if (!status) { 10044 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 10045 return false; 10046 } 10047 10048 return detProcessedExpRowAlloc(det_id, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault); 10007 10049 } 10008 10050 psArray *detProcessedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 10116 10158 static void detStackedImfileRowFree(detStackedImfileRow *object); 10117 10159 10118 detStackedImfileRow *detStackedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev )10160 detStackedImfileRow *detStackedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psS16 fault) 10119 10161 { 10120 10162 detStackedImfileRow *_object; … … 10131 10173 _object->bg_stdev = bg_stdev; 10132 10174 _object->bg_mean_stdev = bg_mean_stdev; 10175 _object->fault = fault; 10133 10176 10134 10177 return _object; … … 10185 10228 return false; 10186 10229 } 10230 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) { 10231 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 10232 psFree(md); 10233 return false; 10234 } 10187 10235 10188 10236 bool status = psDBCreateTable(dbh, DETSTACKEDIMFILE_TABLE_NAME, md); … … 10198 10246 } 10199 10247 10200 bool detStackedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev )10248 bool detStackedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psS16 fault) 10201 10249 { 10202 10250 psMetadata *md = psMetadataAlloc(); … … 10238 10286 if (!psMetadataAdd(md, PS_LIST_TAIL, "bg_mean_stdev", PS_DATA_F64, NULL, bg_mean_stdev)) { 10239 10287 psError(PS_ERR_UNKNOWN, false, "failed to add item bg_mean_stdev"); 10288 psFree(md); 10289 return false; 10290 } 10291 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 10292 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 10240 10293 psFree(md); 10241 10294 return false; … … 10264 10317 bool detStackedImfileInsertObject(psDB *dbh, detStackedImfileRow *object) 10265 10318 { 10266 return detStackedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev );10319 return detStackedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->fault); 10267 10320 } 10268 10321 … … 10377 10430 return false; 10378 10431 } 10432 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 10433 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 10434 psFree(md); 10435 return false; 10436 } 10379 10437 10380 10438 … … 10426 10484 return false; 10427 10485 } 10428 10429 return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev); 10486 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 10487 if (!status) { 10488 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 10489 return false; 10490 } 10491 10492 return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, fault); 10430 10493 } 10431 10494 psArray *detStackedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 10539 10602 static void detNormalizedStatImfileRowFree(detNormalizedStatImfileRow *object); 10540 10603 10541 detNormalizedStatImfileRow *detNormalizedStatImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, psF32 norm )10604 detNormalizedStatImfileRow *detNormalizedStatImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, psF32 norm, psS16 fault) 10542 10605 { 10543 10606 detNormalizedStatImfileRow *_object; … … 10550 10613 _object->class_id = psStringCopy(class_id); 10551 10614 _object->norm = norm; 10615 _object->fault = fault; 10552 10616 10553 10617 return _object; … … 10582 10646 return false; 10583 10647 } 10648 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) { 10649 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 10650 psFree(md); 10651 return false; 10652 } 10584 10653 10585 10654 bool status = psDBCreateTable(dbh, DETNORMALIZEDSTATIMFILE_TABLE_NAME, md); … … 10595 10664 } 10596 10665 10597 bool detNormalizedStatImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, psF32 norm )10666 bool detNormalizedStatImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, psF32 norm, psS16 fault) 10598 10667 { 10599 10668 psMetadata *md = psMetadataAlloc(); … … 10615 10684 if (!psMetadataAdd(md, PS_LIST_TAIL, "norm", PS_DATA_F32, NULL, norm)) { 10616 10685 psError(PS_ERR_UNKNOWN, false, "failed to add item norm"); 10686 psFree(md); 10687 return false; 10688 } 10689 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 10690 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 10617 10691 psFree(md); 10618 10692 return false; … … 10641 10715 bool detNormalizedStatImfileInsertObject(psDB *dbh, detNormalizedStatImfileRow *object) 10642 10716 { 10643 return detNormalizedStatImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->norm );10717 return detNormalizedStatImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->norm, object->fault); 10644 10718 } 10645 10719 … … 10734 10808 return false; 10735 10809 } 10810 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 10811 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 10812 psFree(md); 10813 return false; 10814 } 10736 10815 10737 10816 … … 10763 10842 return false; 10764 10843 } 10765 10766 return detNormalizedStatImfileRowAlloc(det_id, iteration, class_id, norm); 10844 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 10845 if (!status) { 10846 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 10847 return false; 10848 } 10849 10850 return detNormalizedStatImfileRowAlloc(det_id, iteration, class_id, norm, fault); 10767 10851 } 10768 10852 psArray *detNormalizedStatImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 10876 10960 static void detNormalizedImfileRowFree(detNormalizedImfileRow *object); 10877 10961 10878 detNormalizedImfileRow *detNormalizedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri )10962 detNormalizedImfileRow *detNormalizedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault) 10879 10963 { 10880 10964 detNormalizedImfileRow *_object; … … 10892 10976 _object->b1_uri = psStringCopy(b1_uri); 10893 10977 _object->b2_uri = psStringCopy(b2_uri); 10978 _object->fault = fault; 10894 10979 10895 10980 return _object; … … 10952 11037 return false; 10953 11038 } 11039 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) { 11040 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 11041 psFree(md); 11042 return false; 11043 } 10954 11044 10955 11045 bool status = psDBCreateTable(dbh, DETNORMALIZEDIMFILE_TABLE_NAME, md); … … 10965 11055 } 10966 11056 10967 bool detNormalizedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri )11057 bool detNormalizedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault) 10968 11058 { 10969 11059 psMetadata *md = psMetadataAlloc(); … … 11010 11100 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 11011 11101 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 11102 psFree(md); 11103 return false; 11104 } 11105 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 11106 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 11012 11107 psFree(md); 11013 11108 return false; … … 11036 11131 bool detNormalizedImfileInsertObject(psDB *dbh, detNormalizedImfileRow *object) 11037 11132 { 11038 return detNormalizedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri );11133 return detNormalizedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->fault); 11039 11134 } 11040 11135 … … 11154 11249 return false; 11155 11250 } 11251 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 11252 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 11253 psFree(md); 11254 return false; 11255 } 11156 11256 11157 11257 … … 11208 11308 return false; 11209 11309 } 11210 11211 return detNormalizedImfileRowAlloc(det_id, iteration, class_id, uri, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri); 11310 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 11311 if (!status) { 11312 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 11313 return false; 11314 } 11315 11316 return detNormalizedImfileRowAlloc(det_id, iteration, class_id, uri, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault); 11212 11317 } 11213 11318 psArray *detNormalizedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 11321 11426 static void detNormalizedExpRowFree(detNormalizedExpRow *object); 11322 11427 11323 detNormalizedExpRow *detNormalizedExpRowAlloc(psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri )11428 detNormalizedExpRow *detNormalizedExpRowAlloc(psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault) 11324 11429 { 11325 11430 detNormalizedExpRow *_object; … … 11336 11441 _object->b1_uri = psStringCopy(b1_uri); 11337 11442 _object->b2_uri = psStringCopy(b2_uri); 11443 _object->fault = fault; 11338 11444 11339 11445 return _object; … … 11390 11496 return false; 11391 11497 } 11498 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) { 11499 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 11500 psFree(md); 11501 return false; 11502 } 11392 11503 11393 11504 bool status = psDBCreateTable(dbh, DETNORMALIZEDEXP_TABLE_NAME, md); … … 11403 11514 } 11404 11515 11405 bool detNormalizedExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri )11516 bool detNormalizedExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault) 11406 11517 { 11407 11518 psMetadata *md = psMetadataAlloc(); … … 11443 11554 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 11444 11555 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 11556 psFree(md); 11557 return false; 11558 } 11559 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 11560 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 11445 11561 psFree(md); 11446 11562 return false; … … 11469 11585 bool detNormalizedExpInsertObject(psDB *dbh, detNormalizedExpRow *object) 11470 11586 { 11471 return detNormalizedExpInsert(dbh, object->det_id, object->iteration, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri );11587 return detNormalizedExpInsert(dbh, object->det_id, object->iteration, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->fault); 11472 11588 } 11473 11589 … … 11582 11698 return false; 11583 11699 } 11700 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 11701 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 11702 psFree(md); 11703 return false; 11704 } 11584 11705 11585 11706 … … 11631 11752 return false; 11632 11753 } 11633 11634 return detNormalizedExpRowAlloc(det_id, iteration, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri); 11754 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 11755 if (!status) { 11756 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 11757 return false; 11758 } 11759 11760 return detNormalizedExpRowAlloc(det_id, iteration, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault); 11635 11761 } 11636 11762 psArray *detNormalizedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 11744 11870 static void detResidImfileRowFree(detResidImfileRow *object); 11745 11871 11746 detResidImfileRow *detResidImfileRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri )11872 detResidImfileRow *detResidImfileRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault) 11747 11873 { 11748 11874 detResidImfileRow *_object; … … 11762 11888 _object->b1_uri = psStringCopy(b1_uri); 11763 11889 _object->b2_uri = psStringCopy(b2_uri); 11890 _object->fault = fault; 11764 11891 11765 11892 return _object; … … 11834 11961 return false; 11835 11962 } 11963 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) { 11964 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 11965 psFree(md); 11966 return false; 11967 } 11836 11968 11837 11969 bool status = psDBCreateTable(dbh, DETRESIDIMFILE_TABLE_NAME, md); … … 11847 11979 } 11848 11980 11849 bool detResidImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri )11981 bool detResidImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault) 11850 11982 { 11851 11983 psMetadata *md = psMetadataAlloc(); … … 11902 12034 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 11903 12035 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 12036 psFree(md); 12037 return false; 12038 } 12039 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 12040 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 11904 12041 psFree(md); 11905 12042 return false; … … 11928 12065 bool detResidImfileInsertObject(psDB *dbh, detResidImfileRow *object) 11929 12066 { 11930 return detResidImfileInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri );12067 return detResidImfileInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->fault); 11931 12068 } 11932 12069 … … 12056 12193 return false; 12057 12194 } 12195 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 12196 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 12197 psFree(md); 12198 return false; 12199 } 12058 12200 12059 12201 … … 12120 12262 return false; 12121 12263 } 12122 12123 return detResidImfileRowAlloc(det_id, iteration, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri); 12264 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 12265 if (!status) { 12266 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 12267 return false; 12268 } 12269 12270 return detResidImfileRowAlloc(det_id, iteration, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault); 12124 12271 } 12125 12272 psArray *detResidImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 12233 12380 static void detResidExpRowFree(detResidExpRow *object); 12234 12381 12235 detResidExpRow *detResidExpRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, bool accept )12382 detResidExpRow *detResidExpRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, bool accept, psS16 fault) 12236 12383 { 12237 12384 detResidExpRow *_object; … … 12250 12397 _object->b2_uri = psStringCopy(b2_uri); 12251 12398 _object->accept = accept; 12399 _object->fault = fault; 12252 12400 12253 12401 return _object; … … 12315 12463 return false; 12316 12464 } 12465 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) { 12466 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 12467 psFree(md); 12468 return false; 12469 } 12317 12470 12318 12471 bool status = psDBCreateTable(dbh, DETRESIDEXP_TABLE_NAME, md); … … 12328 12481 } 12329 12482 12330 bool detResidExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, bool accept )12483 bool detResidExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, bool accept, psS16 fault) 12331 12484 { 12332 12485 psMetadata *md = psMetadataAlloc(); … … 12378 12531 if (!psMetadataAdd(md, PS_LIST_TAIL, "accept", PS_DATA_BOOL, NULL, accept)) { 12379 12532 psError(PS_ERR_UNKNOWN, false, "failed to add item accept"); 12533 psFree(md); 12534 return false; 12535 } 12536 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 12537 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 12380 12538 psFree(md); 12381 12539 return false; … … 12404 12562 bool detResidExpInsertObject(psDB *dbh, detResidExpRow *object) 12405 12563 { 12406 return detResidExpInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->accept );12564 return detResidExpInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->accept, object->fault); 12407 12565 } 12408 12566 … … 12527 12685 return false; 12528 12686 } 12687 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 12688 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 12689 psFree(md); 12690 return false; 12691 } 12529 12692 12530 12693 … … 12586 12749 return false; 12587 12750 } 12588 12589 return detResidExpRowAlloc(det_id, iteration, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, accept); 12751 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 12752 if (!status) { 12753 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 12754 return false; 12755 } 12756 12757 return detResidExpRowAlloc(det_id, iteration, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, accept, fault); 12590 12758 } 12591 12759 psArray *detResidExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 12699 12867 static void detRunSummaryRowFree(detRunSummaryRow *object); 12700 12868 12701 detRunSummaryRow *detRunSummaryRowAlloc(psS32 det_id, psS32 iteration, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, bool accept )12869 detRunSummaryRow *detRunSummaryRowAlloc(psS32 det_id, psS32 iteration, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, bool accept, psS16 fault) 12702 12870 { 12703 12871 detRunSummaryRow *_object; … … 12712 12880 _object->bg_mean_stdev = bg_mean_stdev; 12713 12881 _object->accept = accept; 12882 _object->fault = fault; 12714 12883 12715 12884 return _object; … … 12753 12922 return false; 12754 12923 } 12924 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) { 12925 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 12926 psFree(md); 12927 return false; 12928 } 12755 12929 12756 12930 bool status = psDBCreateTable(dbh, DETRUNSUMMARY_TABLE_NAME, md); … … 12766 12940 } 12767 12941 12768 bool detRunSummaryInsert(psDB * dbh, psS32 det_id, psS32 iteration, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, bool accept )12942 bool detRunSummaryInsert(psDB * dbh, psS32 det_id, psS32 iteration, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, bool accept, psS16 fault) 12769 12943 { 12770 12944 psMetadata *md = psMetadataAlloc(); … … 12796 12970 if (!psMetadataAdd(md, PS_LIST_TAIL, "accept", PS_DATA_BOOL, NULL, accept)) { 12797 12971 psError(PS_ERR_UNKNOWN, false, "failed to add item accept"); 12972 psFree(md); 12973 return false; 12974 } 12975 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 12976 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 12798 12977 psFree(md); 12799 12978 return false; … … 12822 13001 bool detRunSummaryInsertObject(psDB *dbh, detRunSummaryRow *object) 12823 13002 { 12824 return detRunSummaryInsert(dbh, object->det_id, object->iteration, object->bg, object->bg_stdev, object->bg_mean_stdev, object->accept );13003 return detRunSummaryInsert(dbh, object->det_id, object->iteration, object->bg, object->bg_stdev, object->bg_mean_stdev, object->accept, object->fault); 12825 13004 } 12826 13005 … … 12925 13104 return false; 12926 13105 } 13106 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 13107 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 13108 psFree(md); 13109 return false; 13110 } 12927 13111 12928 13112 … … 12964 13148 return false; 12965 13149 } 12966 12967 return detRunSummaryRowAlloc(det_id, iteration, bg, bg_stdev, bg_mean_stdev, accept); 13150 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 13151 if (!status) { 13152 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 13153 return false; 13154 } 13155 13156 return detRunSummaryRowAlloc(det_id, iteration, bg, bg_stdev, bg_mean_stdev, accept, fault); 12968 13157 } 12969 13158 psArray *detRunSummarySelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) -
trunk/ippdb/src/ippdb.h
r11077 r11113 4842 4842 char *b1_uri; 4843 4843 char *b2_uri; 4844 psS16 fault; 4844 4845 } detProcessedImfileRow; 4845 4846 … … 4859 4860 psF64 bg_mean_stdev, 4860 4861 const char *b1_uri, 4861 const char *b2_uri 4862 const char *b2_uri, 4863 psS16 fault 4862 4864 ); 4863 4865 … … 4898 4900 psF64 bg_mean_stdev, 4899 4901 const char *b1_uri, 4900 const char *b2_uri 4902 const char *b2_uri, 4903 psS16 fault 4901 4904 ); 4902 4905 … … 5062 5065 char *b1_uri; 5063 5066 char *b2_uri; 5067 psS16 fault; 5064 5068 } detProcessedExpRow; 5065 5069 … … 5077 5081 psF64 bg_mean_stdev, 5078 5082 const char *b1_uri, 5079 const char *b2_uri 5083 const char *b2_uri, 5084 psS16 fault 5080 5085 ); 5081 5086 … … 5114 5119 psF64 bg_mean_stdev, 5115 5120 const char *b1_uri, 5116 const char *b2_uri 5121 const char *b2_uri, 5122 psS16 fault 5117 5123 ); 5118 5124 … … 5278 5284 psF64 bg_stdev; 5279 5285 psF64 bg_mean_stdev; 5286 psS16 fault; 5280 5287 } detStackedImfileRow; 5281 5288 … … 5293 5300 psF64 bg, 5294 5301 psF64 bg_stdev, 5295 psF64 bg_mean_stdev 5302 psF64 bg_mean_stdev, 5303 psS16 fault 5296 5304 ); 5297 5305 … … 5330 5338 psF64 bg, 5331 5339 psF64 bg_stdev, 5332 psF64 bg_mean_stdev 5340 psF64 bg_mean_stdev, 5341 psS16 fault 5333 5342 ); 5334 5343 … … 5490 5499 char *class_id; 5491 5500 psF32 norm; 5501 psS16 fault; 5492 5502 } detNormalizedStatImfileRow; 5493 5503 … … 5501 5511 psS32 iteration, 5502 5512 const char *class_id, 5503 psF32 norm 5513 psF32 norm, 5514 psS16 fault 5504 5515 ); 5505 5516 … … 5534 5545 psS32 iteration, 5535 5546 const char *class_id, 5536 psF32 norm 5547 psF32 norm, 5548 psS16 fault 5537 5549 ); 5538 5550 … … 5699 5711 char *b1_uri; 5700 5712 char *b2_uri; 5713 psS16 fault; 5701 5714 } detNormalizedImfileRow; 5702 5715 … … 5715 5728 psF64 bg_mean_stdev, 5716 5729 const char *b1_uri, 5717 const char *b2_uri 5730 const char *b2_uri, 5731 psS16 fault 5718 5732 ); 5719 5733 … … 5753 5767 psF64 bg_mean_stdev, 5754 5768 const char *b1_uri, 5755 const char *b2_uri 5769 const char *b2_uri, 5770 psS16 fault 5756 5771 ); 5757 5772 … … 5917 5932 char *b1_uri; 5918 5933 char *b2_uri; 5934 psS16 fault; 5919 5935 } detNormalizedExpRow; 5920 5936 … … 5932 5948 psF64 bg_mean_stdev, 5933 5949 const char *b1_uri, 5934 const char *b2_uri 5950 const char *b2_uri, 5951 psS16 fault 5935 5952 ); 5936 5953 … … 5969 5986 psF64 bg_mean_stdev, 5970 5987 const char *b1_uri, 5971 const char *b2_uri 5988 const char *b2_uri, 5989 psS16 fault 5972 5990 ); 5973 5991 … … 6136 6154 char *b1_uri; 6137 6155 char *b2_uri; 6156 psS16 fault; 6138 6157 } detResidImfileRow; 6139 6158 … … 6154 6173 psF64 bg_mean_stdev, 6155 6174 const char *b1_uri, 6156 const char *b2_uri 6175 const char *b2_uri, 6176 psS16 fault 6157 6177 ); 6158 6178 … … 6194 6214 psF64 bg_mean_stdev, 6195 6215 const char *b1_uri, 6196 const char *b2_uri 6216 const char *b2_uri, 6217 psS16 fault 6197 6218 ); 6198 6219 … … 6360 6381 char *b2_uri; 6361 6382 bool accept; 6383 psS16 fault; 6362 6384 } detResidExpRow; 6363 6385 … … 6377 6399 const char *b1_uri, 6378 6400 const char *b2_uri, 6379 bool accept 6401 bool accept, 6402 psS16 fault 6380 6403 ); 6381 6404 … … 6416 6439 const char *b1_uri, 6417 6440 const char *b2_uri, 6418 bool accept 6441 bool accept, 6442 psS16 fault 6419 6443 ); 6420 6444 … … 6578 6602 psF64 bg_mean_stdev; 6579 6603 bool accept; 6604 psS16 fault; 6580 6605 } detRunSummaryRow; 6581 6606 … … 6591 6616 psF64 bg_stdev, 6592 6617 psF64 bg_mean_stdev, 6593 bool accept 6618 bool accept, 6619 psS16 fault 6594 6620 ); 6595 6621 … … 6626 6652 psF64 bg_stdev, 6627 6653 psF64 bg_mean_stdev, 6628 bool accept 6654 bool accept, 6655 psS16 fault 6629 6656 ); 6630 6657 -
trunk/ippdb/tests/alloc.c
r11077 r11113 921 921 detProcessedImfileRow *object; 922 922 923 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );923 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16 ); 924 924 925 925 if (!object) { … … 967 967 exit(EXIT_FAILURE); 968 968 } 969 psFree(object); 970 exit(EXIT_FAILURE); 971 } 969 972 970 973 psFree(object); … … 974 977 detProcessedExpRow *object; 975 978 976 object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );979 object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16 ); 977 980 978 981 if (!object) { … … 1012 1015 exit(EXIT_FAILURE); 1013 1016 } 1017 psFree(object); 1018 exit(EXIT_FAILURE); 1019 } 1014 1020 1015 1021 psFree(object); … … 1019 1025 detStackedImfileRow *object; 1020 1026 1021 object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64 );1027 object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, -16 ); 1022 1028 1023 1029 if (!object) { … … 1057 1063 exit(EXIT_FAILURE); 1058 1064 } 1065 psFree(object); 1066 exit(EXIT_FAILURE); 1067 } 1059 1068 1060 1069 psFree(object); … … 1064 1073 detNormalizedStatImfileRow *object; 1065 1074 1066 object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32 );1075 object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32, -16 ); 1067 1076 1068 1077 if (!object) { … … 1086 1095 exit(EXIT_FAILURE); 1087 1096 } 1097 psFree(object); 1098 exit(EXIT_FAILURE); 1099 } 1088 1100 1089 1101 psFree(object); … … 1093 1105 detNormalizedImfileRow *object; 1094 1106 1095 object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );1107 object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16 ); 1096 1108 1097 1109 if (!object) { … … 1135 1147 exit(EXIT_FAILURE); 1136 1148 } 1149 psFree(object); 1150 exit(EXIT_FAILURE); 1151 } 1137 1152 1138 1153 psFree(object); … … 1142 1157 detNormalizedExpRow *object; 1143 1158 1144 object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string" );1159 object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string", -16 ); 1145 1160 1146 1161 if (!object) { … … 1180 1195 exit(EXIT_FAILURE); 1181 1196 } 1197 psFree(object); 1198 exit(EXIT_FAILURE); 1199 } 1182 1200 1183 1201 psFree(object); … … 1187 1205 detResidImfileRow *object; 1188 1206 1189 object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );1207 object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16 ); 1190 1208 1191 1209 if (!object) { … … 1237 1255 exit(EXIT_FAILURE); 1238 1256 } 1257 psFree(object); 1258 exit(EXIT_FAILURE); 1259 } 1239 1260 1240 1261 psFree(object); … … 1244 1265 detResidExpRow *object; 1245 1266 1246 object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true );1267 object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true, -16 ); 1247 1268 1248 1269 if (!object) { … … 1290 1311 exit(EXIT_FAILURE); 1291 1312 } 1313 psFree(object); 1314 exit(EXIT_FAILURE); 1315 } 1292 1316 1293 1317 psFree(object); … … 1297 1321 detRunSummaryRow *object; 1298 1322 1299 object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true );1323 object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true, -16 ); 1300 1324 1301 1325 if (!object) { … … 1324 1348 } 1325 1349 if (!object->accept == true) { 1350 psFree(object); 1351 exit(EXIT_FAILURE); 1352 } 1326 1353 psFree(object); 1327 1354 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r11077 r11113 343 343 } 344 344 345 if (!detProcessedImfileInsert(dbh, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" )) {346 exit(EXIT_FAILURE); 347 } 348 349 psDBCleanup(dbh); 350 } 351 352 { 353 psDB *dbh; 354 355 dbh = psDBInit("localhost", "test", NULL, "test"); 356 if (!dbh) { 357 exit(EXIT_FAILURE); 358 } 359 360 if (!detProcessedExpInsert(dbh, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" )) {361 exit(EXIT_FAILURE); 362 } 363 364 psDBCleanup(dbh); 365 } 366 367 { 368 psDB *dbh; 369 370 dbh = psDBInit("localhost", "test", NULL, "test"); 371 if (!dbh) { 372 exit(EXIT_FAILURE); 373 } 374 375 if (!detStackedImfileInsert(dbh, -32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64 )) {376 exit(EXIT_FAILURE); 377 } 378 379 psDBCleanup(dbh); 380 } 381 382 { 383 psDB *dbh; 384 385 dbh = psDBInit("localhost", "test", NULL, "test"); 386 if (!dbh) { 387 exit(EXIT_FAILURE); 388 } 389 390 if (!detNormalizedStatImfileInsert(dbh, -32, -32, "a string", 32.32 )) {391 exit(EXIT_FAILURE); 392 } 393 394 psDBCleanup(dbh); 395 } 396 397 { 398 psDB *dbh; 399 400 dbh = psDBInit("localhost", "test", NULL, "test"); 401 if (!dbh) { 402 exit(EXIT_FAILURE); 403 } 404 405 if (!detNormalizedImfileInsert(dbh, -32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" )) {406 exit(EXIT_FAILURE); 407 } 408 409 psDBCleanup(dbh); 410 } 411 412 { 413 psDB *dbh; 414 415 dbh = psDBInit("localhost", "test", NULL, "test"); 416 if (!dbh) { 417 exit(EXIT_FAILURE); 418 } 419 420 if (!detNormalizedExpInsert(dbh, -32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string" )) {421 exit(EXIT_FAILURE); 422 } 423 424 psDBCleanup(dbh); 425 } 426 427 { 428 psDB *dbh; 429 430 dbh = psDBInit("localhost", "test", NULL, "test"); 431 if (!dbh) { 432 exit(EXIT_FAILURE); 433 } 434 435 if (!detResidImfileInsert(dbh, -32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" )) {436 exit(EXIT_FAILURE); 437 } 438 439 psDBCleanup(dbh); 440 } 441 442 { 443 psDB *dbh; 444 445 dbh = psDBInit("localhost", "test", NULL, "test"); 446 if (!dbh) { 447 exit(EXIT_FAILURE); 448 } 449 450 if (!detResidExpInsert(dbh, -32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true )) {451 exit(EXIT_FAILURE); 452 } 453 454 psDBCleanup(dbh); 455 } 456 457 { 458 psDB *dbh; 459 460 dbh = psDBInit("localhost", "test", NULL, "test"); 461 if (!dbh) { 462 exit(EXIT_FAILURE); 463 } 464 465 if (!detRunSummaryInsert(dbh, -32, -32, 64.64, 64.64, 64.64, true )) {345 if (!detProcessedImfileInsert(dbh, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16)) { 346 exit(EXIT_FAILURE); 347 } 348 349 psDBCleanup(dbh); 350 } 351 352 { 353 psDB *dbh; 354 355 dbh = psDBInit("localhost", "test", NULL, "test"); 356 if (!dbh) { 357 exit(EXIT_FAILURE); 358 } 359 360 if (!detProcessedExpInsert(dbh, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16)) { 361 exit(EXIT_FAILURE); 362 } 363 364 psDBCleanup(dbh); 365 } 366 367 { 368 psDB *dbh; 369 370 dbh = psDBInit("localhost", "test", NULL, "test"); 371 if (!dbh) { 372 exit(EXIT_FAILURE); 373 } 374 375 if (!detStackedImfileInsert(dbh, -32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, -16)) { 376 exit(EXIT_FAILURE); 377 } 378 379 psDBCleanup(dbh); 380 } 381 382 { 383 psDB *dbh; 384 385 dbh = psDBInit("localhost", "test", NULL, "test"); 386 if (!dbh) { 387 exit(EXIT_FAILURE); 388 } 389 390 if (!detNormalizedStatImfileInsert(dbh, -32, -32, "a string", 32.32, -16)) { 391 exit(EXIT_FAILURE); 392 } 393 394 psDBCleanup(dbh); 395 } 396 397 { 398 psDB *dbh; 399 400 dbh = psDBInit("localhost", "test", NULL, "test"); 401 if (!dbh) { 402 exit(EXIT_FAILURE); 403 } 404 405 if (!detNormalizedImfileInsert(dbh, -32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16)) { 406 exit(EXIT_FAILURE); 407 } 408 409 psDBCleanup(dbh); 410 } 411 412 { 413 psDB *dbh; 414 415 dbh = psDBInit("localhost", "test", NULL, "test"); 416 if (!dbh) { 417 exit(EXIT_FAILURE); 418 } 419 420 if (!detNormalizedExpInsert(dbh, -32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string", -16)) { 421 exit(EXIT_FAILURE); 422 } 423 424 psDBCleanup(dbh); 425 } 426 427 { 428 psDB *dbh; 429 430 dbh = psDBInit("localhost", "test", NULL, "test"); 431 if (!dbh) { 432 exit(EXIT_FAILURE); 433 } 434 435 if (!detResidImfileInsert(dbh, -32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16)) { 436 exit(EXIT_FAILURE); 437 } 438 439 psDBCleanup(dbh); 440 } 441 442 { 443 psDB *dbh; 444 445 dbh = psDBInit("localhost", "test", NULL, "test"); 446 if (!dbh) { 447 exit(EXIT_FAILURE); 448 } 449 450 if (!detResidExpInsert(dbh, -32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true, -16)) { 451 exit(EXIT_FAILURE); 452 } 453 454 psDBCleanup(dbh); 455 } 456 457 { 458 psDB *dbh; 459 460 dbh = psDBInit("localhost", "test", NULL, "test"); 461 if (!dbh) { 462 exit(EXIT_FAILURE); 463 } 464 465 if (!detRunSummaryInsert(dbh, -32, -32, 64.64, 64.64, 64.64, true, -16)) { 466 466 exit(EXIT_FAILURE); 467 467 } -
trunk/ippdb/tests/insertobject.c
r11077 r11113 498 498 } 499 499 500 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );500 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16); 501 501 if (!object) { 502 502 exit(EXIT_FAILURE); … … 520 520 } 521 521 522 object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );522 object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16); 523 523 if (!object) { 524 524 exit(EXIT_FAILURE); … … 542 542 } 543 543 544 object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64 );544 object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, -16); 545 545 if (!object) { 546 546 exit(EXIT_FAILURE); … … 564 564 } 565 565 566 object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32 );566 object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32, -16); 567 567 if (!object) { 568 568 exit(EXIT_FAILURE); … … 586 586 } 587 587 588 object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );588 object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16); 589 589 if (!object) { 590 590 exit(EXIT_FAILURE); … … 608 608 } 609 609 610 object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string" );610 object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string", -16); 611 611 if (!object) { 612 612 exit(EXIT_FAILURE); … … 630 630 } 631 631 632 object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );632 object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16); 633 633 if (!object) { 634 634 exit(EXIT_FAILURE); … … 652 652 } 653 653 654 object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true );654 object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true, -16); 655 655 if (!object) { 656 656 exit(EXIT_FAILURE); … … 674 674 } 675 675 676 object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true );676 object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true, -16); 677 677 if (!object) { 678 678 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r11077 r11113 1099 1099 bool status; 1100 1100 1101 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );1101 object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16); 1102 1102 if (!object) { 1103 1103 exit(EXIT_FAILURE); … … 1151 1151 exit(EXIT_FAILURE); 1152 1152 } 1153 psFree(md); 1154 exit(EXIT_FAILURE); 1155 } 1153 1156 1154 1157 psFree(md); … … 1160 1163 bool status; 1161 1164 1162 object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );1165 object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16); 1163 1166 if (!object) { 1164 1167 exit(EXIT_FAILURE); … … 1204 1207 exit(EXIT_FAILURE); 1205 1208 } 1209 psFree(md); 1210 exit(EXIT_FAILURE); 1211 } 1206 1212 1207 1213 psFree(md); … … 1213 1219 bool status; 1214 1220 1215 object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64 );1221 object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, -16); 1216 1222 if (!object) { 1217 1223 exit(EXIT_FAILURE); … … 1257 1263 exit(EXIT_FAILURE); 1258 1264 } 1265 psFree(md); 1266 exit(EXIT_FAILURE); 1267 } 1259 1268 1260 1269 psFree(md); … … 1266 1275 bool status; 1267 1276 1268 object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32 );1277 object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32, -16); 1269 1278 if (!object) { 1270 1279 exit(EXIT_FAILURE); … … 1294 1303 exit(EXIT_FAILURE); 1295 1304 } 1305 psFree(md); 1306 exit(EXIT_FAILURE); 1307 } 1296 1308 1297 1309 psFree(md); … … 1303 1315 bool status; 1304 1316 1305 object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );1317 object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16); 1306 1318 if (!object) { 1307 1319 exit(EXIT_FAILURE); … … 1351 1363 exit(EXIT_FAILURE); 1352 1364 } 1365 psFree(md); 1366 exit(EXIT_FAILURE); 1367 } 1353 1368 1354 1369 psFree(md); … … 1360 1375 bool status; 1361 1376 1362 object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string" );1377 object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string", -16); 1363 1378 if (!object) { 1364 1379 exit(EXIT_FAILURE); … … 1404 1419 exit(EXIT_FAILURE); 1405 1420 } 1421 psFree(md); 1422 exit(EXIT_FAILURE); 1423 } 1406 1424 1407 1425 psFree(md); … … 1413 1431 bool status; 1414 1432 1415 object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string" );1433 object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16); 1416 1434 if (!object) { 1417 1435 exit(EXIT_FAILURE); … … 1469 1487 exit(EXIT_FAILURE); 1470 1488 } 1489 psFree(md); 1490 exit(EXIT_FAILURE); 1491 } 1471 1492 1472 1493 psFree(md); … … 1478 1499 bool status; 1479 1500 1480 object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true );1501 object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true, -16); 1481 1502 if (!object) { 1482 1503 exit(EXIT_FAILURE); … … 1530 1551 exit(EXIT_FAILURE); 1531 1552 } 1553 psFree(md); 1554 exit(EXIT_FAILURE); 1555 } 1532 1556 1533 1557 psFree(md); … … 1539 1563 bool status; 1540 1564 1541 object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true );1565 object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true, -16); 1542 1566 if (!object) { 1543 1567 exit(EXIT_FAILURE); … … 1572 1596 } 1573 1597 if (!psMetadataLookupBool(&status, md, "accept") == true) { 1598 psFree(md); 1599 exit(EXIT_FAILURE); 1600 } 1574 1601 psFree(md); 1575 1602 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r11077 r11113 1697 1697 exit(EXIT_FAILURE); 1698 1698 } 1699 psFree(md); 1700 exit(EXIT_FAILURE); 1701 } 1699 1702 1700 1703 object = detProcessedImfileObjectFromMetadata(md); … … 1746 1749 exit(EXIT_FAILURE); 1747 1750 } 1751 psFree(object); 1752 exit(EXIT_FAILURE); 1753 } 1748 1754 1749 1755 psFree(object); … … 1787 1793 exit(EXIT_FAILURE); 1788 1794 } 1795 psFree(md); 1796 exit(EXIT_FAILURE); 1797 } 1789 1798 1790 1799 object = detProcessedExpObjectFromMetadata(md); … … 1828 1837 exit(EXIT_FAILURE); 1829 1838 } 1839 psFree(object); 1840 exit(EXIT_FAILURE); 1841 } 1830 1842 1831 1843 psFree(object); … … 1869 1881 exit(EXIT_FAILURE); 1870 1882 } 1883 psFree(md); 1884 exit(EXIT_FAILURE); 1885 } 1871 1886 1872 1887 object = detStackedImfileObjectFromMetadata(md); … … 1910 1925 exit(EXIT_FAILURE); 1911 1926 } 1927 psFree(object); 1928 exit(EXIT_FAILURE); 1929 } 1912 1930 1913 1931 psFree(object); … … 1935 1953 exit(EXIT_FAILURE); 1936 1954 } 1955 psFree(md); 1956 exit(EXIT_FAILURE); 1957 } 1937 1958 1938 1959 object = detNormalizedStatImfileObjectFromMetadata(md); … … 1960 1981 exit(EXIT_FAILURE); 1961 1982 } 1983 psFree(object); 1984 exit(EXIT_FAILURE); 1985 } 1962 1986 1963 1987 psFree(object); … … 2005 2029 exit(EXIT_FAILURE); 2006 2030 } 2031 psFree(md); 2032 exit(EXIT_FAILURE); 2033 } 2007 2034 2008 2035 object = detNormalizedImfileObjectFromMetadata(md); … … 2050 2077 exit(EXIT_FAILURE); 2051 2078 } 2079 psFree(object); 2080 exit(EXIT_FAILURE); 2081 } 2052 2082 2053 2083 psFree(object); … … 2091 2121 exit(EXIT_FAILURE); 2092 2122 } 2123 psFree(md); 2124 exit(EXIT_FAILURE); 2125 } 2093 2126 2094 2127 object = detNormalizedExpObjectFromMetadata(md); … … 2132 2165 exit(EXIT_FAILURE); 2133 2166 } 2167 psFree(object); 2168 exit(EXIT_FAILURE); 2169 } 2134 2170 2135 2171 psFree(object); … … 2185 2221 exit(EXIT_FAILURE); 2186 2222 } 2223 psFree(md); 2224 exit(EXIT_FAILURE); 2225 } 2187 2226 2188 2227 object = detResidImfileObjectFromMetadata(md); … … 2238 2277 exit(EXIT_FAILURE); 2239 2278 } 2279 psFree(object); 2280 exit(EXIT_FAILURE); 2281 } 2240 2282 2241 2283 psFree(object); … … 2287 2329 exit(EXIT_FAILURE); 2288 2330 } 2331 psFree(md); 2332 exit(EXIT_FAILURE); 2333 } 2289 2334 2290 2335 object = detResidExpObjectFromMetadata(md); … … 2336 2381 exit(EXIT_FAILURE); 2337 2382 } 2383 psFree(object); 2384 exit(EXIT_FAILURE); 2385 } 2338 2386 2339 2387 psFree(object); … … 2369 2417 exit(EXIT_FAILURE); 2370 2418 } 2419 psFree(md); 2420 exit(EXIT_FAILURE); 2421 } 2371 2422 2372 2423 object = detRunSummaryObjectFromMetadata(md); … … 2399 2450 } 2400 2451 if (!object->accept == true) { 2452 psFree(object); 2453 exit(EXIT_FAILURE); 2454 } 2401 2455 psFree(object); 2402 2456 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
