IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8694 for trunk/psLib/src/types


Ignore:
Timestamp:
Aug 29, 2006, 2:54:51 PM (20 years ago)
Author:
drobbin
Message:

edited psMetadataCopy for errorhandling of out param. Edited tests for coverage. Added array to execute_tap.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psMetadata.c

    r8668 r8694  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.130 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-08-29 20:23:54 $
     14 *  @version $Revision: 1.131 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-08-30 00:54:51 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    376376            psVector *vecCopy = psVectorCopy(NULL, (psVector*)(in->data.V),
    377377                                             ((psVector*)(in->data.V))->type.type);
    378             //Following condition was removed b/c it doesn't seem possible for a
    379             //non-NULL vector to be returned for non-NULL input
    380             //            if (vecCopy == NULL) {
    381             //                psError(PS_ERR_BAD_PARAMETER_NULL, false,
    382             //                        "Error copying vector.  Vector skipped.\n");
    383             //            } else {
    384378            newItem = psMetadataItemAlloc(in->name, PS_DATA_VECTOR, in->comment, vecCopy);
    385379            psFree(vecCopy);    // Drop reference
    386             //            }
    387380            break;
    388381        }
     
    425418                           const psMetadata *in)
    426419{
    427     PS_ASSERT_PTR_NON_NULL(in,NULL);
    428     PS_ASSERT_PTR_NON_NULL(in->list,NULL);
     420    //    PS_ASSERT_PTR_NON_NULL(in,NULL);
     421    if (in == NULL) {
     422        if (out != NULL) {
     423            psFree(out);
     424            out = NULL;
     425        }
     426        return out;
     427    }
     428    //    PS_ASSERT_PTR_NON_NULL(in->list,NULL);
     429    if (in->list == NULL) {
     430        if (out != NULL) {
     431            psFree(out);
     432            out = NULL;
     433        }
     434        return out;
     435    }
     436
    429437    if (out ==  NULL) {
    430438        out = psMetadataAlloc();
     
    447455            psErrorStackPrint(stderr, "Error copying %s (%s) in the metadata\n", inItem->name,
    448456                              inItem->comment);
     457            psFree(newItem);
     458            psFree(iter);
     459            psFree(out);
     460            out = NULL;
     461            return out;
    449462        }
    450463        psFree(newItem);                // Drop reference
Note: See TracChangeset for help on using the changeset viewer.