IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16177


Ignore:
Timestamp:
Jan 22, 2008, 10:30:49 AM (18 years ago)
Author:
jhoblitt
Message:

update

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/scripts/dettest.sh

    r16170 r16177  
    55det_id=1
    66
    7 ./regtest.sh -detrend || exit 1
     7./regtest.sh -end_stage reg || exit 1
    88
    99det_id=`dettool -definebyquery -det_type bias -inst gpc -filelevel fpa -select_exp_type bias -airmass_min 1 -airmass_max 10 -exp_time_min 10 -exp_time_max 30.0 -workdir file::///some/path -simple | cut -f1 -d" "` || exit 1
  • trunk/ippdb/src/ippdb.c

    r16154 r16177  
    28572857static void newExpRowFree(newExpRow *object);
    28582858
    2859 newExpRow *newExpRowAlloc(psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction)
     2859newExpRow *newExpRowAlloc(psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage)
    28602860{
    28612861    newExpRow       *_object;
     
    28722872    _object->workdir_state = psStringCopy(workdir_state);
    28732873    _object->reduction = psStringCopy(reduction);
     2874    _object->dvodb = psStringCopy(dvodb);
     2875    _object->tess_id = psStringCopy(tess_id);
     2876    _object->end_stage = psStringCopy(end_stage);
    28742877
    28752878    return _object;
     
    28852888    psFree(object->workdir_state);
    28862889    psFree(object->reduction);
     2890    psFree(object->dvodb);
     2891    psFree(object->tess_id);
     2892    psFree(object->end_stage);
    28872893}
    28882894
     
    29302936        return false;
    29312937    }
     2938    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, "255")) {
     2939        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     2940        psFree(md);
     2941        return false;
     2942    }
     2943    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, "64")) {
     2944        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     2945        psFree(md);
     2946        return false;
     2947    }
     2948    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, "Key", "64")) {
     2949        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
     2950        psFree(md);
     2951        return false;
     2952    }
    29322953
    29332954    bool status = psDBCreateTable(dbh, NEWEXP_TABLE_NAME, md);
     
    29432964}
    29442965
    2945 bool newExpInsert(psDB * dbh, psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction)
     2966bool newExpInsert(psDB * dbh, psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage)
    29462967{
    29472968    psMetadata *md = psMetadataAlloc();
     
    29833004    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) {
    29843005        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
     3006        psFree(md);
     3007        return false;
     3008    }
     3009    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, dvodb)) {
     3010        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     3011        psFree(md);
     3012        return false;
     3013    }
     3014    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, tess_id)) {
     3015        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     3016        psFree(md);
     3017        return false;
     3018    }
     3019    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, NULL, end_stage)) {
     3020        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
    29853021        psFree(md);
    29863022        return false;
     
    30093045bool newExpInsertObject(psDB *dbh, newExpRow *object)
    30103046{
    3011     return newExpInsert(dbh, object->exp_id, object->tmp_exp_name, object->tmp_camera, object->tmp_telescope, object->state, object->workdir, object->workdir_state, object->reduction);
     3047    return newExpInsert(dbh, object->exp_id, object->tmp_exp_name, object->tmp_camera, object->tmp_telescope, object->state, object->workdir, object->workdir_state, object->reduction, object->dvodb, object->tess_id, object->end_stage);
    30123048}
    30133049
     
    31223158        return false;
    31233159    }
     3160    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, object->dvodb)) {
     3161        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     3162        psFree(md);
     3163        return false;
     3164    }
     3165    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, object->tess_id)) {
     3166        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     3167        psFree(md);
     3168        return false;
     3169    }
     3170    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, NULL, object->end_stage)) {
     3171        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
     3172        psFree(md);
     3173        return false;
     3174    }
    31243175
    31253176
     
    31713222        return false;
    31723223    }
    3173 
    3174     return newExpRowAlloc(exp_id, tmp_exp_name, tmp_camera, tmp_telescope, state, workdir, workdir_state, reduction);
     3224    char* dvodb = psMetadataLookupPtr(&status, md, "dvodb");
     3225    if (!status) {
     3226        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item dvodb");
     3227        return false;
     3228    }
     3229    char* tess_id = psMetadataLookupPtr(&status, md, "tess_id");
     3230    if (!status) {
     3231        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item tess_id");
     3232        return false;
     3233    }
     3234    char* end_stage = psMetadataLookupPtr(&status, md, "end_stage");
     3235    if (!status) {
     3236        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item end_stage");
     3237        return false;
     3238    }
     3239
     3240    return newExpRowAlloc(exp_id, tmp_exp_name, tmp_camera, tmp_telescope, state, workdir, workdir_state, reduction, dvodb, tess_id, end_stage);
    31753241}
    31763242psArray *newExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    36133679static void rawExpRowFree(rawExpRow *object);
    36143680
    3615 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 *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)
     3681rawExpRow *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)
    36163682{
    36173683    rawExpRow       *_object;
     
    36303696    _object->workdir = psStringCopy(workdir);
    36313697    _object->reduction = psStringCopy(reduction);
     3698    _object->dvodb = psStringCopy(dvodb);
     3699    _object->tess_id = psStringCopy(tess_id);
     3700    _object->end_stage = psStringCopy(end_stage);
    36323701    _object->filter = psStringCopy(filter);
    36333702    _object->comment = psStringCopy(comment);
     
    36883757    psFree(object->workdir);
    36893758    psFree(object->reduction);
     3759    psFree(object->dvodb);
     3760    psFree(object->tess_id);
     3761    psFree(object->end_stage);
    36903762    psFree(object->filter);
    36913763    psFree(object->comment);
     
    37463818        return false;
    37473819    }
     3820    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, "255")) {
     3821        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     3822        psFree(md);
     3823        return false;
     3824    }
     3825    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, "64")) {
     3826        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     3827        psFree(md);
     3828        return false;
     3829    }
     3830    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, "Key", "64")) {
     3831        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
     3832        psFree(md);
     3833        return false;
     3834    }
    37483835    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "64")) {
    37493836        psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
     
    39744061}
    39754062
    3976 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 *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)
     4063bool 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)
    39774064{
    39784065    psMetadata *md = psMetadataAlloc();
     
    40244111    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) {
    40254112        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
     4113        psFree(md);
     4114        return false;
     4115    }
     4116    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, dvodb)) {
     4117        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     4118        psFree(md);
     4119        return false;
     4120    }
     4121    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, tess_id)) {
     4122        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     4123        psFree(md);
     4124        return false;
     4125    }
     4126    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, NULL, end_stage)) {
     4127        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
    40264128        psFree(md);
    40274129        return false;
     
    42654367bool rawExpInsertObject(psDB *dbh, rawExpRow *object)
    42664368{
    4267     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->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);
     4369    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);
    42684370}
    42694371
     
    43884490        return false;
    43894491    }
     4492    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, object->dvodb)) {
     4493        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     4494        psFree(md);
     4495        return false;
     4496    }
     4497    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, object->tess_id)) {
     4498        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     4499        psFree(md);
     4500        return false;
     4501    }
     4502    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, NULL, object->end_stage)) {
     4503        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
     4504        psFree(md);
     4505        return false;
     4506    }
    43904507    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, object->filter)) {
    43914508        psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
     
    46624779        return false;
    46634780    }
     4781    char* dvodb = psMetadataLookupPtr(&status, md, "dvodb");
     4782    if (!status) {
     4783        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item dvodb");
     4784        return false;
     4785    }
     4786    char* tess_id = psMetadataLookupPtr(&status, md, "tess_id");
     4787    if (!status) {
     4788        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item tess_id");
     4789        return false;
     4790    }
     4791    char* end_stage = psMetadataLookupPtr(&status, md, "end_stage");
     4792    if (!status) {
     4793        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item end_stage");
     4794        return false;
     4795    }
    46644796    char* filter = psMetadataLookupPtr(&status, md, "filter");
    46654797    if (!status) {
     
    48785010    }
    48795011
    4880     return rawExpRowAlloc(exp_id, exp_name, camera, telescope, dateobs, exp_tag, exp_type, filelevel, workdir, reduction, 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);
     5012    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);
    48815013}
    48825014psArray *rawExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    66806812static void chipRunRowFree(chipRunRow *object);
    66816813
    6682 chipRunRow *chipRunRowAlloc(psS64 chip_id, psS64 exp_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb)
     6814chipRunRow *chipRunRowAlloc(psS64 chip_id, psS64 exp_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb, const char *tess_id, const char *end_stage)
    66836815{
    66846816    chipRunRow      *_object;
     
    66966828    _object->expgroup = psStringCopy(expgroup);
    66976829    _object->dvodb = psStringCopy(dvodb);
     6830    _object->tess_id = psStringCopy(tess_id);
     6831    _object->end_stage = psStringCopy(end_stage);
    66986832
    66996833    return _object;
     
    67096843    psFree(object->expgroup);
    67106844    psFree(object->dvodb);
     6845    psFree(object->tess_id);
     6846    psFree(object->end_stage);
    67116847}
    67126848
     
    67596895        return false;
    67606896    }
     6897    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, "64")) {
     6898        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     6899        psFree(md);
     6900        return false;
     6901    }
     6902    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, "Key", "64")) {
     6903        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
     6904        psFree(md);
     6905        return false;
     6906    }
    67616907
    67626908    bool status = psDBCreateTable(dbh, CHIPRUN_TABLE_NAME, md);
     
    67726918}
    67736919
    6774 bool chipRunInsert(psDB * dbh, psS64 chip_id, psS64 exp_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb)
     6920bool chipRunInsert(psDB * dbh, psS64 chip_id, psS64 exp_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb, const char *tess_id, const char *end_stage)
    67756921{
    67766922    psMetadata *md = psMetadataAlloc();
     
    68176963    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, dvodb)) {
    68186964        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     6965        psFree(md);
     6966        return false;
     6967    }
     6968    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, tess_id)) {
     6969        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     6970        psFree(md);
     6971        return false;
     6972    }
     6973    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, NULL, end_stage)) {
     6974        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
    68196975        psFree(md);
    68206976        return false;
     
    68436999bool chipRunInsertObject(psDB *dbh, chipRunRow *object)
    68447000{
    6845     return chipRunInsert(dbh, object->chip_id, object->exp_id, object->state, object->workdir, object->workdir_state, object->label, object->reduction, object->expgroup, object->dvodb);
     7001    return chipRunInsert(dbh, object->chip_id, object->exp_id, object->state, object->workdir, object->workdir_state, object->label, object->reduction, object->expgroup, object->dvodb, object->tess_id, object->end_stage);
    68467002}
    68477003
     
    69617117        return false;
    69627118    }
     7119    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, object->tess_id)) {
     7120        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     7121        psFree(md);
     7122        return false;
     7123    }
     7124    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, NULL, object->end_stage)) {
     7125        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
     7126        psFree(md);
     7127        return false;
     7128    }
    69637129
    69647130
     
    70157181        return false;
    70167182    }
    7017 
    7018     return chipRunRowAlloc(chip_id, exp_id, state, workdir, workdir_state, label, reduction, expgroup, dvodb);
     7183    char* tess_id = psMetadataLookupPtr(&status, md, "tess_id");
     7184    if (!status) {
     7185        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item tess_id");
     7186        return false;
     7187    }
     7188    char* end_stage = psMetadataLookupPtr(&status, md, "end_stage");
     7189    if (!status) {
     7190        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item end_stage");
     7191        return false;
     7192    }
     7193
     7194    return chipRunRowAlloc(chip_id, exp_id, state, workdir, workdir_state, label, reduction, expgroup, dvodb, tess_id, end_stage);
    70197195}
    70207196psArray *chipRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    81798355static void camRunRowFree(camRunRow *object);
    81808356
    8181 camRunRow *camRunRowAlloc(psS64 cam_id, psS64 chip_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb)
     8357camRunRow *camRunRowAlloc(psS64 cam_id, psS64 chip_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb, const char *tess_id, const char *end_stage)
    81828358{
    81838359    camRunRow       *_object;
     
    81958371    _object->expgroup = psStringCopy(expgroup);
    81968372    _object->dvodb = psStringCopy(dvodb);
     8373    _object->tess_id = psStringCopy(tess_id);
     8374    _object->end_stage = psStringCopy(end_stage);
    81978375
    81988376    return _object;
     
    82088386    psFree(object->expgroup);
    82098387    psFree(object->dvodb);
     8388    psFree(object->tess_id);
     8389    psFree(object->end_stage);
    82108390}
    82118391
     
    82588438        return false;
    82598439    }
     8440    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, "64")) {
     8441        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     8442        psFree(md);
     8443        return false;
     8444    }
     8445    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, "Key", "64")) {
     8446        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
     8447        psFree(md);
     8448        return false;
     8449    }
    82608450
    82618451    bool status = psDBCreateTable(dbh, CAMRUN_TABLE_NAME, md);
     
    82718461}
    82728462
    8273 bool camRunInsert(psDB * dbh, psS64 cam_id, psS64 chip_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb)
     8463bool camRunInsert(psDB * dbh, psS64 cam_id, psS64 chip_id, const char *state, const char *workdir, const char *workdir_state, const char *label, const char *reduction, const char *expgroup, const char *dvodb, const char *tess_id, const char *end_stage)
    82748464{
    82758465    psMetadata *md = psMetadataAlloc();
     
    83168506    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, dvodb)) {
    83178507        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     8508        psFree(md);
     8509        return false;
     8510    }
     8511    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, tess_id)) {
     8512        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     8513        psFree(md);
     8514        return false;
     8515    }
     8516    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, NULL, end_stage)) {
     8517        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
    83188518        psFree(md);
    83198519        return false;
     
    83428542bool camRunInsertObject(psDB *dbh, camRunRow *object)
    83438543{
    8344     return camRunInsert(dbh, object->cam_id, object->chip_id, object->state, object->workdir, object->workdir_state, object->label, object->reduction, object->expgroup, object->dvodb);
     8544    return camRunInsert(dbh, object->cam_id, object->chip_id, object->state, object->workdir, object->workdir_state, object->label, object->reduction, object->expgroup, object->dvodb, object->tess_id, object->end_stage);
    83458545}
    83468546
     
    84608660        return false;
    84618661    }
     8662    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, object->tess_id)) {
     8663        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     8664        psFree(md);
     8665        return false;
     8666    }
     8667    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, NULL, object->end_stage)) {
     8668        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
     8669        psFree(md);
     8670        return false;
     8671    }
    84628672
    84638673
     
    85148724        return false;
    85158725    }
    8516 
    8517     return camRunRowAlloc(cam_id, chip_id, state, workdir, workdir_state, label, reduction, expgroup, dvodb);
     8726    char* tess_id = psMetadataLookupPtr(&status, md, "tess_id");
     8727    if (!status) {
     8728        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item tess_id");
     8729        return false;
     8730    }
     8731    char* end_stage = psMetadataLookupPtr(&status, md, "end_stage");
     8732    if (!status) {
     8733        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item end_stage");
     8734        return false;
     8735    }
     8736
     8737    return camRunRowAlloc(cam_id, chip_id, state, workdir, workdir_state, label, reduction, expgroup, dvodb, tess_id, end_stage);
    85188738}
    85198739psArray *camRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    95519771static void warpRunRowFree(warpRunRow *object);
    95529772
    9553 warpRunRow *warpRunRowAlloc(psS64 warp_id, const char *mode, const char *state, const char *workdir, const char *dvodb, psTime* registered)
     9773warpRunRow *warpRunRowAlloc(psS64 warp_id, const char *mode, const char *state, const char *workdir, const char *workdir_state, const char *dvodb, const char *tess_id, const char *end_stage, psTime* registered)
    95549774{
    95559775    warpRunRow      *_object;
     
    95629782    _object->state = psStringCopy(state);
    95639783    _object->workdir = psStringCopy(workdir);
     9784    _object->workdir_state = psStringCopy(workdir_state);
    95649785    _object->dvodb = psStringCopy(dvodb);
     9786    _object->tess_id = psStringCopy(tess_id);
     9787    _object->end_stage = psStringCopy(end_stage);
    95659788    _object->registered = psTimeCopy(registered);
    95669789
     
    95739796    psFree(object->state);
    95749797    psFree(object->workdir);
     9798    psFree(object->workdir_state);
    95759799    psFree(object->dvodb);
     9800    psFree(object->tess_id);
     9801    psFree(object->end_stage);
    95769802    psFree(object->registered);
    95779803}
     
    96009826        return false;
    96019827    }
     9828    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, "Key", "64")) {
     9829        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir_state");
     9830        psFree(md);
     9831        return false;
     9832    }
    96029833    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, "255")) {
    96039834        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     
    96059836        return false;
    96069837    }
     9838    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, "64")) {
     9839        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     9840        psFree(md);
     9841        return false;
     9842    }
     9843    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, "Key", "64")) {
     9844        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
     9845        psFree(md);
     9846        return false;
     9847    }
    96079848    if (!psMetadataAdd(md, PS_LIST_TAIL, "registered", PS_DATA_TIME, NULL, NULL)) {
    96089849        psError(PS_ERR_UNKNOWN, false, "failed to add item registered");
     
    96239864}
    96249865
    9625 bool warpRunInsert(psDB * dbh, psS64 warp_id, const char *mode, const char *state, const char *workdir, const char *dvodb, psTime* registered)
     9866bool warpRunInsert(psDB * dbh, psS64 warp_id, const char *mode, const char *state, const char *workdir, const char *workdir_state, const char *dvodb, const char *tess_id, const char *end_stage, psTime* registered)
    96269867{
    96279868    psMetadata *md = psMetadataAlloc();
     
    96469887        return false;
    96479888    }
     9889    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, NULL, workdir_state)) {
     9890        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir_state");
     9891        psFree(md);
     9892        return false;
     9893    }
    96489894    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, dvodb)) {
    96499895        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     9896        psFree(md);
     9897        return false;
     9898    }
     9899    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, tess_id)) {
     9900        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     9901        psFree(md);
     9902        return false;
     9903    }
     9904    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, NULL, end_stage)) {
     9905        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
    96509906        psFree(md);
    96519907        return false;
     
    96799935bool warpRunInsertObject(psDB *dbh, warpRunRow *object)
    96809936{
    9681     return warpRunInsert(dbh, object->warp_id, object->mode, object->state, object->workdir, object->dvodb, object->registered);
     9937    return warpRunInsert(dbh, object->warp_id, object->mode, object->state, object->workdir, object->workdir_state, object->dvodb, object->tess_id, object->end_stage, object->registered);
    96829938}
    96839939
     
    977210028        return false;
    977310029    }
     10030    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir_state", PS_DATA_STRING, NULL, object->workdir_state)) {
     10031        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir_state");
     10032        psFree(md);
     10033        return false;
     10034    }
    977410035    if (!psMetadataAdd(md, PS_LIST_TAIL, "dvodb", PS_DATA_STRING, NULL, object->dvodb)) {
    977510036        psError(PS_ERR_UNKNOWN, false, "failed to add item dvodb");
     
    977710038        return false;
    977810039    }
     10040    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, NULL, object->tess_id)) {
     10041        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
     10042        psFree(md);
     10043        return false;
     10044    }
     10045    if (!psMetadataAdd(md, PS_LIST_TAIL, "end_stage", PS_DATA_STRING, NULL, object->end_stage)) {
     10046        psError(PS_ERR_UNKNOWN, false, "failed to add item end_stage");
     10047        psFree(md);
     10048        return false;
     10049    }
    977910050    if (!psMetadataAdd(md, PS_LIST_TAIL, "registered", PS_DATA_TIME, NULL, object->registered)) {
    978010051        psError(PS_ERR_UNKNOWN, false, "failed to add item registered");
     
    981110082        return false;
    981210083    }
     10084    char* workdir_state = psMetadataLookupPtr(&status, md, "workdir_state");
     10085    if (!status) {
     10086        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item workdir_state");
     10087        return false;
     10088    }
    981310089    char* dvodb = psMetadataLookupPtr(&status, md, "dvodb");
    981410090    if (!status) {
     
    981610092        return false;
    981710093    }
     10094    char* tess_id = psMetadataLookupPtr(&status, md, "tess_id");
     10095    if (!status) {
     10096        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item tess_id");
     10097        return false;
     10098    }
     10099    char* end_stage = psMetadataLookupPtr(&status, md, "end_stage");
     10100    if (!status) {
     10101        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item end_stage");
     10102        return false;
     10103    }
    981810104    psTime* registered = psMetadataLookupPtr(&status, md, "registered");
    981910105    if (!status) {
     
    982210108    }
    982310109
    9824     return warpRunRowAlloc(warp_id, mode, state, workdir, dvodb, registered);
     10110    return warpRunRowAlloc(warp_id, mode, state, workdir, workdir_state, dvodb, tess_id, end_stage, registered);
    982510111}
    982610112psArray *warpRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r16154 r16177  
    15911591    char            *workdir_state;
    15921592    char            *reduction;
     1593    char            *dvodb;
     1594    char            *tess_id;
     1595    char            *end_stage;
    15931596} newExpRow;
    15941597
     
    16061609    const char      *workdir,
    16071610    const char      *workdir_state,
    1608     const char      *reduction
     1611    const char      *reduction,
     1612    const char      *dvodb,
     1613    const char      *tess_id,
     1614    const char      *end_stage
    16091615);
    16101616
     
    16431649    const char      *workdir,
    16441650    const char      *workdir_state,
    1645     const char      *reduction
     1651    const char      *reduction,
     1652    const char      *dvodb,
     1653    const char      *tess_id,
     1654    const char      *end_stage
    16461655);
    16471656
     
    20102019    char            *workdir;
    20112020    char            *reduction;
     2021    char            *dvodb;
     2022    char            *tess_id;
     2023    char            *end_stage;
    20122024    char            *filter;
    20132025    char            *comment;
     
    20712083    const char      *workdir,
    20722084    const char      *reduction,
     2085    const char      *dvodb,
     2086    const char      *tess_id,
     2087    const char      *end_stage,
    20732088    const char      *filter,
    20742089    const char      *comment,
     
    21532168    const char      *workdir,
    21542169    const char      *reduction,
     2170    const char      *dvodb,
     2171    const char      *tess_id,
     2172    const char      *end_stage,
    21552173    const char      *filter,
    21562174    const char      *comment,
     
    29092927    char            *expgroup;
    29102928    char            *dvodb;
     2929    char            *tess_id;
     2930    char            *end_stage;
    29112931} chipRunRow;
    29122932
     
    29252945    const char      *reduction,
    29262946    const char      *expgroup,
    2927     const char      *dvodb
     2947    const char      *dvodb,
     2948    const char      *tess_id,
     2949    const char      *end_stage
    29282950);
    29292951
     
    29632985    const char      *reduction,
    29642986    const char      *expgroup,
    2965     const char      *dvodb
     2987    const char      *dvodb,
     2988    const char      *tess_id,
     2989    const char      *end_stage
    29662990);
    29672991
     
    35873611    char            *expgroup;
    35883612    char            *dvodb;
     3613    char            *tess_id;
     3614    char            *end_stage;
    35893615} camRunRow;
    35903616
     
    36033629    const char      *reduction,
    36043630    const char      *expgroup,
    3605     const char      *dvodb
     3631    const char      *dvodb,
     3632    const char      *tess_id,
     3633    const char      *end_stage
    36063634);
    36073635
     
    36413669    const char      *reduction,
    36423670    const char      *expgroup,
    3643     const char      *dvodb
     3671    const char      *dvodb,
     3672    const char      *tess_id,
     3673    const char      *end_stage
    36443674);
    36453675
     
    42424272    char            *state;
    42434273    char            *workdir;
     4274    char            *workdir_state;
    42444275    char            *dvodb;
     4276    char            *tess_id;
     4277    char            *end_stage;
    42454278    psTime*         registered;
    42464279} warpRunRow;
     
    42564289    const char      *state,
    42574290    const char      *workdir,
     4291    const char      *workdir_state,
    42584292    const char      *dvodb,
     4293    const char      *tess_id,
     4294    const char      *end_stage,
    42594295    psTime*         registered
    42604296);
     
    42914327    const char      *state,
    42924328    const char      *workdir,
     4329    const char      *workdir_state,
    42934330    const char      *dvodb,
     4331    const char      *tess_id,
     4332    const char      *end_stage,
    42944333    psTime*         registered
    42954334);
  • trunk/ippdb/tests/alloc.c

    r15792 r16177  
    245245        newExpRow       *object;
    246246
    247         object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
     247        object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
    248248
    249249        if (!object) {
     
    283283            exit(EXIT_FAILURE);
    284284        }
     285        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     286            psFree(object);
     287            exit(EXIT_FAILURE);
     288        }
     289        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     290            psFree(object);
     291            exit(EXIT_FAILURE);
     292        }
     293        if (strncmp(object->end_stage, "a string", MAX_STRING_LENGTH)) {
     294            psFree(object);
     295            exit(EXIT_FAILURE);
     296        }
    285297
    286298        psFree(object);
     
    315327        rawExpRow       *object;
    316328
    317         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", 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    );
     329        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    );
    318330
    319331        if (!object) {
     
    360372            exit(EXIT_FAILURE);
    361373        }
     374        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     375            psFree(object);
     376            exit(EXIT_FAILURE);
     377        }
     378        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     379            psFree(object);
     380            exit(EXIT_FAILURE);
     381        }
     382        if (strncmp(object->end_stage, "a string", MAX_STRING_LENGTH)) {
     383            psFree(object);
     384            exit(EXIT_FAILURE);
     385        }
    362386        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
    363387            psFree(object);
     
    784808        chipRunRow      *object;
    785809
    786         object = chipRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
     810        object = chipRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
    787811
    788812        if (!object) {
     
    826850            exit(EXIT_FAILURE);
    827851        }
     852        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     853            psFree(object);
     854            exit(EXIT_FAILURE);
     855        }
     856        if (strncmp(object->end_stage, "a string", MAX_STRING_LENGTH)) {
     857            psFree(object);
     858            exit(EXIT_FAILURE);
     859        }
    828860
    829861        psFree(object);
     
    959991        camRunRow       *object;
    960992
    961         object = camRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
     993        object = camRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
    962994
    963995        if (!object) {
     
    10011033            exit(EXIT_FAILURE);
    10021034        }
     1035        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     1036            psFree(object);
     1037            exit(EXIT_FAILURE);
     1038        }
     1039        if (strncmp(object->end_stage, "a string", MAX_STRING_LENGTH)) {
     1040            psFree(object);
     1041            exit(EXIT_FAILURE);
     1042        }
    10031043
    10041044        psFree(object);
     
    11101150        warpRunRow      *object;
    11111151
    1112         object = warpRunRowAlloc(-64, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
     1152        object = warpRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
    11131153
    11141154        if (!object) {
     
    11321172            exit(EXIT_FAILURE);
    11331173        }
     1174        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
     1175            psFree(object);
     1176            exit(EXIT_FAILURE);
     1177        }
    11341178        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     1179            psFree(object);
     1180            exit(EXIT_FAILURE);
     1181        }
     1182        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     1183            psFree(object);
     1184            exit(EXIT_FAILURE);
     1185        }
     1186        if (strncmp(object->end_stage, "a string", MAX_STRING_LENGTH)) {
    11351187            psFree(object);
    11361188            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r15792 r16177  
    118118        }
    119119
    120         if (!newExpInsert(dbh, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string")) {
     120        if (!newExpInsert(dbh, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string")) {
    121121            exit(EXIT_FAILURE);
    122122        }
     
    148148        }
    149149
    150         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", 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)) {
     150        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)) {
    151151            exit(EXIT_FAILURE);
    152152        }
     
    193193        }
    194194
    195         if (!chipRunInsert(dbh, -64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string")) {
     195        if (!chipRunInsert(dbh, -64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string")) {
    196196            exit(EXIT_FAILURE);
    197197        }
     
    238238        }
    239239
    240         if (!camRunInsert(dbh, -64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string")) {
     240        if (!camRunInsert(dbh, -64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string")) {
    241241            exit(EXIT_FAILURE);
    242242        }
     
    283283        }
    284284
    285         if (!warpRunInsert(dbh, -64, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z")) {
     285        if (!warpRunInsert(dbh, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z")) {
    286286            exit(EXIT_FAILURE);
    287287        }
  • trunk/ippdb/tests/insertobject.c

    r15792 r16177  
    168168        }
    169169
    170         object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string");
     170        object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string");
    171171        if (!object) {
    172172            exit(EXIT_FAILURE);
     
    212212        }
    213213
    214         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", 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);
     214        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);
    215215        if (!object) {
    216216            exit(EXIT_FAILURE);
     
    278278        }
    279279
    280         object = chipRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string");
     280        object = chipRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string");
    281281        if (!object) {
    282282            exit(EXIT_FAILURE);
     
    344344        }
    345345
    346         object = camRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string");
     346        object = camRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string");
    347347        if (!object) {
    348348            exit(EXIT_FAILURE);
     
    410410        }
    411411
    412         object = warpRunRowAlloc(-64, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
     412        object = warpRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
    413413        if (!object) {
    414414            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r15792 r16177  
    303303        bool            status;
    304304
    305         object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string");
     305        object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string");
    306306        if (!object) {
    307307            exit(EXIT_FAILURE);
     
    346346            exit(EXIT_FAILURE);
    347347        }
     348        if (strncmp(psMetadataLookupPtr(&status, md, "dvodb"), "a string", MAX_STRING_LENGTH)) {
     349            psFree(md);
     350            exit(EXIT_FAILURE);
     351        }
     352        if (strncmp(psMetadataLookupPtr(&status, md, "tess_id"), "a string", MAX_STRING_LENGTH)) {
     353            psFree(md);
     354            exit(EXIT_FAILURE);
     355        }
     356        if (strncmp(psMetadataLookupPtr(&status, md, "end_stage"), "a string", MAX_STRING_LENGTH)) {
     357            psFree(md);
     358            exit(EXIT_FAILURE);
     359        }
    348360
    349361        psFree(md);
     
    387399        bool            status;
    388400
    389         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", 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);
     401        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);
    390402        if (!object) {
    391403            exit(EXIT_FAILURE);
     
    437449            exit(EXIT_FAILURE);
    438450        }
     451        if (strncmp(psMetadataLookupPtr(&status, md, "dvodb"), "a string", MAX_STRING_LENGTH)) {
     452            psFree(md);
     453            exit(EXIT_FAILURE);
     454        }
     455        if (strncmp(psMetadataLookupPtr(&status, md, "tess_id"), "a string", MAX_STRING_LENGTH)) {
     456            psFree(md);
     457            exit(EXIT_FAILURE);
     458        }
     459        if (strncmp(psMetadataLookupPtr(&status, md, "end_stage"), "a string", MAX_STRING_LENGTH)) {
     460            psFree(md);
     461            exit(EXIT_FAILURE);
     462        }
    439463        if (strncmp(psMetadataLookupPtr(&status, md, "filter"), "a string", MAX_STRING_LENGTH)) {
    440464            psFree(md);
     
    874898        bool            status;
    875899
    876         object = chipRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string");
     900        object = chipRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string");
    877901        if (!object) {
    878902            exit(EXIT_FAILURE);
     
    920944            exit(EXIT_FAILURE);
    921945        }
     946        if (strncmp(psMetadataLookupPtr(&status, md, "tess_id"), "a string", MAX_STRING_LENGTH)) {
     947            psFree(md);
     948            exit(EXIT_FAILURE);
     949        }
     950        if (strncmp(psMetadataLookupPtr(&status, md, "end_stage"), "a string", MAX_STRING_LENGTH)) {
     951            psFree(md);
     952            exit(EXIT_FAILURE);
     953        }
    922954
    923955        psFree(md);
     
    10681100        bool            status;
    10691101
    1070         object = camRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string");
     1102        object = camRunRowAlloc(-64, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string");
    10711103        if (!object) {
    10721104            exit(EXIT_FAILURE);
     
    11141146            exit(EXIT_FAILURE);
    11151147        }
     1148        if (strncmp(psMetadataLookupPtr(&status, md, "tess_id"), "a string", MAX_STRING_LENGTH)) {
     1149            psFree(md);
     1150            exit(EXIT_FAILURE);
     1151        }
     1152        if (strncmp(psMetadataLookupPtr(&status, md, "end_stage"), "a string", MAX_STRING_LENGTH)) {
     1153            psFree(md);
     1154            exit(EXIT_FAILURE);
     1155        }
    11161156
    11171157        psFree(md);
     
    12381278        bool            status;
    12391279
    1240         object = warpRunRowAlloc(-64, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
     1280        object = warpRunRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
    12411281        if (!object) {
    12421282            exit(EXIT_FAILURE);
     
    12651305            exit(EXIT_FAILURE);
    12661306        }
     1307        if (strncmp(psMetadataLookupPtr(&status, md, "workdir_state"), "a string", MAX_STRING_LENGTH)) {
     1308            psFree(md);
     1309            exit(EXIT_FAILURE);
     1310        }
    12671311        if (strncmp(psMetadataLookupPtr(&status, md, "dvodb"), "a string", MAX_STRING_LENGTH)) {
     1312            psFree(md);
     1313            exit(EXIT_FAILURE);
     1314        }
     1315        if (strncmp(psMetadataLookupPtr(&status, md, "tess_id"), "a string", MAX_STRING_LENGTH)) {
     1316            psFree(md);
     1317            exit(EXIT_FAILURE);
     1318        }
     1319        if (strncmp(psMetadataLookupPtr(&status, md, "end_stage"), "a string", MAX_STRING_LENGTH)) {
    12681320            psFree(md);
    12691321            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r15792 r16177  
    456456            exit(EXIT_FAILURE);
    457457        }
     458        if (!psMetadataAddStr(md, PS_LIST_TAIL, "dvodb", 0, NULL, "a string")) {
     459            psFree(md);
     460            exit(EXIT_FAILURE);
     461        }
     462        if (!psMetadataAddStr(md, PS_LIST_TAIL, "tess_id", 0, NULL, "a string")) {
     463            psFree(md);
     464            exit(EXIT_FAILURE);
     465        }
     466        if (!psMetadataAddStr(md, PS_LIST_TAIL, "end_stage", 0, NULL, "a string")) {
     467            psFree(md);
     468            exit(EXIT_FAILURE);
     469        }
    458470
    459471        object = newExpObjectFromMetadata(md);
     
    496508            exit(EXIT_FAILURE);
    497509        }
     510        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     511            psFree(object);
     512            exit(EXIT_FAILURE);
     513        }
     514        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     515            psFree(object);
     516            exit(EXIT_FAILURE);
     517        }
     518        if (strncmp(object->end_stage, "a string", MAX_STRING_LENGTH)) {
     519            psFree(object);
     520            exit(EXIT_FAILURE);
     521        }
    498522
    499523        psFree(object);
     
    583607            exit(EXIT_FAILURE);
    584608        }
     609        if (!psMetadataAddStr(md, PS_LIST_TAIL, "dvodb", 0, NULL, "a string")) {
     610            psFree(md);
     611            exit(EXIT_FAILURE);
     612        }
     613        if (!psMetadataAddStr(md, PS_LIST_TAIL, "tess_id", 0, NULL, "a string")) {
     614            psFree(md);
     615            exit(EXIT_FAILURE);
     616        }
     617        if (!psMetadataAddStr(md, PS_LIST_TAIL, "end_stage", 0, NULL, "a string")) {
     618            psFree(md);
     619            exit(EXIT_FAILURE);
     620        }
    585621        if (!psMetadataAddStr(md, PS_LIST_TAIL, "filter", 0, NULL, "a string")) {
    586622            psFree(md);
     
    801837            exit(EXIT_FAILURE);
    802838        }
     839        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     840            psFree(object);
     841            exit(EXIT_FAILURE);
     842        }
     843        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     844            psFree(object);
     845            exit(EXIT_FAILURE);
     846        }
     847        if (strncmp(object->end_stage, "a string", MAX_STRING_LENGTH)) {
     848            psFree(object);
     849            exit(EXIT_FAILURE);
     850        }
    803851        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
    804852            psFree(object);
     
    14811529            exit(EXIT_FAILURE);
    14821530        }
     1531        if (!psMetadataAddStr(md, PS_LIST_TAIL, "tess_id", 0, NULL, "a string")) {
     1532            psFree(md);
     1533            exit(EXIT_FAILURE);
     1534        }
     1535        if (!psMetadataAddStr(md, PS_LIST_TAIL, "end_stage", 0, NULL, "a string")) {
     1536            psFree(md);
     1537            exit(EXIT_FAILURE);
     1538        }
    14831539
    14841540        object = chipRunObjectFromMetadata(md);
     
    15241580            exit(EXIT_FAILURE);
    15251581        }
     1582        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     1583            psFree(object);
     1584            exit(EXIT_FAILURE);
     1585        }
     1586        if (strncmp(object->end_stage, "a string", MAX_STRING_LENGTH)) {
     1587            psFree(object);
     1588            exit(EXIT_FAILURE);
     1589        }
    15261590
    15271591        psFree(object);
     
    17971861            exit(EXIT_FAILURE);
    17981862        }
     1863        if (!psMetadataAddStr(md, PS_LIST_TAIL, "tess_id", 0, NULL, "a string")) {
     1864            psFree(md);
     1865            exit(EXIT_FAILURE);
     1866        }
     1867        if (!psMetadataAddStr(md, PS_LIST_TAIL, "end_stage", 0, NULL, "a string")) {
     1868            psFree(md);
     1869            exit(EXIT_FAILURE);
     1870        }
    17991871
    18001872        object = camRunObjectFromMetadata(md);
     
    18401912            exit(EXIT_FAILURE);
    18411913        }
     1914        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     1915            psFree(object);
     1916            exit(EXIT_FAILURE);
     1917        }
     1918        if (strncmp(object->end_stage, "a string", MAX_STRING_LENGTH)) {
     1919            psFree(object);
     1920            exit(EXIT_FAILURE);
     1921        }
    18421922
    18431923        psFree(object);
     
    20462126            exit(EXIT_FAILURE);
    20472127        }
     2128        if (!psMetadataAddStr(md, PS_LIST_TAIL, "workdir_state", 0, NULL, "a string")) {
     2129            psFree(md);
     2130            exit(EXIT_FAILURE);
     2131        }
    20482132        if (!psMetadataAddStr(md, PS_LIST_TAIL, "dvodb", 0, NULL, "a string")) {
    20492133            psFree(md);
    20502134            exit(EXIT_FAILURE);
    20512135        }
     2136        if (!psMetadataAddStr(md, PS_LIST_TAIL, "tess_id", 0, NULL, "a string")) {
     2137            psFree(md);
     2138            exit(EXIT_FAILURE);
     2139        }
     2140        if (!psMetadataAddStr(md, PS_LIST_TAIL, "end_stage", 0, NULL, "a string")) {
     2141            psFree(md);
     2142            exit(EXIT_FAILURE);
     2143        }
    20522144            psFree(md);
    20532145            exit(EXIT_FAILURE);
     
    20772169            exit(EXIT_FAILURE);
    20782170        }
     2171        if (strncmp(object->workdir_state, "a string", MAX_STRING_LENGTH)) {
     2172            psFree(object);
     2173            exit(EXIT_FAILURE);
     2174        }
    20792175        if (strncmp(object->dvodb, "a string", MAX_STRING_LENGTH)) {
     2176            psFree(object);
     2177            exit(EXIT_FAILURE);
     2178        }
     2179        if (strncmp(object->tess_id, "a string", MAX_STRING_LENGTH)) {
     2180            psFree(object);
     2181            exit(EXIT_FAILURE);
     2182        }
     2183        if (strncmp(object->end_stage, "a string", MAX_STRING_LENGTH)) {
    20802184            psFree(object);
    20812185            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.