IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11113


Ignore:
Timestamp:
Jan 16, 2007, 12:21:17 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.76

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/Makefile

    r9666 r11113  
    1818        chmod +x ../ippdb/autogen.sh
    1919
     20foo: src
     21        $(MAKE) -C ../ippdb install
     22
    2023build : ippdb ippdb.mdc
    2124
  • trunk/dbconfig/config.md

    r11077 r11113  
    22    pkg_name        STR     ippdb
    33    pkg_namespace   STR     ippdb
    4     pkg_version     STR     0.0.74
     4    pkg_version     STR     0.0.75
    55END
  • trunk/ippdb/configure.ac

    r11077 r11113  
    77AC_PREREQ(2.59)
    88
    9 AC_INIT([ippdb], [0.0.74], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [0.0.75], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r11077 r11113  
    92249224static void detProcessedImfileRowFree(detProcessedImfileRow *object);
    92259225
    9226 detProcessedImfileRow *detProcessedImfileRowAlloc(psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri)
     9226detProcessedImfileRow *detProcessedImfileRowAlloc(psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault)
    92279227{
    92289228    detProcessedImfileRow *_object;
     
    92419241    _object->b1_uri = psStringCopy(b1_uri);
    92429242    _object->b2_uri = psStringCopy(b2_uri);
     9243    _object->fault = fault;
    92439244
    92449245    return _object;
     
    93089309        return false;
    93099310    }
     9311    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     9312        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     9313        psFree(md);
     9314        return false;
     9315    }
    93109316
    93119317    bool status = psDBCreateTable(dbh, DETPROCESSEDIMFILE_TABLE_NAME, md);
     
    93219327}
    93229328
    9323 bool detProcessedImfileInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri)
     9329bool detProcessedImfileInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault)
    93249330{
    93259331    psMetadata *md = psMetadataAlloc();
     
    93719377    if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) {
    93729378        psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri");
     9379        psFree(md);
     9380        return false;
     9381    }
     9382    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     9383        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    93739384        psFree(md);
    93749385        return false;
     
    93979408bool detProcessedImfileInsertObject(psDB *dbh, detProcessedImfileRow *object)
    93989409{
    9399     return detProcessedImfileInsert(dbh, object->det_id, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri);
     9410    return detProcessedImfileInsert(dbh, object->det_id, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->fault);
    94009411}
    94019412
     
    95209531        return false;
    95219532    }
     9533    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     9534        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     9535        psFree(md);
     9536        return false;
     9537    }
    95229538
    95239539
     
    95799595        return false;
    95809596    }
    9581 
    9582     return detProcessedImfileRowAlloc(det_id, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri);
     9597    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     9598    if (!status) {
     9599        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     9600        return false;
     9601    }
     9602
     9603    return detProcessedImfileRowAlloc(det_id, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault);
    95839604}
    95849605psArray *detProcessedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    96929713static void detProcessedExpRowFree(detProcessedExpRow *object);
    96939714
    9694 detProcessedExpRow *detProcessedExpRowAlloc(psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri)
     9715detProcessedExpRow *detProcessedExpRowAlloc(psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault)
    96959716{
    96969717    detProcessedExpRow *_object;
     
    97079728    _object->b1_uri = psStringCopy(b1_uri);
    97089729    _object->b2_uri = psStringCopy(b2_uri);
     9730    _object->fault = fault;
    97099731
    97109732    return _object;
     
    97629784        return false;
    97639785    }
     9786    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     9787        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     9788        psFree(md);
     9789        return false;
     9790    }
    97649791
    97659792    bool status = psDBCreateTable(dbh, DETPROCESSEDEXP_TABLE_NAME, md);
     
    97759802}
    97769803
    9777 bool detProcessedExpInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri)
     9804bool detProcessedExpInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault)
    97789805{
    97799806    psMetadata *md = psMetadataAlloc();
     
    98159842    if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) {
    98169843        psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri");
     9844        psFree(md);
     9845        return false;
     9846    }
     9847    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     9848        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    98179849        psFree(md);
    98189850        return false;
     
    98419873bool detProcessedExpInsertObject(psDB *dbh, detProcessedExpRow *object)
    98429874{
    9843     return detProcessedExpInsert(dbh, object->det_id, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri);
     9875    return detProcessedExpInsert(dbh, object->det_id, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->fault);
    98449876}
    98459877
     
    99549986        return false;
    99559987    }
     9988    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     9989        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     9990        psFree(md);
     9991        return false;
     9992    }
    99569993
    99579994
     
    1000310040        return false;
    1000410041    }
    10005 
    10006     return detProcessedExpRowAlloc(det_id, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri);
     10042    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     10043    if (!status) {
     10044        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     10045        return false;
     10046    }
     10047
     10048    return detProcessedExpRowAlloc(det_id, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault);
    1000710049}
    1000810050psArray *detProcessedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1011610158static void detStackedImfileRowFree(detStackedImfileRow *object);
    1011710159
    10118 detStackedImfileRow *detStackedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev)
     10160detStackedImfileRow *detStackedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psS16 fault)
    1011910161{
    1012010162    detStackedImfileRow *_object;
     
    1013110173    _object->bg_stdev = bg_stdev;
    1013210174    _object->bg_mean_stdev = bg_mean_stdev;
     10175    _object->fault = fault;
    1013310176
    1013410177    return _object;
     
    1018510228        return false;
    1018610229    }
     10230    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     10231        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     10232        psFree(md);
     10233        return false;
     10234    }
    1018710235
    1018810236    bool status = psDBCreateTable(dbh, DETSTACKEDIMFILE_TABLE_NAME, md);
     
    1019810246}
    1019910247
    10200 bool detStackedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev)
     10248bool detStackedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psS16 fault)
    1020110249{
    1020210250    psMetadata *md = psMetadataAlloc();
     
    1023810286    if (!psMetadataAdd(md, PS_LIST_TAIL, "bg_mean_stdev", PS_DATA_F64, NULL, bg_mean_stdev)) {
    1023910287        psError(PS_ERR_UNKNOWN, false, "failed to add item bg_mean_stdev");
     10288        psFree(md);
     10289        return false;
     10290    }
     10291    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     10292        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    1024010293        psFree(md);
    1024110294        return false;
     
    1026410317bool detStackedImfileInsertObject(psDB *dbh, detStackedImfileRow *object)
    1026510318{
    10266     return detStackedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev);
     10319    return detStackedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->fault);
    1026710320}
    1026810321
     
    1037710430        return false;
    1037810431    }
     10432    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     10433        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     10434        psFree(md);
     10435        return false;
     10436    }
    1037910437
    1038010438
     
    1042610484        return false;
    1042710485    }
    10428 
    10429     return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev);
     10486    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     10487    if (!status) {
     10488        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     10489        return false;
     10490    }
     10491
     10492    return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, fault);
    1043010493}
    1043110494psArray *detStackedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1053910602static void detNormalizedStatImfileRowFree(detNormalizedStatImfileRow *object);
    1054010603
    10541 detNormalizedStatImfileRow *detNormalizedStatImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, psF32 norm)
     10604detNormalizedStatImfileRow *detNormalizedStatImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, psF32 norm, psS16 fault)
    1054210605{
    1054310606    detNormalizedStatImfileRow *_object;
     
    1055010613    _object->class_id = psStringCopy(class_id);
    1055110614    _object->norm = norm;
     10615    _object->fault = fault;
    1055210616
    1055310617    return _object;
     
    1058210646        return false;
    1058310647    }
     10648    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     10649        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     10650        psFree(md);
     10651        return false;
     10652    }
    1058410653
    1058510654    bool status = psDBCreateTable(dbh, DETNORMALIZEDSTATIMFILE_TABLE_NAME, md);
     
    1059510664}
    1059610665
    10597 bool detNormalizedStatImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, psF32 norm)
     10666bool detNormalizedStatImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, psF32 norm, psS16 fault)
    1059810667{
    1059910668    psMetadata *md = psMetadataAlloc();
     
    1061510684    if (!psMetadataAdd(md, PS_LIST_TAIL, "norm", PS_DATA_F32, NULL, norm)) {
    1061610685        psError(PS_ERR_UNKNOWN, false, "failed to add item norm");
     10686        psFree(md);
     10687        return false;
     10688    }
     10689    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     10690        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    1061710691        psFree(md);
    1061810692        return false;
     
    1064110715bool detNormalizedStatImfileInsertObject(psDB *dbh, detNormalizedStatImfileRow *object)
    1064210716{
    10643     return detNormalizedStatImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->norm);
     10717    return detNormalizedStatImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->norm, object->fault);
    1064410718}
    1064510719
     
    1073410808        return false;
    1073510809    }
     10810    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     10811        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     10812        psFree(md);
     10813        return false;
     10814    }
    1073610815
    1073710816
     
    1076310842        return false;
    1076410843    }
    10765 
    10766     return detNormalizedStatImfileRowAlloc(det_id, iteration, class_id, norm);
     10844    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     10845    if (!status) {
     10846        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     10847        return false;
     10848    }
     10849
     10850    return detNormalizedStatImfileRowAlloc(det_id, iteration, class_id, norm, fault);
    1076710851}
    1076810852psArray *detNormalizedStatImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1087610960static void detNormalizedImfileRowFree(detNormalizedImfileRow *object);
    1087710961
    10878 detNormalizedImfileRow *detNormalizedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri)
     10962detNormalizedImfileRow *detNormalizedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault)
    1087910963{
    1088010964    detNormalizedImfileRow *_object;
     
    1089210976    _object->b1_uri = psStringCopy(b1_uri);
    1089310977    _object->b2_uri = psStringCopy(b2_uri);
     10978    _object->fault = fault;
    1089410979
    1089510980    return _object;
     
    1095211037        return false;
    1095311038    }
     11039    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     11040        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     11041        psFree(md);
     11042        return false;
     11043    }
    1095411044
    1095511045    bool status = psDBCreateTable(dbh, DETNORMALIZEDIMFILE_TABLE_NAME, md);
     
    1096511055}
    1096611056
    10967 bool detNormalizedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri)
     11057bool detNormalizedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault)
    1096811058{
    1096911059    psMetadata *md = psMetadataAlloc();
     
    1101011100    if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) {
    1101111101        psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri");
     11102        psFree(md);
     11103        return false;
     11104    }
     11105    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     11106        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    1101211107        psFree(md);
    1101311108        return false;
     
    1103611131bool detNormalizedImfileInsertObject(psDB *dbh, detNormalizedImfileRow *object)
    1103711132{
    11038     return detNormalizedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri);
     11133    return detNormalizedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->fault);
    1103911134}
    1104011135
     
    1115411249        return false;
    1115511250    }
     11251    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     11252        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     11253        psFree(md);
     11254        return false;
     11255    }
    1115611256
    1115711257
     
    1120811308        return false;
    1120911309    }
    11210 
    11211     return detNormalizedImfileRowAlloc(det_id, iteration, class_id, uri, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri);
     11310    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     11311    if (!status) {
     11312        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     11313        return false;
     11314    }
     11315
     11316    return detNormalizedImfileRowAlloc(det_id, iteration, class_id, uri, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault);
    1121211317}
    1121311318psArray *detNormalizedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1132111426static void detNormalizedExpRowFree(detNormalizedExpRow *object);
    1132211427
    11323 detNormalizedExpRow *detNormalizedExpRowAlloc(psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri)
     11428detNormalizedExpRow *detNormalizedExpRowAlloc(psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault)
    1132411429{
    1132511430    detNormalizedExpRow *_object;
     
    1133611441    _object->b1_uri = psStringCopy(b1_uri);
    1133711442    _object->b2_uri = psStringCopy(b2_uri);
     11443    _object->fault = fault;
    1133811444
    1133911445    return _object;
     
    1139011496        return false;
    1139111497    }
     11498    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     11499        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     11500        psFree(md);
     11501        return false;
     11502    }
    1139211503
    1139311504    bool status = psDBCreateTable(dbh, DETNORMALIZEDEXP_TABLE_NAME, md);
     
    1140311514}
    1140411515
    11405 bool detNormalizedExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri)
     11516bool detNormalizedExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault)
    1140611517{
    1140711518    psMetadata *md = psMetadataAlloc();
     
    1144311554    if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) {
    1144411555        psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri");
     11556        psFree(md);
     11557        return false;
     11558    }
     11559    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     11560        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    1144511561        psFree(md);
    1144611562        return false;
     
    1146911585bool detNormalizedExpInsertObject(psDB *dbh, detNormalizedExpRow *object)
    1147011586{
    11471     return detNormalizedExpInsert(dbh, object->det_id, object->iteration, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri);
     11587    return detNormalizedExpInsert(dbh, object->det_id, object->iteration, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->fault);
    1147211588}
    1147311589
     
    1158211698        return false;
    1158311699    }
     11700    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     11701        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     11702        psFree(md);
     11703        return false;
     11704    }
    1158411705
    1158511706
     
    1163111752        return false;
    1163211753    }
    11633 
    11634     return detNormalizedExpRowAlloc(det_id, iteration, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri);
     11754    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     11755    if (!status) {
     11756        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     11757        return false;
     11758    }
     11759
     11760    return detNormalizedExpRowAlloc(det_id, iteration, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault);
    1163511761}
    1163611762psArray *detNormalizedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1174411870static void detResidImfileRowFree(detResidImfileRow *object);
    1174511871
    11746 detResidImfileRow *detResidImfileRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri)
     11872detResidImfileRow *detResidImfileRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault)
    1174711873{
    1174811874    detResidImfileRow *_object;
     
    1176211888    _object->b1_uri = psStringCopy(b1_uri);
    1176311889    _object->b2_uri = psStringCopy(b2_uri);
     11890    _object->fault = fault;
    1176411891
    1176511892    return _object;
     
    1183411961        return false;
    1183511962    }
     11963    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     11964        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     11965        psFree(md);
     11966        return false;
     11967    }
    1183611968
    1183711969    bool status = psDBCreateTable(dbh, DETRESIDIMFILE_TABLE_NAME, md);
     
    1184711979}
    1184811980
    11849 bool detResidImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri)
     11981bool detResidImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS16 fault)
    1185011982{
    1185111983    psMetadata *md = psMetadataAlloc();
     
    1190212034    if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) {
    1190312035        psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri");
     12036        psFree(md);
     12037        return false;
     12038    }
     12039    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     12040        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    1190412041        psFree(md);
    1190512042        return false;
     
    1192812065bool detResidImfileInsertObject(psDB *dbh, detResidImfileRow *object)
    1192912066{
    11930     return detResidImfileInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri);
     12067    return detResidImfileInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->fault);
    1193112068}
    1193212069
     
    1205612193        return false;
    1205712194    }
     12195    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     12196        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     12197        psFree(md);
     12198        return false;
     12199    }
    1205812200
    1205912201
     
    1212012262        return false;
    1212112263    }
    12122 
    12123     return detResidImfileRowAlloc(det_id, iteration, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri);
     12264    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     12265    if (!status) {
     12266        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     12267        return false;
     12268    }
     12269
     12270    return detResidImfileRowAlloc(det_id, iteration, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault);
    1212412271}
    1212512272psArray *detResidImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1223312380static void detResidExpRowFree(detResidExpRow *object);
    1223412381
    12235 detResidExpRow *detResidExpRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, bool accept)
     12382detResidExpRow *detResidExpRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, bool accept, psS16 fault)
    1223612383{
    1223712384    detResidExpRow  *_object;
     
    1225012397    _object->b2_uri = psStringCopy(b2_uri);
    1225112398    _object->accept = accept;
     12399    _object->fault = fault;
    1225212400
    1225312401    return _object;
     
    1231512463        return false;
    1231612464    }
     12465    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     12466        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     12467        psFree(md);
     12468        return false;
     12469    }
    1231712470
    1231812471    bool status = psDBCreateTable(dbh, DETRESIDEXP_TABLE_NAME, md);
     
    1232812481}
    1232912482
    12330 bool detResidExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, bool accept)
     12483bool detResidExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, bool accept, psS16 fault)
    1233112484{
    1233212485    psMetadata *md = psMetadataAlloc();
     
    1237812531    if (!psMetadataAdd(md, PS_LIST_TAIL, "accept", PS_DATA_BOOL, NULL, accept)) {
    1237912532        psError(PS_ERR_UNKNOWN, false, "failed to add item accept");
     12533        psFree(md);
     12534        return false;
     12535    }
     12536    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     12537        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    1238012538        psFree(md);
    1238112539        return false;
     
    1240412562bool detResidExpInsertObject(psDB *dbh, detResidExpRow *object)
    1240512563{
    12406     return detResidExpInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->accept);
     12564    return detResidExpInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->accept, object->fault);
    1240712565}
    1240812566
     
    1252712685        return false;
    1252812686    }
     12687    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     12688        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     12689        psFree(md);
     12690        return false;
     12691    }
    1252912692
    1253012693
     
    1258612749        return false;
    1258712750    }
    12588 
    12589     return detResidExpRowAlloc(det_id, iteration, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, accept);
     12751    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     12752    if (!status) {
     12753        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     12754        return false;
     12755    }
     12756
     12757    return detResidExpRowAlloc(det_id, iteration, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, accept, fault);
    1259012758}
    1259112759psArray *detResidExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1269912867static void detRunSummaryRowFree(detRunSummaryRow *object);
    1270012868
    12701 detRunSummaryRow *detRunSummaryRowAlloc(psS32 det_id, psS32 iteration, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, bool accept)
     12869detRunSummaryRow *detRunSummaryRowAlloc(psS32 det_id, psS32 iteration, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, bool accept, psS16 fault)
    1270212870{
    1270312871    detRunSummaryRow *_object;
     
    1271212880    _object->bg_mean_stdev = bg_mean_stdev;
    1271312881    _object->accept = accept;
     12882    _object->fault = fault;
    1271412883
    1271512884    return _object;
     
    1275312922        return false;
    1275412923    }
     12924    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     12925        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     12926        psFree(md);
     12927        return false;
     12928    }
    1275512929
    1275612930    bool status = psDBCreateTable(dbh, DETRUNSUMMARY_TABLE_NAME, md);
     
    1276612940}
    1276712941
    12768 bool detRunSummaryInsert(psDB * dbh, psS32 det_id, psS32 iteration, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, bool accept)
     12942bool detRunSummaryInsert(psDB * dbh, psS32 det_id, psS32 iteration, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, bool accept, psS16 fault)
    1276912943{
    1277012944    psMetadata *md = psMetadataAlloc();
     
    1279612970    if (!psMetadataAdd(md, PS_LIST_TAIL, "accept", PS_DATA_BOOL, NULL, accept)) {
    1279712971        psError(PS_ERR_UNKNOWN, false, "failed to add item accept");
     12972        psFree(md);
     12973        return false;
     12974    }
     12975    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     12976        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    1279812977        psFree(md);
    1279912978        return false;
     
    1282213001bool detRunSummaryInsertObject(psDB *dbh, detRunSummaryRow *object)
    1282313002{
    12824     return detRunSummaryInsert(dbh, object->det_id, object->iteration, object->bg, object->bg_stdev, object->bg_mean_stdev, object->accept);
     13003    return detRunSummaryInsert(dbh, object->det_id, object->iteration, object->bg, object->bg_stdev, object->bg_mean_stdev, object->accept, object->fault);
    1282513004}
    1282613005
     
    1292513104        return false;
    1292613105    }
     13106    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     13107        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     13108        psFree(md);
     13109        return false;
     13110    }
    1292713111
    1292813112
     
    1296413148        return false;
    1296513149    }
    12966 
    12967     return detRunSummaryRowAlloc(det_id, iteration, bg, bg_stdev, bg_mean_stdev, accept);
     13150    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     13151    if (!status) {
     13152        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     13153        return false;
     13154    }
     13155
     13156    return detRunSummaryRowAlloc(det_id, iteration, bg, bg_stdev, bg_mean_stdev, accept, fault);
    1296813157}
    1296913158psArray *detRunSummarySelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r11077 r11113  
    48424842    char            *b1_uri;
    48434843    char            *b2_uri;
     4844    psS16           fault;
    48444845} detProcessedImfileRow;
    48454846
     
    48594860    psF64           bg_mean_stdev,
    48604861    const char      *b1_uri,
    4861     const char      *b2_uri
     4862    const char      *b2_uri,
     4863    psS16           fault
    48624864);
    48634865
     
    48984900    psF64           bg_mean_stdev,
    48994901    const char      *b1_uri,
    4900     const char      *b2_uri
     4902    const char      *b2_uri,
     4903    psS16           fault
    49014904);
    49024905
     
    50625065    char            *b1_uri;
    50635066    char            *b2_uri;
     5067    psS16           fault;
    50645068} detProcessedExpRow;
    50655069
     
    50775081    psF64           bg_mean_stdev,
    50785082    const char      *b1_uri,
    5079     const char      *b2_uri
     5083    const char      *b2_uri,
     5084    psS16           fault
    50805085);
    50815086
     
    51145119    psF64           bg_mean_stdev,
    51155120    const char      *b1_uri,
    5116     const char      *b2_uri
     5121    const char      *b2_uri,
     5122    psS16           fault
    51175123);
    51185124
     
    52785284    psF64           bg_stdev;
    52795285    psF64           bg_mean_stdev;
     5286    psS16           fault;
    52805287} detStackedImfileRow;
    52815288
     
    52935300    psF64           bg,
    52945301    psF64           bg_stdev,
    5295     psF64           bg_mean_stdev
     5302    psF64           bg_mean_stdev,
     5303    psS16           fault
    52965304);
    52975305
     
    53305338    psF64           bg,
    53315339    psF64           bg_stdev,
    5332     psF64           bg_mean_stdev
     5340    psF64           bg_mean_stdev,
     5341    psS16           fault
    53335342);
    53345343
     
    54905499    char            *class_id;
    54915500    psF32           norm;
     5501    psS16           fault;
    54925502} detNormalizedStatImfileRow;
    54935503
     
    55015511    psS32           iteration,
    55025512    const char      *class_id,
    5503     psF32           norm
     5513    psF32           norm,
     5514    psS16           fault
    55045515);
    55055516
     
    55345545    psS32           iteration,
    55355546    const char      *class_id,
    5536     psF32           norm
     5547    psF32           norm,
     5548    psS16           fault
    55375549);
    55385550
     
    56995711    char            *b1_uri;
    57005712    char            *b2_uri;
     5713    psS16           fault;
    57015714} detNormalizedImfileRow;
    57025715
     
    57155728    psF64           bg_mean_stdev,
    57165729    const char      *b1_uri,
    5717     const char      *b2_uri
     5730    const char      *b2_uri,
     5731    psS16           fault
    57185732);
    57195733
     
    57535767    psF64           bg_mean_stdev,
    57545768    const char      *b1_uri,
    5755     const char      *b2_uri
     5769    const char      *b2_uri,
     5770    psS16           fault
    57565771);
    57575772
     
    59175932    char            *b1_uri;
    59185933    char            *b2_uri;
     5934    psS16           fault;
    59195935} detNormalizedExpRow;
    59205936
     
    59325948    psF64           bg_mean_stdev,
    59335949    const char      *b1_uri,
    5934     const char      *b2_uri
     5950    const char      *b2_uri,
     5951    psS16           fault
    59355952);
    59365953
     
    59695986    psF64           bg_mean_stdev,
    59705987    const char      *b1_uri,
    5971     const char      *b2_uri
     5988    const char      *b2_uri,
     5989    psS16           fault
    59725990);
    59735991
     
    61366154    char            *b1_uri;
    61376155    char            *b2_uri;
     6156    psS16           fault;
    61386157} detResidImfileRow;
    61396158
     
    61546173    psF64           bg_mean_stdev,
    61556174    const char      *b1_uri,
    6156     const char      *b2_uri
     6175    const char      *b2_uri,
     6176    psS16           fault
    61576177);
    61586178
     
    61946214    psF64           bg_mean_stdev,
    61956215    const char      *b1_uri,
    6196     const char      *b2_uri
     6216    const char      *b2_uri,
     6217    psS16           fault
    61976218);
    61986219
     
    63606381    char            *b2_uri;
    63616382    bool            accept;
     6383    psS16           fault;
    63626384} detResidExpRow;
    63636385
     
    63776399    const char      *b1_uri,
    63786400    const char      *b2_uri,
    6379     bool            accept
     6401    bool            accept,
     6402    psS16           fault
    63806403);
    63816404
     
    64166439    const char      *b1_uri,
    64176440    const char      *b2_uri,
    6418     bool            accept
     6441    bool            accept,
     6442    psS16           fault
    64196443);
    64206444
     
    65786602    psF64           bg_mean_stdev;
    65796603    bool            accept;
     6604    psS16           fault;
    65806605} detRunSummaryRow;
    65816606
     
    65916616    psF64           bg_stdev,
    65926617    psF64           bg_mean_stdev,
    6593     bool            accept
     6618    bool            accept,
     6619    psS16           fault
    65946620);
    65956621
     
    66266652    psF64           bg_stdev,
    66276653    psF64           bg_mean_stdev,
    6628     bool            accept
     6654    bool            accept,
     6655    psS16           fault
    66296656);
    66306657
  • trunk/ippdb/tests/alloc.c

    r11077 r11113  
    921921        detProcessedImfileRow *object;
    922922
    923         object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string"    );
     923        object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16    );
    924924
    925925        if (!object) {
     
    967967            exit(EXIT_FAILURE);
    968968        }
     969            psFree(object);
     970            exit(EXIT_FAILURE);
     971        }
    969972
    970973        psFree(object);
     
    974977        detProcessedExpRow *object;
    975978
    976         object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string"    );
     979        object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16    );
    977980
    978981        if (!object) {
     
    10121015            exit(EXIT_FAILURE);
    10131016        }
     1017            psFree(object);
     1018            exit(EXIT_FAILURE);
     1019        }
    10141020
    10151021        psFree(object);
     
    10191025        detStackedImfileRow *object;
    10201026
    1021         object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64    );
     1027        object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, -16    );
    10221028
    10231029        if (!object) {
     
    10571063            exit(EXIT_FAILURE);
    10581064        }
     1065            psFree(object);
     1066            exit(EXIT_FAILURE);
     1067        }
    10591068
    10601069        psFree(object);
     
    10641073        detNormalizedStatImfileRow *object;
    10651074
    1066         object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32    );
     1075        object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32, -16    );
    10671076
    10681077        if (!object) {
     
    10861095            exit(EXIT_FAILURE);
    10871096        }
     1097            psFree(object);
     1098            exit(EXIT_FAILURE);
     1099        }
    10881100
    10891101        psFree(object);
     
    10931105        detNormalizedImfileRow *object;
    10941106
    1095         object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string"    );
     1107        object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16    );
    10961108
    10971109        if (!object) {
     
    11351147            exit(EXIT_FAILURE);
    11361148        }
     1149            psFree(object);
     1150            exit(EXIT_FAILURE);
     1151        }
    11371152
    11381153        psFree(object);
     
    11421157        detNormalizedExpRow *object;
    11431158
    1144         object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string"    );
     1159        object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string", -16    );
    11451160
    11461161        if (!object) {
     
    11801195            exit(EXIT_FAILURE);
    11811196        }
     1197            psFree(object);
     1198            exit(EXIT_FAILURE);
     1199        }
    11821200
    11831201        psFree(object);
     
    11871205        detResidImfileRow *object;
    11881206
    1189         object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string"    );
     1207        object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16    );
    11901208
    11911209        if (!object) {
     
    12371255            exit(EXIT_FAILURE);
    12381256        }
     1257            psFree(object);
     1258            exit(EXIT_FAILURE);
     1259        }
    12391260
    12401261        psFree(object);
     
    12441265        detResidExpRow  *object;
    12451266
    1246         object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true    );
     1267        object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true, -16    );
    12471268
    12481269        if (!object) {
     
    12901311            exit(EXIT_FAILURE);
    12911312        }
     1313            psFree(object);
     1314            exit(EXIT_FAILURE);
     1315        }
    12921316
    12931317        psFree(object);
     
    12971321        detRunSummaryRow *object;
    12981322
    1299         object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true    );
     1323        object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true, -16    );
    13001324
    13011325        if (!object) {
     
    13241348        }
    13251349        if (!object->accept == true) {
     1350            psFree(object);
     1351            exit(EXIT_FAILURE);
     1352        }
    13261353            psFree(object);
    13271354            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r11077 r11113  
    343343        }
    344344
    345         if (!detProcessedImfileInsert(dbh, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string")) {
    346             exit(EXIT_FAILURE);
    347         }
    348 
    349         psDBCleanup(dbh);
    350     }
    351 
    352     {
    353         psDB            *dbh;
    354 
    355         dbh = psDBInit("localhost", "test", NULL, "test");
    356         if (!dbh) {
    357             exit(EXIT_FAILURE);
    358         }
    359 
    360         if (!detProcessedExpInsert(dbh, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string")) {
    361             exit(EXIT_FAILURE);
    362         }
    363 
    364         psDBCleanup(dbh);
    365     }
    366 
    367     {
    368         psDB            *dbh;
    369 
    370         dbh = psDBInit("localhost", "test", NULL, "test");
    371         if (!dbh) {
    372             exit(EXIT_FAILURE);
    373         }
    374 
    375         if (!detStackedImfileInsert(dbh, -32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64)) {
    376             exit(EXIT_FAILURE);
    377         }
    378 
    379         psDBCleanup(dbh);
    380     }
    381 
    382     {
    383         psDB            *dbh;
    384 
    385         dbh = psDBInit("localhost", "test", NULL, "test");
    386         if (!dbh) {
    387             exit(EXIT_FAILURE);
    388         }
    389 
    390         if (!detNormalizedStatImfileInsert(dbh, -32, -32, "a string", 32.32)) {
    391             exit(EXIT_FAILURE);
    392         }
    393 
    394         psDBCleanup(dbh);
    395     }
    396 
    397     {
    398         psDB            *dbh;
    399 
    400         dbh = psDBInit("localhost", "test", NULL, "test");
    401         if (!dbh) {
    402             exit(EXIT_FAILURE);
    403         }
    404 
    405         if (!detNormalizedImfileInsert(dbh, -32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string")) {
    406             exit(EXIT_FAILURE);
    407         }
    408 
    409         psDBCleanup(dbh);
    410     }
    411 
    412     {
    413         psDB            *dbh;
    414 
    415         dbh = psDBInit("localhost", "test", NULL, "test");
    416         if (!dbh) {
    417             exit(EXIT_FAILURE);
    418         }
    419 
    420         if (!detNormalizedExpInsert(dbh, -32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string")) {
    421             exit(EXIT_FAILURE);
    422         }
    423 
    424         psDBCleanup(dbh);
    425     }
    426 
    427     {
    428         psDB            *dbh;
    429 
    430         dbh = psDBInit("localhost", "test", NULL, "test");
    431         if (!dbh) {
    432             exit(EXIT_FAILURE);
    433         }
    434 
    435         if (!detResidImfileInsert(dbh, -32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string")) {
    436             exit(EXIT_FAILURE);
    437         }
    438 
    439         psDBCleanup(dbh);
    440     }
    441 
    442     {
    443         psDB            *dbh;
    444 
    445         dbh = psDBInit("localhost", "test", NULL, "test");
    446         if (!dbh) {
    447             exit(EXIT_FAILURE);
    448         }
    449 
    450         if (!detResidExpInsert(dbh, -32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true)) {
    451             exit(EXIT_FAILURE);
    452         }
    453 
    454         psDBCleanup(dbh);
    455     }
    456 
    457     {
    458         psDB            *dbh;
    459 
    460         dbh = psDBInit("localhost", "test", NULL, "test");
    461         if (!dbh) {
    462             exit(EXIT_FAILURE);
    463         }
    464 
    465         if (!detRunSummaryInsert(dbh, -32, -32, 64.64, 64.64, 64.64, true)) {
     345        if (!detProcessedImfileInsert(dbh, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16)) {
     346            exit(EXIT_FAILURE);
     347        }
     348
     349        psDBCleanup(dbh);
     350    }
     351
     352    {
     353        psDB            *dbh;
     354
     355        dbh = psDBInit("localhost", "test", NULL, "test");
     356        if (!dbh) {
     357            exit(EXIT_FAILURE);
     358        }
     359
     360        if (!detProcessedExpInsert(dbh, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16)) {
     361            exit(EXIT_FAILURE);
     362        }
     363
     364        psDBCleanup(dbh);
     365    }
     366
     367    {
     368        psDB            *dbh;
     369
     370        dbh = psDBInit("localhost", "test", NULL, "test");
     371        if (!dbh) {
     372            exit(EXIT_FAILURE);
     373        }
     374
     375        if (!detStackedImfileInsert(dbh, -32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, -16)) {
     376            exit(EXIT_FAILURE);
     377        }
     378
     379        psDBCleanup(dbh);
     380    }
     381
     382    {
     383        psDB            *dbh;
     384
     385        dbh = psDBInit("localhost", "test", NULL, "test");
     386        if (!dbh) {
     387            exit(EXIT_FAILURE);
     388        }
     389
     390        if (!detNormalizedStatImfileInsert(dbh, -32, -32, "a string", 32.32, -16)) {
     391            exit(EXIT_FAILURE);
     392        }
     393
     394        psDBCleanup(dbh);
     395    }
     396
     397    {
     398        psDB            *dbh;
     399
     400        dbh = psDBInit("localhost", "test", NULL, "test");
     401        if (!dbh) {
     402            exit(EXIT_FAILURE);
     403        }
     404
     405        if (!detNormalizedImfileInsert(dbh, -32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16)) {
     406            exit(EXIT_FAILURE);
     407        }
     408
     409        psDBCleanup(dbh);
     410    }
     411
     412    {
     413        psDB            *dbh;
     414
     415        dbh = psDBInit("localhost", "test", NULL, "test");
     416        if (!dbh) {
     417            exit(EXIT_FAILURE);
     418        }
     419
     420        if (!detNormalizedExpInsert(dbh, -32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string", -16)) {
     421            exit(EXIT_FAILURE);
     422        }
     423
     424        psDBCleanup(dbh);
     425    }
     426
     427    {
     428        psDB            *dbh;
     429
     430        dbh = psDBInit("localhost", "test", NULL, "test");
     431        if (!dbh) {
     432            exit(EXIT_FAILURE);
     433        }
     434
     435        if (!detResidImfileInsert(dbh, -32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16)) {
     436            exit(EXIT_FAILURE);
     437        }
     438
     439        psDBCleanup(dbh);
     440    }
     441
     442    {
     443        psDB            *dbh;
     444
     445        dbh = psDBInit("localhost", "test", NULL, "test");
     446        if (!dbh) {
     447            exit(EXIT_FAILURE);
     448        }
     449
     450        if (!detResidExpInsert(dbh, -32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true, -16)) {
     451            exit(EXIT_FAILURE);
     452        }
     453
     454        psDBCleanup(dbh);
     455    }
     456
     457    {
     458        psDB            *dbh;
     459
     460        dbh = psDBInit("localhost", "test", NULL, "test");
     461        if (!dbh) {
     462            exit(EXIT_FAILURE);
     463        }
     464
     465        if (!detRunSummaryInsert(dbh, -32, -32, 64.64, 64.64, 64.64, true, -16)) {
    466466            exit(EXIT_FAILURE);
    467467        }
  • trunk/ippdb/tests/insertobject.c

    r11077 r11113  
    498498        }
    499499
    500         object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string");
     500        object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16);
    501501        if (!object) {
    502502            exit(EXIT_FAILURE);
     
    520520        }
    521521
    522         object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string");
     522        object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16);
    523523        if (!object) {
    524524            exit(EXIT_FAILURE);
     
    542542        }
    543543
    544         object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64);
     544        object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, -16);
    545545        if (!object) {
    546546            exit(EXIT_FAILURE);
     
    564564        }
    565565
    566         object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32);
     566        object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32, -16);
    567567        if (!object) {
    568568            exit(EXIT_FAILURE);
     
    586586        }
    587587
    588         object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string");
     588        object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16);
    589589        if (!object) {
    590590            exit(EXIT_FAILURE);
     
    608608        }
    609609
    610         object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string");
     610        object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string", -16);
    611611        if (!object) {
    612612            exit(EXIT_FAILURE);
     
    630630        }
    631631
    632         object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string");
     632        object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16);
    633633        if (!object) {
    634634            exit(EXIT_FAILURE);
     
    652652        }
    653653
    654         object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true);
     654        object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true, -16);
    655655        if (!object) {
    656656            exit(EXIT_FAILURE);
     
    674674        }
    675675
    676         object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true);
     676        object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true, -16);
    677677        if (!object) {
    678678            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r11077 r11113  
    10991099        bool            status;
    11001100
    1101         object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string");
     1101        object = detProcessedImfileRowAlloc(-32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16);
    11021102        if (!object) {
    11031103            exit(EXIT_FAILURE);
     
    11511151            exit(EXIT_FAILURE);
    11521152        }
     1153            psFree(md);
     1154            exit(EXIT_FAILURE);
     1155        }
    11531156
    11541157        psFree(md);
     
    11601163        bool            status;
    11611164
    1162         object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string");
     1165        object = detProcessedExpRowAlloc(-32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16);
    11631166        if (!object) {
    11641167            exit(EXIT_FAILURE);
     
    12041207            exit(EXIT_FAILURE);
    12051208        }
     1209            psFree(md);
     1210            exit(EXIT_FAILURE);
     1211        }
    12061212
    12071213        psFree(md);
     
    12131219        bool            status;
    12141220
    1215         object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64);
     1221        object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, -16);
    12161222        if (!object) {
    12171223            exit(EXIT_FAILURE);
     
    12571263            exit(EXIT_FAILURE);
    12581264        }
     1265            psFree(md);
     1266            exit(EXIT_FAILURE);
     1267        }
    12591268
    12601269        psFree(md);
     
    12661275        bool            status;
    12671276
    1268         object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32);
     1277        object = detNormalizedStatImfileRowAlloc(-32, -32, "a string", 32.32, -16);
    12691278        if (!object) {
    12701279            exit(EXIT_FAILURE);
     
    12941303            exit(EXIT_FAILURE);
    12951304        }
     1305            psFree(md);
     1306            exit(EXIT_FAILURE);
     1307        }
    12961308
    12971309        psFree(md);
     
    13031315        bool            status;
    13041316
    1305         object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string");
     1317        object = detNormalizedImfileRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16);
    13061318        if (!object) {
    13071319            exit(EXIT_FAILURE);
     
    13511363            exit(EXIT_FAILURE);
    13521364        }
     1365            psFree(md);
     1366            exit(EXIT_FAILURE);
     1367        }
    13531368
    13541369        psFree(md);
     
    13601375        bool            status;
    13611376
    1362         object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string");
     1377        object = detNormalizedExpRowAlloc(-32, -32, "a string", 64.64, 64.64, 64.64, "a string", "a string", -16);
    13631378        if (!object) {
    13641379            exit(EXIT_FAILURE);
     
    14041419            exit(EXIT_FAILURE);
    14051420        }
     1421            psFree(md);
     1422            exit(EXIT_FAILURE);
     1423        }
    14061424
    14071425        psFree(md);
     
    14131431        bool            status;
    14141432
    1415         object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string");
     1433        object = detResidImfileRowAlloc(-32, -32, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -16);
    14161434        if (!object) {
    14171435            exit(EXIT_FAILURE);
     
    14691487            exit(EXIT_FAILURE);
    14701488        }
     1489            psFree(md);
     1490            exit(EXIT_FAILURE);
     1491        }
    14711492
    14721493        psFree(md);
     
    14781499        bool            status;
    14791500
    1480         object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true);
     1501        object = detResidExpRowAlloc(-32, -32, "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", true, -16);
    14811502        if (!object) {
    14821503            exit(EXIT_FAILURE);
     
    15301551            exit(EXIT_FAILURE);
    15311552        }
     1553            psFree(md);
     1554            exit(EXIT_FAILURE);
     1555        }
    15321556
    15331557        psFree(md);
     
    15391563        bool            status;
    15401564
    1541         object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true);
     1565        object = detRunSummaryRowAlloc(-32, -32, 64.64, 64.64, 64.64, true, -16);
    15421566        if (!object) {
    15431567            exit(EXIT_FAILURE);
     
    15721596        }
    15731597        if (!psMetadataLookupBool(&status, md, "accept") == true) {
     1598            psFree(md);
     1599            exit(EXIT_FAILURE);
     1600        }
    15741601            psFree(md);
    15751602            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r11077 r11113  
    16971697            exit(EXIT_FAILURE);
    16981698        }
     1699            psFree(md);
     1700            exit(EXIT_FAILURE);
     1701        }
    16991702
    17001703        object = detProcessedImfileObjectFromMetadata(md);
     
    17461749            exit(EXIT_FAILURE);
    17471750        }
     1751            psFree(object);
     1752            exit(EXIT_FAILURE);
     1753        }
    17481754
    17491755        psFree(object);
     
    17871793            exit(EXIT_FAILURE);
    17881794        }
     1795            psFree(md);
     1796            exit(EXIT_FAILURE);
     1797        }
    17891798
    17901799        object = detProcessedExpObjectFromMetadata(md);
     
    18281837            exit(EXIT_FAILURE);
    18291838        }
     1839            psFree(object);
     1840            exit(EXIT_FAILURE);
     1841        }
    18301842
    18311843        psFree(object);
     
    18691881            exit(EXIT_FAILURE);
    18701882        }
     1883            psFree(md);
     1884            exit(EXIT_FAILURE);
     1885        }
    18711886
    18721887        object = detStackedImfileObjectFromMetadata(md);
     
    19101925            exit(EXIT_FAILURE);
    19111926        }
     1927            psFree(object);
     1928            exit(EXIT_FAILURE);
     1929        }
    19121930
    19131931        psFree(object);
     
    19351953            exit(EXIT_FAILURE);
    19361954        }
     1955            psFree(md);
     1956            exit(EXIT_FAILURE);
     1957        }
    19371958
    19381959        object = detNormalizedStatImfileObjectFromMetadata(md);
     
    19601981            exit(EXIT_FAILURE);
    19611982        }
     1983            psFree(object);
     1984            exit(EXIT_FAILURE);
     1985        }
    19621986
    19631987        psFree(object);
     
    20052029            exit(EXIT_FAILURE);
    20062030        }
     2031            psFree(md);
     2032            exit(EXIT_FAILURE);
     2033        }
    20072034
    20082035        object = detNormalizedImfileObjectFromMetadata(md);
     
    20502077            exit(EXIT_FAILURE);
    20512078        }
     2079            psFree(object);
     2080            exit(EXIT_FAILURE);
     2081        }
    20522082
    20532083        psFree(object);
     
    20912121            exit(EXIT_FAILURE);
    20922122        }
     2123            psFree(md);
     2124            exit(EXIT_FAILURE);
     2125        }
    20932126
    20942127        object = detNormalizedExpObjectFromMetadata(md);
     
    21322165            exit(EXIT_FAILURE);
    21332166        }
     2167            psFree(object);
     2168            exit(EXIT_FAILURE);
     2169        }
    21342170
    21352171        psFree(object);
     
    21852221            exit(EXIT_FAILURE);
    21862222        }
     2223            psFree(md);
     2224            exit(EXIT_FAILURE);
     2225        }
    21872226
    21882227        object = detResidImfileObjectFromMetadata(md);
     
    22382277            exit(EXIT_FAILURE);
    22392278        }
     2279            psFree(object);
     2280            exit(EXIT_FAILURE);
     2281        }
    22402282
    22412283        psFree(object);
     
    22872329            exit(EXIT_FAILURE);
    22882330        }
     2331            psFree(md);
     2332            exit(EXIT_FAILURE);
     2333        }
    22892334
    22902335        object = detResidExpObjectFromMetadata(md);
     
    23362381            exit(EXIT_FAILURE);
    23372382        }
     2383            psFree(object);
     2384            exit(EXIT_FAILURE);
     2385        }
    23382386
    23392387        psFree(object);
     
    23692417            exit(EXIT_FAILURE);
    23702418        }
     2419            psFree(md);
     2420            exit(EXIT_FAILURE);
     2421        }
    23712422
    23722423        object = detRunSummaryObjectFromMetadata(md);
     
    23992450        }
    24002451        if (!object->accept == true) {
     2452            psFree(object);
     2453            exit(EXIT_FAILURE);
     2454        }
    24012455            psFree(object);
    24022456            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.