Changeset 17833
- Timestamp:
- May 28, 2008, 11:52:21 AM (18 years ago)
- Location:
- trunk/ippdb
- Files:
-
- 8 edited
-
configure.ac (modified) (1 diff)
-
src/ippdb.c (modified) (40 diffs)
-
src/ippdb.h (modified) (12 diffs)
-
tests/alloc.c (modified) (8 diffs)
-
tests/insert.c (modified) (3 diffs)
-
tests/insertobject.c (modified) (4 diffs)
-
tests/metadatafromobject.c (modified) (8 diffs)
-
tests/objectfrommetadata.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/configure.ac
r17570 r17833 7 7 AC_PREREQ(2.61) 8 8 9 AC_INIT([ippdb], [1.1.3 3], [pan-starrs.ifa.hawaii.edu])9 AC_INIT([ippdb], [1.1.36], [pan-starrs.ifa.hawaii.edu]) 10 10 AC_CONFIG_SRCDIR([ippdb.pc.in]) 11 11 -
trunk/ippdb/src/ippdb.c
r17570 r17833 3074 3074 static void rawExpRowFree(rawExpRow *object); 3075 3075 3076 rawExpRow *rawExpRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, psS16 fault)3076 rawExpRow *rawExpRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault) 3077 3077 { 3078 3078 rawExpRow *_object; … … 3136 3136 _object->object = psStringCopy(object); 3137 3137 _object->solang = solang; 3138 _object->hostname = psStringCopy(hostname); 3138 3139 _object->fault = fault; 3139 3140 … … 3158 3159 psFree(object->comment); 3159 3160 psFree(object->object); 3161 psFree(object->hostname); 3160 3162 } 3161 3163 … … 3168 3170 return false; 3169 3171 } 3170 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_name", PS_DATA_STRING, NULL, "64")) {3172 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_name", PS_DATA_STRING, "Key", "64")) { 3171 3173 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_name"); 3172 3174 psFree(md); … … 3438 3440 return false; 3439 3441 } 3442 if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, "64")) { 3443 psError(PS_ERR_UNKNOWN, false, "failed to add item hostname"); 3444 psFree(md); 3445 return false; 3446 } 3440 3447 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key NOT NULL", 0)) { 3441 3448 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); … … 3456 3463 } 3457 3464 3458 bool rawExpInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, psS16 fault)3465 bool rawExpInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault) 3459 3466 { 3460 3467 psMetadata *md = psMetadataAlloc(); … … 3731 3738 if (!psMetadataAdd(md, PS_LIST_TAIL, "solang", PS_DATA_F32, NULL, solang)) { 3732 3739 psError(PS_ERR_UNKNOWN, false, "failed to add item solang"); 3740 psFree(md); 3741 return false; 3742 } 3743 if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, hostname)) { 3744 psError(PS_ERR_UNKNOWN, false, "failed to add item hostname"); 3733 3745 psFree(md); 3734 3746 return false; … … 3762 3774 bool rawExpInsertObject(psDB *dbh, rawExpRow *object) 3763 3775 { 3764 return rawExpInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_tag, object->exp_type, object->filelevel, object->workdir, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->solang, object-> fault);3776 return rawExpInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_tag, object->exp_type, object->filelevel, object->workdir, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->solang, object->hostname, object->fault); 3765 3777 } 3766 3778 … … 4110 4122 return false; 4111 4123 } 4124 if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, object->hostname)) { 4125 psError(PS_ERR_UNKNOWN, false, "failed to add item hostname"); 4126 psFree(md); 4127 return false; 4128 } 4112 4129 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 4113 4130 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); … … 4399 4416 return false; 4400 4417 } 4418 char* hostname = psMetadataLookupPtr(&status, md, "hostname"); 4419 if (!status) { 4420 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item hostname"); 4421 return false; 4422 } 4401 4423 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 4402 4424 if (!status) { … … 4405 4427 } 4406 4428 4407 return rawExpRowAlloc(exp_id, exp_name, camera, telescope, dateobs, exp_tag, exp_type, filelevel, workdir, reduction, dvodb, tess_id, end_stage, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, solang, fault);4429 return rawExpRowAlloc(exp_id, exp_name, camera, telescope, dateobs, exp_tag, exp_type, filelevel, workdir, reduction, dvodb, tess_id, end_stage, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, solang, hostname, fault); 4408 4430 } 4409 4431 psArray *rawExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 4523 4545 static void rawImfileRowFree(rawImfileRow *object); 4524 4546 4525 rawImfileRow *rawImfileRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psS16 fault)4547 rawImfileRow *rawImfileRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault) 4526 4548 { 4527 4549 rawImfileRow *_object; … … 4581 4603 _object->user_5 = user_5; 4582 4604 _object->object = psStringCopy(object); 4605 _object->hostname = psStringCopy(hostname); 4583 4606 _object->fault = fault; 4584 4607 … … 4600 4623 psFree(object->comment); 4601 4624 psFree(object->object); 4625 psFree(object->hostname); 4602 4626 } 4603 4627 … … 4610 4634 return false; 4611 4635 } 4612 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_name", PS_DATA_STRING, NULL, "64")) {4636 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_name", PS_DATA_STRING, "UNIQUE(exp_id, tmp_class_id)", "64")) { 4613 4637 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_name"); 4614 4638 psFree(md); … … 4860 4884 return false; 4861 4885 } 4886 if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, "64")) { 4887 psError(PS_ERR_UNKNOWN, false, "failed to add item hostname"); 4888 psFree(md); 4889 return false; 4890 } 4862 4891 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key NOT NULL", 0)) { 4863 4892 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); … … 4878 4907 } 4879 4908 4880 bool rawImfileInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psS16 fault)4909 bool rawImfileInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault) 4881 4910 { 4882 4911 psMetadata *md = psMetadataAlloc(); … … 5133 5162 if (!psMetadataAdd(md, PS_LIST_TAIL, "object", PS_DATA_STRING, NULL, object)) { 5134 5163 psError(PS_ERR_UNKNOWN, false, "failed to add item object"); 5164 psFree(md); 5165 return false; 5166 } 5167 if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, hostname)) { 5168 psError(PS_ERR_UNKNOWN, false, "failed to add item hostname"); 5135 5169 psFree(md); 5136 5170 return false; … … 5164 5198 bool rawImfileInsertObject(psDB *dbh, rawImfileRow *object) 5165 5199 { 5166 return rawImfileInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->tmp_class_id, object->class_id, object->uri, object->exp_type, object->filelevel, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object-> fault);5200 return rawImfileInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->tmp_class_id, object->class_id, object->uri, object->exp_type, object->filelevel, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->hostname, object->fault); 5167 5201 } 5168 5202 … … 5492 5526 return false; 5493 5527 } 5528 if (!psMetadataAdd(md, PS_LIST_TAIL, "hostname", PS_DATA_STRING, NULL, object->hostname)) { 5529 psError(PS_ERR_UNKNOWN, false, "failed to add item hostname"); 5530 psFree(md); 5531 return false; 5532 } 5494 5533 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 5495 5534 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); … … 5761 5800 return false; 5762 5801 } 5802 char* hostname = psMetadataLookupPtr(&status, md, "hostname"); 5803 if (!status) { 5804 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item hostname"); 5805 return false; 5806 } 5763 5807 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 5764 5808 if (!status) { … … 5767 5811 } 5768 5812 5769 return rawImfileRowAlloc(exp_id, exp_name, camera, telescope, dateobs, tmp_class_id, class_id, uri, exp_type, filelevel, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, fault);5813 return rawImfileRowAlloc(exp_id, exp_name, camera, telescope, dateobs, tmp_class_id, class_id, uri, exp_type, filelevel, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, hostname, fault); 5770 5814 } 5771 5815 psArray *rawImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 10431 10475 static void warpSkyfileRowFree(warpSkyfileRow *object); 10432 10476 10433 warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF32 dtime_warp, const char *hostname, psF32 good_frac, bool ignored, psS16 fault)10477 warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF32 dtime_warp, const char *hostname, psF32 good_frac, psS32 xmin, psS32 xmax, psS32 ymin, psS32 ymax, bool ignored, psS16 fault) 10434 10478 { 10435 10479 warpSkyfileRow *_object; … … 10448 10492 _object->hostname = psStringCopy(hostname); 10449 10493 _object->good_frac = good_frac; 10494 _object->xmin = xmin; 10495 _object->xmax = xmax; 10496 _object->ymin = ymin; 10497 _object->ymax = ymax; 10450 10498 _object->ignored = ignored; 10451 10499 _object->fault = fault; … … 10516 10564 return false; 10517 10565 } 10566 if (!psMetadataAdd(md, PS_LIST_TAIL, "xmin", PS_DATA_S32, NULL, 0)) { 10567 psError(PS_ERR_UNKNOWN, false, "failed to add item xmin"); 10568 psFree(md); 10569 return false; 10570 } 10571 if (!psMetadataAdd(md, PS_LIST_TAIL, "xmax", PS_DATA_S32, NULL, 0)) { 10572 psError(PS_ERR_UNKNOWN, false, "failed to add item xmax"); 10573 psFree(md); 10574 return false; 10575 } 10576 if (!psMetadataAdd(md, PS_LIST_TAIL, "ymin", PS_DATA_S32, NULL, 0)) { 10577 psError(PS_ERR_UNKNOWN, false, "failed to add item ymin"); 10578 psFree(md); 10579 return false; 10580 } 10581 if (!psMetadataAdd(md, PS_LIST_TAIL, "ymax", PS_DATA_S32, NULL, 0)) { 10582 psError(PS_ERR_UNKNOWN, false, "failed to add item ymax"); 10583 psFree(md); 10584 return false; 10585 } 10518 10586 if (!psMetadataAdd(md, PS_LIST_TAIL, "ignored", PS_DATA_BOOL, "Key", 0)) { 10519 10587 psError(PS_ERR_UNKNOWN, false, "failed to add item ignored"); … … 10539 10607 } 10540 10608 10541 bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF32 dtime_warp, const char *hostname, psF32 good_frac, bool ignored, psS16 fault)10609 bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF32 dtime_warp, const char *hostname, psF32 good_frac, psS32 xmin, psS32 xmax, psS32 ymin, psS32 ymax, bool ignored, psS16 fault) 10542 10610 { 10543 10611 psMetadata *md = psMetadataAlloc(); … … 10589 10657 if (!psMetadataAdd(md, PS_LIST_TAIL, "good_frac", PS_DATA_F32, NULL, good_frac)) { 10590 10658 psError(PS_ERR_UNKNOWN, false, "failed to add item good_frac"); 10659 psFree(md); 10660 return false; 10661 } 10662 if (!psMetadataAdd(md, PS_LIST_TAIL, "xmin", PS_DATA_S32, NULL, xmin)) { 10663 psError(PS_ERR_UNKNOWN, false, "failed to add item xmin"); 10664 psFree(md); 10665 return false; 10666 } 10667 if (!psMetadataAdd(md, PS_LIST_TAIL, "xmax", PS_DATA_S32, NULL, xmax)) { 10668 psError(PS_ERR_UNKNOWN, false, "failed to add item xmax"); 10669 psFree(md); 10670 return false; 10671 } 10672 if (!psMetadataAdd(md, PS_LIST_TAIL, "ymin", PS_DATA_S32, NULL, ymin)) { 10673 psError(PS_ERR_UNKNOWN, false, "failed to add item ymin"); 10674 psFree(md); 10675 return false; 10676 } 10677 if (!psMetadataAdd(md, PS_LIST_TAIL, "ymax", PS_DATA_S32, NULL, ymax)) { 10678 psError(PS_ERR_UNKNOWN, false, "failed to add item ymax"); 10591 10679 psFree(md); 10592 10680 return false; … … 10625 10713 bool warpSkyfileInsertObject(psDB *dbh, warpSkyfileRow *object) 10626 10714 { 10627 return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->dtime_warp, object->hostname, object->good_frac, object-> ignored, object->fault);10715 return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->dtime_warp, object->hostname, object->good_frac, object->xmin, object->xmax, object->ymin, object->ymax, object->ignored, object->fault); 10628 10716 } 10629 10717 … … 10748 10836 return false; 10749 10837 } 10838 if (!psMetadataAdd(md, PS_LIST_TAIL, "xmin", PS_DATA_S32, NULL, object->xmin)) { 10839 psError(PS_ERR_UNKNOWN, false, "failed to add item xmin"); 10840 psFree(md); 10841 return false; 10842 } 10843 if (!psMetadataAdd(md, PS_LIST_TAIL, "xmax", PS_DATA_S32, NULL, object->xmax)) { 10844 psError(PS_ERR_UNKNOWN, false, "failed to add item xmax"); 10845 psFree(md); 10846 return false; 10847 } 10848 if (!psMetadataAdd(md, PS_LIST_TAIL, "ymin", PS_DATA_S32, NULL, object->ymin)) { 10849 psError(PS_ERR_UNKNOWN, false, "failed to add item ymin"); 10850 psFree(md); 10851 return false; 10852 } 10853 if (!psMetadataAdd(md, PS_LIST_TAIL, "ymax", PS_DATA_S32, NULL, object->ymax)) { 10854 psError(PS_ERR_UNKNOWN, false, "failed to add item ymax"); 10855 psFree(md); 10856 return false; 10857 } 10750 10858 if (!psMetadataAdd(md, PS_LIST_TAIL, "ignored", PS_DATA_BOOL, NULL, object->ignored)) { 10751 10859 psError(PS_ERR_UNKNOWN, false, "failed to add item ignored"); … … 10817 10925 return false; 10818 10926 } 10927 psS32 xmin = psMetadataLookupS32(&status, md, "xmin"); 10928 if (!status) { 10929 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item xmin"); 10930 return false; 10931 } 10932 psS32 xmax = psMetadataLookupS32(&status, md, "xmax"); 10933 if (!status) { 10934 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item xmax"); 10935 return false; 10936 } 10937 psS32 ymin = psMetadataLookupS32(&status, md, "ymin"); 10938 if (!status) { 10939 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item ymin"); 10940 return false; 10941 } 10942 psS32 ymax = psMetadataLookupS32(&status, md, "ymax"); 10943 if (!status) { 10944 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item ymax"); 10945 return false; 10946 } 10819 10947 bool ignored = psMetadataLookupBool(&status, md, "ignored"); 10820 10948 if (!status) { … … 10828 10956 } 10829 10957 10830 return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, dtime_warp, hostname, good_frac, ignored, fault);10958 return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, dtime_warp, hostname, good_frac, xmin, xmax, ymin, ymax, ignored, fault); 10831 10959 } 10832 10960 psArray *warpSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 12045 12173 static void diffSkyfileRowFree(diffSkyfileRow *object); 12046 12174 12047 diffSkyfileRow *diffSkyfileRowAlloc(psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, ps F32 dtime_diff, const char *hostname, psF32 good_frac, psS16 fault)12175 diffSkyfileRow *diffSkyfileRowAlloc(psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS32 stamps_num, psF32 stamps_rms, psS32 sources, psF32 dtime_diff, const char *hostname, psF32 good_frac, psS16 fault) 12048 12176 { 12049 12177 diffSkyfileRow *_object; … … 12057 12185 _object->bg = bg; 12058 12186 _object->bg_stdev = bg_stdev; 12187 _object->stamps_num = stamps_num; 12188 _object->stamps_rms = stamps_rms; 12189 _object->sources = sources; 12059 12190 _object->dtime_diff = dtime_diff; 12060 12191 _object->hostname = psStringCopy(hostname); … … 12100 12231 return false; 12101 12232 } 12233 if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_num", PS_DATA_S32, NULL, 0)) { 12234 psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_num"); 12235 psFree(md); 12236 return false; 12237 } 12238 if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_rms", PS_DATA_F32, NULL, 0.0)) { 12239 psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_rms"); 12240 psFree(md); 12241 return false; 12242 } 12243 if (!psMetadataAdd(md, PS_LIST_TAIL, "sources", PS_DATA_S32, NULL, 0)) { 12244 psError(PS_ERR_UNKNOWN, false, "failed to add item sources"); 12245 psFree(md); 12246 return false; 12247 } 12102 12248 if (!psMetadataAdd(md, PS_LIST_TAIL, "dtime_diff", PS_DATA_F32, NULL, 0.0)) { 12103 12249 psError(PS_ERR_UNKNOWN, false, "failed to add item dtime_diff"); … … 12133 12279 } 12134 12280 12135 bool diffSkyfileInsert(psDB * dbh, psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, ps F32 dtime_diff, const char *hostname, psF32 good_frac, psS16 fault)12281 bool diffSkyfileInsert(psDB * dbh, psS64 diff_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psS32 stamps_num, psF32 stamps_rms, psS32 sources, psF32 dtime_diff, const char *hostname, psF32 good_frac, psS16 fault) 12136 12282 { 12137 12283 psMetadata *md = psMetadataAlloc(); … … 12158 12304 if (!psMetadataAdd(md, PS_LIST_TAIL, "bg_stdev", PS_DATA_F64, NULL, bg_stdev)) { 12159 12305 psError(PS_ERR_UNKNOWN, false, "failed to add item bg_stdev"); 12306 psFree(md); 12307 return false; 12308 } 12309 if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_num", PS_DATA_S32, NULL, stamps_num)) { 12310 psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_num"); 12311 psFree(md); 12312 return false; 12313 } 12314 if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_rms", PS_DATA_F32, NULL, stamps_rms)) { 12315 psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_rms"); 12316 psFree(md); 12317 return false; 12318 } 12319 if (!psMetadataAdd(md, PS_LIST_TAIL, "sources", PS_DATA_S32, NULL, sources)) { 12320 psError(PS_ERR_UNKNOWN, false, "failed to add item sources"); 12160 12321 psFree(md); 12161 12322 return false; … … 12204 12365 bool diffSkyfileInsertObject(psDB *dbh, diffSkyfileRow *object) 12205 12366 { 12206 return diffSkyfileInsert(dbh, object->diff_id, object->uri, object->path_base, object->bg, object->bg_stdev, object-> dtime_diff, object->hostname, object->good_frac, object->fault);12367 return diffSkyfileInsert(dbh, object->diff_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->stamps_num, object->stamps_rms, object->sources, object->dtime_diff, object->hostname, object->good_frac, object->fault); 12207 12368 } 12208 12369 … … 12302 12463 return false; 12303 12464 } 12465 if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_num", PS_DATA_S32, NULL, object->stamps_num)) { 12466 psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_num"); 12467 psFree(md); 12468 return false; 12469 } 12470 if (!psMetadataAdd(md, PS_LIST_TAIL, "stamps_rms", PS_DATA_F32, NULL, object->stamps_rms)) { 12471 psError(PS_ERR_UNKNOWN, false, "failed to add item stamps_rms"); 12472 psFree(md); 12473 return false; 12474 } 12475 if (!psMetadataAdd(md, PS_LIST_TAIL, "sources", PS_DATA_S32, NULL, object->sources)) { 12476 psError(PS_ERR_UNKNOWN, false, "failed to add item sources"); 12477 psFree(md); 12478 return false; 12479 } 12304 12480 if (!psMetadataAdd(md, PS_LIST_TAIL, "dtime_diff", PS_DATA_F32, NULL, object->dtime_diff)) { 12305 12481 psError(PS_ERR_UNKNOWN, false, "failed to add item dtime_diff"); … … 12356 12532 return false; 12357 12533 } 12534 psS32 stamps_num = psMetadataLookupS32(&status, md, "stamps_num"); 12535 if (!status) { 12536 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stamps_num"); 12537 return false; 12538 } 12539 psF32 stamps_rms = psMetadataLookupF32(&status, md, "stamps_rms"); 12540 if (!status) { 12541 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stamps_rms"); 12542 return false; 12543 } 12544 psS32 sources = psMetadataLookupS32(&status, md, "sources"); 12545 if (!status) { 12546 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item sources"); 12547 return false; 12548 } 12358 12549 psF32 dtime_diff = psMetadataLookupF32(&status, md, "dtime_diff"); 12359 12550 if (!status) { … … 12377 12568 } 12378 12569 12379 return diffSkyfileRowAlloc(diff_id, uri, path_base, bg, bg_stdev, dtime_diff, hostname, good_frac, fault);12570 return diffSkyfileRowAlloc(diff_id, uri, path_base, bg, bg_stdev, stamps_num, stamps_rms, sources, dtime_diff, hostname, good_frac, fault); 12380 12571 } 12381 12572 psArray *diffSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) -
trunk/ippdb/src/ippdb.h
r17570 r17833 1668 1668 char *object; 1669 1669 psF32 solang; 1670 char *hostname; 1670 1671 psS16 fault; 1671 1672 } rawExpRow; … … 1732 1733 const char *object, 1733 1734 psF32 solang, 1735 const char *hostname, 1734 1736 psS16 fault 1735 1737 ); … … 1817 1819 const char *object, 1818 1820 psF32 solang, 1821 const char *hostname, 1819 1822 psS16 fault 1820 1823 ); … … 2024 2027 psF64 user_5; 2025 2028 char *object; 2029 char *hostname; 2026 2030 psS16 fault; 2027 2031 } rawImfileRow; … … 2084 2088 psF64 user_5, 2085 2089 const char *object, 2090 const char *hostname, 2086 2091 psS16 fault 2087 2092 ); … … 2165 2170 psF64 user_5, 2166 2171 const char *object, 2172 const char *hostname, 2167 2173 psS16 fault 2168 2174 ); … … 4371 4377 char *hostname; 4372 4378 psF32 good_frac; 4379 psS32 xmin; 4380 psS32 xmax; 4381 psS32 ymin; 4382 psS32 ymax; 4373 4383 bool ignored; 4374 4384 psS16 fault; … … 4391 4401 const char *hostname, 4392 4402 psF32 good_frac, 4403 psS32 xmin, 4404 psS32 xmax, 4405 psS32 ymin, 4406 psS32 ymax, 4393 4407 bool ignored, 4394 4408 psS16 fault … … 4432 4446 const char *hostname, 4433 4447 psF32 good_frac, 4448 psS32 xmin, 4449 psS32 xmax, 4450 psS32 ymin, 4451 psS32 ymax, 4434 4452 bool ignored, 4435 4453 psS16 fault … … 5215 5233 psF64 bg; 5216 5234 psF64 bg_stdev; 5235 psS32 stamps_num; 5236 psF32 stamps_rms; 5237 psS32 sources; 5217 5238 psF32 dtime_diff; 5218 5239 char *hostname; … … 5232 5253 psF64 bg, 5233 5254 psF64 bg_stdev, 5255 psS32 stamps_num, 5256 psF32 stamps_rms, 5257 psS32 sources, 5234 5258 psF32 dtime_diff, 5235 5259 const char *hostname, … … 5270 5294 psF64 bg, 5271 5295 psF64 bg_stdev, 5296 psS32 stamps_num, 5297 psF32 stamps_rms, 5298 psS32 sources, 5272 5299 psF32 dtime_diff, 5273 5300 const char *hostname, -
trunk/ippdb/tests/alloc.c
r17570 r17833 285 285 rawExpRow *object; 286 286 287 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, -16 );287 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16 ); 288 288 289 289 if (!object) { … … 510 510 exit(EXIT_FAILURE); 511 511 } 512 if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) { 513 psFree(object); 514 exit(EXIT_FAILURE); 515 } 512 516 if (!object->fault == -16) { 513 517 psFree(object); … … 521 525 rawImfileRow *object; 522 526 523 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16 );527 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16 ); 524 528 525 529 if (!object) { … … 730 734 exit(EXIT_FAILURE); 731 735 } 736 if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) { 737 psFree(object); 738 exit(EXIT_FAILURE); 739 } 732 740 if (!object->fault == -16) { 733 741 psFree(object); … … 1273 1281 warpSkyfileRow *object; 1274 1282 1275 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, true, -16 );1283 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -32, -32, -32, -32, true, -16 ); 1276 1284 1277 1285 if (!object) { … … 1319 1327 exit(EXIT_FAILURE); 1320 1328 } 1329 if (!object->xmin == -32) { 1330 psFree(object); 1331 exit(EXIT_FAILURE); 1332 } 1333 if (!object->xmax == -32) { 1334 psFree(object); 1335 exit(EXIT_FAILURE); 1336 } 1337 if (!object->ymin == -32) { 1338 psFree(object); 1339 exit(EXIT_FAILURE); 1340 } 1341 if (!object->ymax == -32) { 1342 psFree(object); 1343 exit(EXIT_FAILURE); 1344 } 1321 1345 if (!object->ignored == true) { 1322 1346 psFree(object); … … 1432 1456 diffSkyfileRow *object; 1433 1457 1434 object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -16 );1458 object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -32, 32.32, -32, 32.32, "a string", 32.32, -16 ); 1435 1459 1436 1460 if (!object) { … … 1455 1479 } 1456 1480 if (!object->bg_stdev == 64.64) { 1481 psFree(object); 1482 exit(EXIT_FAILURE); 1483 } 1484 if (!object->stamps_num == -32) { 1485 psFree(object); 1486 exit(EXIT_FAILURE); 1487 } 1488 if (!object->stamps_rms == 32.32) { 1489 psFree(object); 1490 exit(EXIT_FAILURE); 1491 } 1492 if (!object->sources == -32) { 1457 1493 psFree(object); 1458 1494 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r17570 r17833 118 118 } 119 119 120 if (!rawExpInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, -16)) {121 exit(EXIT_FAILURE); 122 } 123 124 psDBCleanup(dbh); 125 } 126 127 { 128 psDB *dbh; 129 130 dbh = psDBInit("localhost", "test", NULL, "test"); 131 if (!dbh) { 132 exit(EXIT_FAILURE); 133 } 134 135 if (!rawImfileInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16)) {120 if (!rawExpInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16)) { 121 exit(EXIT_FAILURE); 122 } 123 124 psDBCleanup(dbh); 125 } 126 127 { 128 psDB *dbh; 129 130 dbh = psDBInit("localhost", "test", NULL, "test"); 131 if (!dbh) { 132 exit(EXIT_FAILURE); 133 } 134 135 if (!rawImfileInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16)) { 136 136 exit(EXIT_FAILURE); 137 137 } … … 283 283 } 284 284 285 if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, true, -16)) {285 if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -32, -32, -32, -32, true, -16)) { 286 286 exit(EXIT_FAILURE); 287 287 } … … 343 343 } 344 344 345 if (!diffSkyfileInsert(dbh, -64, "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -16)) {345 if (!diffSkyfileInsert(dbh, -64, "a string", "a string", 64.64, 64.64, -32, 32.32, -32, 32.32, "a string", 32.32, -16)) { 346 346 exit(EXIT_FAILURE); 347 347 } -
trunk/ippdb/tests/insertobject.c
r17570 r17833 168 168 } 169 169 170 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, -16);170 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16); 171 171 if (!object) { 172 172 exit(EXIT_FAILURE); … … 190 190 } 191 191 192 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16);192 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16); 193 193 if (!object) { 194 194 exit(EXIT_FAILURE); … … 410 410 } 411 411 412 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, true, -16);412 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -32, -32, -32, -32, true, -16); 413 413 if (!object) { 414 414 exit(EXIT_FAILURE); … … 498 498 } 499 499 500 object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -16);500 object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -32, 32.32, -32, 32.32, "a string", 32.32, -16); 501 501 if (!object) { 502 502 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r17570 r17833 339 339 bool status; 340 340 341 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, -16);341 object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16); 342 342 if (!object) { 343 343 exit(EXIT_FAILURE); … … 569 569 exit(EXIT_FAILURE); 570 570 } 571 if (strncmp(psMetadataLookupPtr(&status, md, "hostname"), "a string", MAX_STRING_LENGTH)) { 572 psFree(md); 573 exit(EXIT_FAILURE); 574 } 571 575 psFree(md); 572 576 exit(EXIT_FAILURE); … … 581 585 bool status; 582 586 583 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", -16);587 object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16); 584 588 if (!object) { 585 589 exit(EXIT_FAILURE); … … 795 799 exit(EXIT_FAILURE); 796 800 } 801 if (strncmp(psMetadataLookupPtr(&status, md, "hostname"), "a string", MAX_STRING_LENGTH)) { 802 psFree(md); 803 exit(EXIT_FAILURE); 804 } 797 805 psFree(md); 798 806 exit(EXIT_FAILURE); … … 1394 1402 bool status; 1395 1403 1396 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, true, -16);1404 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -32, -32, -32, -32, true, -16); 1397 1405 if (!object) { 1398 1406 exit(EXIT_FAILURE); … … 1445 1453 exit(EXIT_FAILURE); 1446 1454 } 1455 if (!psMetadataLookupS32(&status, md, "xmin") == -32) { 1456 psFree(md); 1457 exit(EXIT_FAILURE); 1458 } 1459 if (!psMetadataLookupS32(&status, md, "xmax") == -32) { 1460 psFree(md); 1461 exit(EXIT_FAILURE); 1462 } 1463 if (!psMetadataLookupS32(&status, md, "ymin") == -32) { 1464 psFree(md); 1465 exit(EXIT_FAILURE); 1466 } 1467 if (!psMetadataLookupS32(&status, md, "ymax") == -32) { 1468 psFree(md); 1469 exit(EXIT_FAILURE); 1470 } 1447 1471 if (!psMetadataLookupBool(&status, md, "ignored") == true) { 1448 1472 psFree(md); … … 1579 1603 bool status; 1580 1604 1581 object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, 32.32, "a string", 32.32, -16);1605 object = diffSkyfileRowAlloc(-64, "a string", "a string", 64.64, 64.64, -32, 32.32, -32, 32.32, "a string", 32.32, -16); 1582 1606 if (!object) { 1583 1607 exit(EXIT_FAILURE); … … 1607 1631 } 1608 1632 if (!psMetadataLookupF64(&status, md, "bg_stdev") == 64.64) { 1633 psFree(md); 1634 exit(EXIT_FAILURE); 1635 } 1636 if (!psMetadataLookupS32(&status, md, "stamps_num") == -32) { 1637 psFree(md); 1638 exit(EXIT_FAILURE); 1639 } 1640 if (!psMetadataLookupF32(&status, md, "stamps_rms") == 32.32) { 1641 psFree(md); 1642 exit(EXIT_FAILURE); 1643 } 1644 if (!psMetadataLookupS32(&status, md, "sources") == -32) { 1609 1645 psFree(md); 1610 1646 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r17570 r17833 715 715 exit(EXIT_FAILURE); 716 716 } 717 if (!psMetadataAddStr(md, PS_LIST_TAIL, "hostname", 0, NULL, "a string")) { 718 psFree(md); 719 exit(EXIT_FAILURE); 720 } 717 721 psFree(md); 718 722 exit(EXIT_FAILURE); … … 942 946 } 943 947 if (!object->solang == 32.32) { 948 psFree(object); 949 exit(EXIT_FAILURE); 950 } 951 if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) { 944 952 psFree(object); 945 953 exit(EXIT_FAILURE); … … 1159 1167 exit(EXIT_FAILURE); 1160 1168 } 1169 if (!psMetadataAddStr(md, PS_LIST_TAIL, "hostname", 0, NULL, "a string")) { 1170 psFree(md); 1171 exit(EXIT_FAILURE); 1172 } 1161 1173 psFree(md); 1162 1174 exit(EXIT_FAILURE); … … 1370 1382 } 1371 1383 if (strncmp(object->object, "a string", MAX_STRING_LENGTH)) { 1384 psFree(object); 1385 exit(EXIT_FAILURE); 1386 } 1387 if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) { 1372 1388 psFree(object); 1373 1389 exit(EXIT_FAILURE); … … 2382 2398 exit(EXIT_FAILURE); 2383 2399 } 2400 if (!psMetadataAddS32(md, PS_LIST_TAIL, "xmin", 0, NULL, -32)) { 2401 psFree(md); 2402 exit(EXIT_FAILURE); 2403 } 2404 if (!psMetadataAddS32(md, PS_LIST_TAIL, "xmax", 0, NULL, -32)) { 2405 psFree(md); 2406 exit(EXIT_FAILURE); 2407 } 2408 if (!psMetadataAddS32(md, PS_LIST_TAIL, "ymin", 0, NULL, -32)) { 2409 psFree(md); 2410 exit(EXIT_FAILURE); 2411 } 2412 if (!psMetadataAddS32(md, PS_LIST_TAIL, "ymax", 0, NULL, -32)) { 2413 psFree(md); 2414 exit(EXIT_FAILURE); 2415 } 2384 2416 if (!psMetadataAdd(md, PS_LIST_TAIL, "ignored", PS_DATA_BOOL, NULL, true)) { 2385 2417 psFree(md); … … 2434 2466 } 2435 2467 if (!object->good_frac == 32.32) { 2468 psFree(object); 2469 exit(EXIT_FAILURE); 2470 } 2471 if (!object->xmin == -32) { 2472 psFree(object); 2473 exit(EXIT_FAILURE); 2474 } 2475 if (!object->xmax == -32) { 2476 psFree(object); 2477 exit(EXIT_FAILURE); 2478 } 2479 if (!object->ymin == -32) { 2480 psFree(object); 2481 exit(EXIT_FAILURE); 2482 } 2483 if (!object->ymax == -32) { 2436 2484 psFree(object); 2437 2485 exit(EXIT_FAILURE); … … 2636 2684 exit(EXIT_FAILURE); 2637 2685 } 2686 if (!psMetadataAddS32(md, PS_LIST_TAIL, "stamps_num", 0, NULL, -32)) { 2687 psFree(md); 2688 exit(EXIT_FAILURE); 2689 } 2690 if (!psMetadataAddF32(md, PS_LIST_TAIL, "stamps_rms", 0, NULL, 32.32)) { 2691 psFree(md); 2692 exit(EXIT_FAILURE); 2693 } 2694 if (!psMetadataAddS32(md, PS_LIST_TAIL, "sources", 0, NULL, -32)) { 2695 psFree(md); 2696 exit(EXIT_FAILURE); 2697 } 2638 2698 if (!psMetadataAddF32(md, PS_LIST_TAIL, "dtime_diff", 0, NULL, 32.32)) { 2639 2699 psFree(md); … … 2676 2736 } 2677 2737 if (!object->bg_stdev == 64.64) { 2738 psFree(object); 2739 exit(EXIT_FAILURE); 2740 } 2741 if (!object->stamps_num == -32) { 2742 psFree(object); 2743 exit(EXIT_FAILURE); 2744 } 2745 if (!object->stamps_rms == 32.32) { 2746 psFree(object); 2747 exit(EXIT_FAILURE); 2748 } 2749 if (!object->sources == -32) { 2678 2750 psFree(object); 2679 2751 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
