#include <pslib.h>
#include <ippdb.h>
#include <stdlib.h>
#include <string.h>

#define MAX_STRING_LENGTH 1024

int main ()
{
    {
        psMetadata      *md;
        weatherRow      *object;

        md = psMetadataAlloc();
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "temp01", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "humi01", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "temp02", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "humi02", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "temp03", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "humi03", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "pressure", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = weatherObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->temp01 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->humi01 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->temp02 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->humi02 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->temp03 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->humi03 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->pressure == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        skyp_transparencyRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "filter", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "trans", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "nstars", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "ra", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "decl", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "exptime", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "sky_bright", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = skyp_transparencyObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->trans == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->nstars == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->ra == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->decl == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->exptime == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->sky_bright == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        skyp_absorptionRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "disperser_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "atmcomp1", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "atmcomp2", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "atmcomp3", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "nstars", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "ra", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "decl", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "exptime", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "sky_bright", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = skyp_absorptionObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->disperser_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->atmcomp1 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->atmcomp2 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->atmcomp3 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->nstars == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->ra == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->decl == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->exptime == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->sky_bright == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        skyp_emissionRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "disperser_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "atmcomp1", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "atmcomp2", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "atmcomp3", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "continuum", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "exptime", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = skyp_emissionObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->disperser_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->atmcomp1 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->atmcomp2 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->atmcomp3 == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->continuum == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->exptime == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        dimmRow         *object;

        md = psMetadataAlloc();
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "sigmax", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "sigmay", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "fwhm", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "ra", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "decl", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "expttime", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "telescope_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = dimmObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->sigmax == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->sigmay == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->fwhm == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->ra == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->decl == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->expttime == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->telescope_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        skyp_irRow      *object;

        md = psMetadataAlloc();
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "sky_bright", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "sky_var", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "ra", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "decl", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "fov_x", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "fov_y", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = skyp_irObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->sky_bright == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->sky_var == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->ra == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->decl == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->fov_x == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->fov_y == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        domeRow         *object;

        md = psMetadataAlloc();
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "az", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAdd(md, PS_LIST_TAIL, "open", PS_DATA_BOOL, NULL, true)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAdd(md, PS_LIST_TAIL, "light", PS_DATA_BOOL, NULL, true)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAdd(md, PS_LIST_TAIL, "track", PS_DATA_BOOL, NULL, true)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = domeObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->az == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->open == true) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->light == true) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->track == true) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        telescopeRow    *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "guide", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "alt", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF32(md, PS_LIST_TAIL, "az", 0, NULL, 32.32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "ra", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddF64(md, PS_LIST_TAIL, "decl", 0, NULL, 64.64)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = telescopeObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->guide, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->alt == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->az == 32.32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->ra == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->decl == 64.64) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        summitExpRow    *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "camera", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "telescope", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = summitExpObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        pzPendingExpRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "camera", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "telescope", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "imfiles", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = pzPendingExpObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->imfiles == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        pzPendingImfileRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "bytes", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "md5sum", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = pzPendingImfileObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->bytes == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->md5sum, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        newExpRow       *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "camera", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "telescope", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "imfiles", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = newExpObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->imfiles == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        newImfileRow    *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = newImfileObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        rawDetrendExpRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "camera", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "telescope", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "imfiles", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "filter", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = rawDetrendExpObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->imfiles == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        rawScienceExpRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "camera", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "telescope", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "imfiles", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "filter", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = rawScienceExpObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->imfiles == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        rawImfileRow    *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = rawImfileObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        p1PendingExpRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "camera", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "telescope", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "imfiles", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "filter", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "p1_version", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = p1PendingExpObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->imfiles == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->p1_version == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        p2PendingExpRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "camera", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "telescope", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "imfiles", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "filter", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "p1_version", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "p2_version", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = p2PendingExpObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->imfiles == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->p1_version == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->p2_version == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        p2PendingImfileRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "p1_version", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "p2_version", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = p2PendingImfileObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->p1_version == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->p2_version == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        p2DoneExpRow    *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "camera", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "telescope", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "imfiles", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "filter", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "p1_version", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "p2_version", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = p2DoneExpObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->imfiles == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->p1_version == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->p2_version == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        p2DoneImfileRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "p1_version", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "p2_version", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = p2DoneImfileObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->p1_version == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->p2_version == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        p3PendingExpRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "camera", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "imfiles", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "filter", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "p2_version", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "p3_version", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = p3PendingExpObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->imfiles == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->p2_version == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->p3_version == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        detRunRow       *object;

        md = psMetadataAlloc();
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "det_type", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = detRunObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (strncmp(object->det_type, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        detInputExpRow  *object;

        md = psMetadataAlloc();
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "det_id", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "camera", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "telescope", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_type", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "imfiles", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "filter", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = detInputExpObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->det_id == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->iteration == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->camera, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->telescope, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->imfiles == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->filter, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        detProcessedImfileRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "det_id", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = detProcessedImfileObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->det_id == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        detStackedImfileRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "det_id", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = detStackedImfileObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->det_id == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->iteration == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        detNormalizedImfileRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "det_id", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = detNormalizedImfileObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->det_id == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->iteration == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        detMasterFrameRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "det_id", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "comment", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = detMasterFrameObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->det_id == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->iteration == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->comment, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        detMasterImfileRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "det_id", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = detMasterImfileObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->det_id == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        detResidImfileAnalysisRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "det_id", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = detResidImfileAnalysisObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->det_id == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->iteration == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    {
        psMetadata      *md;
        detResidExpAnalysisRow *object;

        md = psMetadataAlloc();
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "det_id", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, -32)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "stats", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
            psFree(md);
            exit(EXIT_FAILURE);
        }
        if (!psMetadataAdd(md, PS_LIST_TAIL, "accept", PS_DATA_BOOL, NULL, true)) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        object = detResidExpAnalysisObjectFromMetadata(md);
        if (!object) {
            psFree(md);
            exit(EXIT_FAILURE);
        }

        psFree(md);

        if (!object->det_id == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->iteration == -32) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->stats, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
            psFree(object);
            exit(EXIT_FAILURE);
        }
        if (!object->accept == true) {
            psFree(object);
            exit(EXIT_FAILURE);
        }

        psFree(object);
    }

    exit(EXIT_SUCCESS);
}
