IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8026


Ignore:
Timestamp:
Jul 31, 2006, 4:12:32 PM (20 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.5

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/jhoblitt/ippdb/configure.ac

    r8020 r8026  
    11AC_PREREQ(2.59)
    22
    3 AC_INIT([ippdb], [0.0.4], [pan-starrs.ifa.hawaii.edu])
     3AC_INIT([ippdb], [0.0.5], [pan-starrs.ifa.hawaii.edu])
    44AC_CONFIG_SRCDIR([ippdb.pc.in])
    55
  • branches/jhoblitt/ippdb/src/ippdb.c

    r8020 r8026  
    46704670static void pzPendingImfileRowFree(pzPendingImfileRow *object);
    46714671
    4672 pzPendingImfileRow *pzPendingImfileRowAlloc(const char *exp_id, psS32 bytes, const char *md5sum, const char *class_id, const char *uri)
     4672pzPendingImfileRow *pzPendingImfileRowAlloc(const char *exp_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri)
    46734673{
    46744674    pzPendingImfileRow *object;
     
    46804680    object->bytes = bytes;
    46814681    object->md5sum = psStringCopy(md5sum);
     4682    object->class = psStringCopy(class);
    46824683    object->class_id = psStringCopy(class_id);
    46834684    object->uri = psStringCopy(uri);
     
    46904691    psFree(object->exp_id);
    46914692    psFree(object->md5sum);
     4693    psFree(object->class);
    46924694    psFree(object->class_id);
    46934695    psFree(object->uri);
     
    47204722        return false;
    47214723    }
     4724    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "64")) {
     4725        psError(PS_ERR_UNKNOWN, false, "failed to add item class");
     4726        psFree(md);
     4727        return false;
     4728    }
    47224729    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "64")) {
    47234730        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     
    47434750}
    47444751
    4745 bool pzPendingImfileInsert(psDB * dbh, const char *exp_id, psS32 bytes, const char *md5sum, const char *class_id, const char *uri)
     4752bool pzPendingImfileInsert(psDB * dbh, const char *exp_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri)
    47464753{
    47474754    psMetadata      *md;
     
    47644771        return false;
    47654772    }
     4773    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, class)) {
     4774        psError(PS_ERR_UNKNOWN, false, "failed to add item class");
     4775        psFree(md);
     4776        return false;
     4777    }
    47664778    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, class_id)) {
    47674779        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     
    47814793}
    47824794
    4783 bool pzPendingImfilePop(psDB *dbh, char **exp_id, psS32 *bytes, char **md5sum, char **class_id, char **uri)
     4795bool pzPendingImfilePop(psDB *dbh, char **exp_id, psS32 *bytes, char **md5sum, char **class, char **class_id, char **uri)
    47844796{
    47854797    psArray         *rowSet;
     
    48434855        return false;
    48444856    }
     4857    *class = psMetadataLookupPtr(&status, row, "class");
     4858    if (!status) {
     4859        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class");
     4860        psFree(row);
     4861        return false;
     4862    }
    48454863    *class_id = psMetadataLookupPtr(&status, row, "class_id");
    48464864    if (!status) {
     
    48634881bool pzPendingImfileInsertObject(psDB *dbh, pzPendingImfileRow *object)
    48644882{
    4865     return pzPendingImfileInsert(dbh, object->exp_id, object->bytes, object->md5sum, object->class_id, object->uri);
     4883    return pzPendingImfileInsert(dbh, object->exp_id, object->bytes, object->md5sum, object->class, object->class_id, object->uri);
    48664884}
    48674885
     
    48714889    psS32           bytes;
    48724890    char            md5sum[256];
     4891    char            class[256];
    48734892    char            class_id[256];
    48744893    char            uri[256];
    48754894
    4876     if (!pzPendingImfilePop(dbh, (char **)&exp_id, &bytes, (char **)&md5sum, (char **)&class_id, (char **)&uri)) {
     4895    if (!pzPendingImfilePop(dbh, (char **)&exp_id, &bytes, (char **)&md5sum, (char **)&class, (char **)&class_id, (char **)&uri)) {
    48774896        psError(PS_ERR_UNKNOWN, false, "failed to pop a database row");
    48784897        return NULL;
    48794898    }
    48804899
    4881     return pzPendingImfileRowAlloc(exp_id, bytes, md5sum, class_id, uri);
     4900    return pzPendingImfileRowAlloc(exp_id, bytes, md5sum, class, class_id, uri);
    48824901}
    48834902
     
    49935012        return NULL;
    49945013    }
     5014    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, object->class)) {
     5015        psError(PS_ERR_UNKNOWN, false, "failed to add item class");
     5016        psFree(md);
     5017        return NULL;
     5018    }
    49955019    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, object->class_id)) {
    49965020        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     
    50135037    psS32           bytes;
    50145038    char            *md5sum;
     5039    char            *class;
    50155040    char            *class_id;
    50165041    char            *uri;
     
    50315056        return false;
    50325057    }
     5058    class = psMetadataLookupPtr(&status, md, "class");
     5059    if (!status) {
     5060        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class");
     5061        return false;
     5062    }
    50335063    class_id = psMetadataLookupPtr(&status, md, "class_id");
    50345064    if (!status) {
     
    50425072    }
    50435073
    5044     return pzPendingImfileRowAlloc(exp_id, bytes, md5sum, class_id, uri);
     5074    return pzPendingImfileRowAlloc(exp_id, bytes, md5sum, class, class_id, uri);
    50455075}
    50465076psArray *pzPendingImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    55305560static void newImfileRowFree(newImfileRow *object);
    55315561
    5532 newImfileRow *newImfileRowAlloc(const char *exp_id, const char *class_id, const char *uri)
     5562newImfileRow *newImfileRowAlloc(const char *exp_id, const char *class, const char *class_id, const char *uri)
    55335563{
    55345564    newImfileRow    *object;
     
    55385568
    55395569    object->exp_id = psStringCopy(exp_id);
     5570    object->class = psStringCopy(class);
    55405571    object->class_id = psStringCopy(class_id);
    55415572    object->uri = psStringCopy(uri);
     
    55475578{
    55485579    psFree(object->exp_id);
     5580    psFree(object->class);
    55495581    psFree(object->class_id);
    55505582    psFree(object->uri);
     
    55675599        return false;
    55685600    }
     5601    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "64")) {
     5602        psError(PS_ERR_UNKNOWN, false, "failed to add item class");
     5603        psFree(md);
     5604        return false;
     5605    }
    55695606    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "64")) {
    55705607        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     
    55905627}
    55915628
    5592 bool newImfileInsert(psDB * dbh, const char *exp_id, const char *class_id, const char *uri)
     5629bool newImfileInsert(psDB * dbh, const char *exp_id, const char *class, const char *class_id, const char *uri)
    55935630{
    55945631    psMetadata      *md;
     
    56015638        return false;
    56025639    }
     5640    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, class)) {
     5641        psError(PS_ERR_UNKNOWN, false, "failed to add item class");
     5642        psFree(md);
     5643        return false;
     5644    }
    56035645    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, class_id)) {
    56045646        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     
    56185660}
    56195661
    5620 bool newImfilePop(psDB *dbh, char **exp_id, char **class_id, char **uri)
     5662bool newImfilePop(psDB *dbh, char **exp_id, char **class, char **class_id, char **uri)
    56215663{
    56225664    psArray         *rowSet;
     
    56685710        return false;
    56695711    }
     5712    *class = psMetadataLookupPtr(&status, row, "class");
     5713    if (!status) {
     5714        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class");
     5715        psFree(row);
     5716        return false;
     5717    }
    56705718    *class_id = psMetadataLookupPtr(&status, row, "class_id");
    56715719    if (!status) {
     
    56885736bool newImfileInsertObject(psDB *dbh, newImfileRow *object)
    56895737{
    5690     return newImfileInsert(dbh, object->exp_id, object->class_id, object->uri);
     5738    return newImfileInsert(dbh, object->exp_id, object->class, object->class_id, object->uri);
    56915739}
    56925740
     
    56945742{
    56955743    char            exp_id[256];
     5744    char            class[256];
    56965745    char            class_id[256];
    56975746    char            uri[256];
    56985747
    5699     if (!newImfilePop(dbh, (char **)&exp_id, (char **)&class_id, (char **)&uri)) {
     5748    if (!newImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)&uri)) {
    57005749        psError(PS_ERR_UNKNOWN, false, "failed to pop a database row");
    57015750        return NULL;
    57025751    }
    57035752
    5704     return newImfileRowAlloc(exp_id, class_id, uri);
     5753    return newImfileRowAlloc(exp_id, class, class_id, uri);
    57055754}
    57065755
     
    58065855        return NULL;
    58075856    }
     5857    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, object->class)) {
     5858        psError(PS_ERR_UNKNOWN, false, "failed to add item class");
     5859        psFree(md);
     5860        return NULL;
     5861    }
    58085862    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, object->class_id)) {
    58095863        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     
    58245878    bool            status;
    58255879    char            *exp_id;
     5880    char            *class;
    58265881    char            *class_id;
    58275882    char            *uri;
     
    58325887        return false;
    58335888    }
     5889    class = psMetadataLookupPtr(&status, md, "class");
     5890    if (!status) {
     5891        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class");
     5892        return false;
     5893    }
    58345894    class_id = psMetadataLookupPtr(&status, md, "class_id");
    58355895    if (!status) {
     
    58435903    }
    58445904
    5845     return newImfileRowAlloc(exp_id, class_id, uri);
     5905    return newImfileRowAlloc(exp_id, class, class_id, uri);
    58465906}
    58475907psArray *newImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    68816941static void rawImfileRowFree(rawImfileRow *object);
    68826942
    6883 rawImfileRow *rawImfileRowAlloc(const char *exp_id, const char *class_id, const char *uri, const char *stats)
     6943rawImfileRow *rawImfileRowAlloc(const char *exp_id, const char *class, const char *class_id, const char *uri, const char *stats)
    68846944{
    68856945    rawImfileRow    *object;
     
    68896949
    68906950    object->exp_id = psStringCopy(exp_id);
     6951    object->class = psStringCopy(class);
    68916952    object->class_id = psStringCopy(class_id);
    68926953    object->uri = psStringCopy(uri);
     
    68996960{
    69006961    psFree(object->exp_id);
     6962    psFree(object->class);
    69016963    psFree(object->class_id);
    69026964    psFree(object->uri);
     
    69206982        return false;
    69216983    }
     6984    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "64")) {
     6985        psError(PS_ERR_UNKNOWN, false, "failed to add item class");
     6986        psFree(md);
     6987        return false;
     6988    }
    69226989    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "64")) {
    69236990        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     
    69487015}
    69497016
    6950 bool rawImfileInsert(psDB * dbh, const char *exp_id, const char *class_id, const char *uri, const char *stats)
     7017bool rawImfileInsert(psDB * dbh, const char *exp_id, const char *class, const char *class_id, const char *uri, const char *stats)
    69517018{
    69527019    psMetadata      *md;
     
    69597026        return false;
    69607027    }
     7028    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, class)) {
     7029        psError(PS_ERR_UNKNOWN, false, "failed to add item class");
     7030        psFree(md);
     7031        return false;
     7032    }
    69617033    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, class_id)) {
    69627034        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     
    69817053}
    69827054
    6983 bool rawImfilePop(psDB *dbh, char **exp_id, char **class_id, char **uri, char **stats)
     7055bool rawImfilePop(psDB *dbh, char **exp_id, char **class, char **class_id, char **uri, char **stats)
    69847056{
    69857057    psArray         *rowSet;
     
    70317103        return false;
    70327104    }
     7105    *class = psMetadataLookupPtr(&status, row, "class");
     7106    if (!status) {
     7107        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class");
     7108        psFree(row);
     7109        return false;
     7110    }
    70337111    *class_id = psMetadataLookupPtr(&status, row, "class_id");
    70347112    if (!status) {
     
    70577135bool rawImfileInsertObject(psDB *dbh, rawImfileRow *object)
    70587136{
    7059     return rawImfileInsert(dbh, object->exp_id, object->class_id, object->uri, object->stats);
     7137    return rawImfileInsert(dbh, object->exp_id, object->class, object->class_id, object->uri, object->stats);
    70607138}
    70617139
     
    70637141{
    70647142    char            exp_id[256];
     7143    char            class[256];
    70657144    char            class_id[256];
    70667145    char            uri[256];
    70677146    char            stats[256];
    70687147
    7069     if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)&stats)) {
     7148    if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&stats)) {
    70707149        psError(PS_ERR_UNKNOWN, false, "failed to pop a database row");
    70717150        return NULL;
    70727151    }
    70737152
    7074     return rawImfileRowAlloc(exp_id, class_id, uri, stats);
     7153    return rawImfileRowAlloc(exp_id, class, class_id, uri, stats);
    70757154}
    70767155
     
    71767255        return NULL;
    71777256    }
     7257    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, object->class)) {
     7258        psError(PS_ERR_UNKNOWN, false, "failed to add item class");
     7259        psFree(md);
     7260        return NULL;
     7261    }
    71787262    if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, object->class_id)) {
    71797263        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     
    71997283    bool            status;
    72007284    char            *exp_id;
     7285    char            *class;
    72017286    char            *class_id;
    72027287    char            *uri;
     
    72087293        return false;
    72097294    }
     7295    class = psMetadataLookupPtr(&status, md, "class");
     7296    if (!status) {
     7297        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class");
     7298        return false;
     7299    }
    72107300    class_id = psMetadataLookupPtr(&status, md, "class_id");
    72117301    if (!status) {
     
    72247314    }
    72257315
    7226     return rawImfileRowAlloc(exp_id, class_id, uri, stats);
     7316    return rawImfileRowAlloc(exp_id, class, class_id, uri, stats);
    72277317}
    72287318psArray *rawImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • branches/jhoblitt/ippdb/src/ippdb.h

    r8020 r8026  
    19141914    psS32           bytes;
    19151915    char            *md5sum;
     1916    char            *class;
    19161917    char            *class_id;
    19171918    char            *uri;
     
    19271928    psS32           bytes,
    19281929    const char      *md5sum,
     1930    const char      *class,
    19291931    const char      *class_id,
    19301932    const char      *uri
     
    19611963    psS32           bytes,
    19621964    const char      *md5sum,
     1965    const char      *class,
    19631966    const char      *class_id,
    19641967    const char      *uri
     
    19751978    psS32           *bytes,
    19761979    char            **md5sum,
     1980    char            **class,
    19771981    char            **class_id,
    19781982    char            **uri
     
    22782282typedef struct {
    22792283    char            *exp_id;
     2284    char            *class;
    22802285    char            *class_id;
    22812286    char            *uri;
     
    22892294newImfileRow *newImfileRowAlloc(
    22902295    const char      *exp_id,
     2296    const char      *class,
    22912297    const char      *class_id,
    22922298    const char      *uri
     
    23212327    psDB            *dbh,               ///< Database handle
    23222328    const char      *exp_id,
     2329    const char      *class,
    23232330    const char      *class_id,
    23242331    const char      *uri
     
    23332340    psDB            *dbh,               ///< Database handle
    23342341    char            **exp_id,
     2342    char            **class,
    23352343    char            **class_id,
    23362344    char            **uri
     
    28352843typedef struct {
    28362844    char            *exp_id;
     2845    char            *class;
    28372846    char            *class_id;
    28382847    char            *uri;
     
    28472856rawImfileRow *rawImfileRowAlloc(
    28482857    const char      *exp_id,
     2858    const char      *class,
    28492859    const char      *class_id,
    28502860    const char      *uri,
     
    28802890    psDB            *dbh,               ///< Database handle
    28812891    const char      *exp_id,
     2892    const char      *class,
    28822893    const char      *class_id,
    28832894    const char      *uri,
     
    28932904    psDB            *dbh,               ///< Database handle
    28942905    char            **exp_id,
     2906    char            **class,
    28952907    char            **class_id,
    28962908    char            **uri,
  • branches/jhoblitt/ippdb/tests/alloc.c

    r8020 r8026  
    384384        pzPendingImfileRow *object;
    385385
    386         object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string"    );
     386        object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string", "a string"    );
    387387
    388388        if (!object) {
     
    402402            exit(EXIT_FAILURE);
    403403        }
     404        if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
     405            psFree(object);
     406            exit(EXIT_FAILURE);
     407        }
    404408        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
    405409            psFree(object);
     
    450454        newImfileRow    *object;
    451455
    452         object = newImfileRowAlloc("a string", "a string", "a string"    );
    453 
    454         if (!object) {
    455             exit(EXIT_FAILURE);
    456         }
    457 
    458         if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
     456        object = newImfileRowAlloc("a string", "a string", "a string", "a string"    );
     457
     458        if (!object) {
     459            exit(EXIT_FAILURE);
     460        }
     461
     462        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
     463            psFree(object);
     464            exit(EXIT_FAILURE);
     465        }
     466        if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
    459467            psFree(object);
    460468            exit(EXIT_FAILURE);
     
    557565        rawImfileRow    *object;
    558566
    559         object = rawImfileRowAlloc("a string", "a string", "a string", "a string"    );
    560 
    561         if (!object) {
    562             exit(EXIT_FAILURE);
    563         }
    564 
    565         if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
     567        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string"    );
     568
     569        if (!object) {
     570            exit(EXIT_FAILURE);
     571        }
     572
     573        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
     574            psFree(object);
     575            exit(EXIT_FAILURE);
     576        }
     577        if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
    566578            psFree(object);
    567579            exit(EXIT_FAILURE);
  • branches/jhoblitt/ippdb/tests/insert.c

    r8020 r8026  
    163163        }
    164164
    165         if (!pzPendingImfileInsert(dbh, "a string", -32, "a string", "a string", "a string")) {
     165        if (!pzPendingImfileInsert(dbh, "a string", -32, "a string", "a string", "a string", "a string")) {
    166166            exit(EXIT_FAILURE);
    167167        }
     
    193193        }
    194194
    195         if (!newImfileInsert(dbh, "a string", "a string", "a string")) {
     195        if (!newImfileInsert(dbh, "a string", "a string", "a string", "a string")) {
    196196            exit(EXIT_FAILURE);
    197197        }
     
    238238        }
    239239
    240         if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string")) {
     240        if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string")) {
    241241            exit(EXIT_FAILURE);
    242242        }
  • branches/jhoblitt/ippdb/tests/insertobject.c

    r8020 r8026  
    234234        }
    235235
    236         object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string");
     236        object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string", "a string");
    237237        if (!object) {
    238238            exit(EXIT_FAILURE);
     
    278278        }
    279279
    280         object = newImfileRowAlloc("a string", "a string", "a string");
     280        object = newImfileRowAlloc("a string", "a string", "a string", "a string");
    281281        if (!object) {
    282282            exit(EXIT_FAILURE);
     
    344344        }
    345345
    346         object = rawImfileRowAlloc("a string", "a string", "a string", "a string");
     346        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string");
    347347        if (!object) {
    348348            exit(EXIT_FAILURE);
  • branches/jhoblitt/ippdb/tests/metadatafromobject.c

    r8020 r8026  
    467467        bool            status;
    468468
    469         object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string");
     469        object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string", "a string");
    470470        if (!object) {
    471471            exit(EXIT_FAILURE);
     
    491491            exit(EXIT_FAILURE);
    492492        }
     493        if (strncmp(psMetadataLookupPtr(&status, md, "class"), "a string", MAX_STRING_LENGTH)) {
     494            psFree(md);
     495            exit(EXIT_FAILURE);
     496        }
    493497        if (strncmp(psMetadataLookupPtr(&status, md, "class_id"), "a string", MAX_STRING_LENGTH)) {
    494498            psFree(md);
     
    549553        bool            status;
    550554
    551         object = newImfileRowAlloc("a string", "a string", "a string");
     555        object = newImfileRowAlloc("a string", "a string", "a string", "a string");
    552556        if (!object) {
    553557            exit(EXIT_FAILURE);
     
    565569            exit(EXIT_FAILURE);
    566570        }
     571        if (strncmp(psMetadataLookupPtr(&status, md, "class"), "a string", MAX_STRING_LENGTH)) {
     572            psFree(md);
     573            exit(EXIT_FAILURE);
     574        }
    567575        if (strncmp(psMetadataLookupPtr(&status, md, "class_id"), "a string", MAX_STRING_LENGTH)) {
    568576            psFree(md);
     
    680688        bool            status;
    681689
    682         object = rawImfileRowAlloc("a string", "a string", "a string", "a string");
     690        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string");
    683691        if (!object) {
    684692            exit(EXIT_FAILURE);
     
    693701
    694702        if (strncmp(psMetadataLookupPtr(&status, md, "exp_id"), "a string", MAX_STRING_LENGTH)) {
     703            psFree(md);
     704            exit(EXIT_FAILURE);
     705        }
     706        if (strncmp(psMetadataLookupPtr(&status, md, "class"), "a string", MAX_STRING_LENGTH)) {
    695707            psFree(md);
    696708            exit(EXIT_FAILURE);
  • branches/jhoblitt/ippdb/tests/objectfrommetadata.c

    r8020 r8026  
    693693            exit(EXIT_FAILURE);
    694694        }
     695        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "a string")) {
     696            psFree(md);
     697            exit(EXIT_FAILURE);
     698        }
    695699        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
    696700            psFree(md);
     
    722726            exit(EXIT_FAILURE);
    723727        }
     728        if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
     729            psFree(object);
     730            exit(EXIT_FAILURE);
     731        }
    724732        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
    725733            psFree(object);
     
    801809            exit(EXIT_FAILURE);
    802810        }
     811        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "a string")) {
     812            psFree(md);
     813            exit(EXIT_FAILURE);
     814        }
    803815        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
    804816            psFree(md);
     
    822834            exit(EXIT_FAILURE);
    823835        }
     836        if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
     837            psFree(object);
     838            exit(EXIT_FAILURE);
     839        }
    824840        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
    825841            psFree(object);
     
    9911007            exit(EXIT_FAILURE);
    9921008        }
     1009        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "a string")) {
     1010            psFree(md);
     1011            exit(EXIT_FAILURE);
     1012        }
    9931013        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
    9941014            psFree(md);
     
    10131033
    10141034        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
     1035            psFree(object);
     1036            exit(EXIT_FAILURE);
     1037        }
     1038        if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
    10151039            psFree(object);
    10161040            exit(EXIT_FAILURE);
  • branches/jhoblitt/ippdb/tests/pop.c

    r8020 r8026  
    221221        psS32           bytes;
    222222        char            md5sum[256];
    223         char            class_id[256];
    224         char            uri[256];
    225 
    226         dbh = psDBInit("localhost", "test", NULL, "test");
    227         if (!dbh) {
    228             exit(EXIT_FAILURE);
    229         }
    230 
    231         if (!pzPendingImfilePop(dbh, (char **)&exp_id, &bytes, (char **)&md5sum, (char **)&class_id, (char **)&uri)) {
     223        char            class[256];
     224        char            class_id[256];
     225        char            uri[256];
     226
     227        dbh = psDBInit("localhost", "test", NULL, "test");
     228        if (!dbh) {
     229            exit(EXIT_FAILURE);
     230        }
     231
     232        if (!pzPendingImfilePop(dbh, (char **)&exp_id, &bytes, (char **)&md5sum, (char **)&class, (char **)&class_id, (char **)&uri)) {
    232233            exit(EXIT_FAILURE);
    233234        }
     
    259260        psDB            *dbh;
    260261        char            exp_id[256];
    261         char            class_id[256];
    262         char            uri[256];
    263 
    264         dbh = psDBInit("localhost", "test", NULL, "test");
    265         if (!dbh) {
    266             exit(EXIT_FAILURE);
    267         }
    268 
    269         if (!newImfilePop(dbh, (char **)&exp_id, (char **)&class_id, (char **)&uri)) {
     262        char            class[256];
     263        char            class_id[256];
     264        char            uri[256];
     265
     266        dbh = psDBInit("localhost", "test", NULL, "test");
     267        if (!dbh) {
     268            exit(EXIT_FAILURE);
     269        }
     270
     271        if (!newImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)&uri)) {
    270272            exit(EXIT_FAILURE);
    271273        }
     
    321323        psDB            *dbh;
    322324        char            exp_id[256];
    323         char            class_id[256];
    324         char            uri[256];
    325         char            stats[256];
    326 
    327         dbh = psDBInit("localhost", "test", NULL, "test");
    328         if (!dbh) {
    329             exit(EXIT_FAILURE);
    330         }
    331 
    332         if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)&stats)) {
     325        char            class[256];
     326        char            class_id[256];
     327        char            uri[256];
     328        char            stats[256];
     329
     330        dbh = psDBInit("localhost", "test", NULL, "test");
     331        if (!dbh) {
     332            exit(EXIT_FAILURE);
     333        }
     334
     335        if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&stats)) {
    333336            exit(EXIT_FAILURE);
    334337        }
  • trunk/ippdb/configure.ac

    r8022 r8026  
    11AC_PREREQ(2.59)
    22
    3 AC_INIT([ippdb], [0.0.4], [pan-starrs.ifa.hawaii.edu])
     3AC_INIT([ippdb], [0.0.5], [pan-starrs.ifa.hawaii.edu])
    44AC_CONFIG_SRCDIR([ippdb.pc.in])
    55
Note: See TracChangeset for help on using the changeset viewer.