IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 1, 2006, 2:55:23 PM (20 years ago)
Author:
Paul Price
Message:

Addition of a vast quantity of assertions in public functions. Adopted a policy of using assert() within file-static functions (since they are only called internally, any errors there are problems with the program) and using the PS_ASSERT_WHATEVER() macros within public functions. Cleaned a few things up in the process.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAConstruct.c

    r7168 r7278  
    2121                              )
    2222{
     23    assert(format);
     24    assert(cellName && strlen(cellName) > 0);
     25
    2326    bool status = true;                 // Result of MD lookup
    2427    psMetadata *cells = psMetadataLookupMD(&status, format, "CELLS"); // The CELLS
     
    4346                        )
    4447{
     48    assert(first);
     49    assert(second);
     50    assert(third);
     51    assert(string && strlen(string) > 0);
     52
    4553    bool allOK = true;                  // Everything was OK?
    4654    psList *values = psStringSplit(string, " ,;", true); // List of the parts
     
    96104                                 )
    97105{
     106    assert(name && strlen(name) > 0);
     107    assert(fileInfo);
     108    assert(header);
     109
    98110    bool mdok = true;                   // Result of MD lookup
    99111    psString keyword = psMetadataLookupStr(&mdok, fileInfo, name);
     
    188200                             )
    189201{
     202    assert(fileInfo);
     203    assert(contents);
     204    assert(header);
     205
    190206    bool mdok = true;                   // Status of MD lookup
    191207    const char *contentHeaders = psMetadataLookupStr(&mdok, fileInfo, "CONTENT"); // Headers for content
     
    237253    assert(contents && strlen(contents) > 0);
    238254    assert(!cell || (cell && chip));    // Need both chip and cell if given a cell
     255    assert(format);
    239256
    240257    if (hdu && level == PM_FPA_LEVEL_FPA) {
     
    329346                          )
    330347{
     348    assert(format);
     349
    331350    bool mdok = true;                   // Status of MD lookup
    332351    psMetadata *file = psMetadataLookupMD(&mdok, format, "FILE"); // File information
     
    363382                     )
    364383{
     384    PS_ASSERT_PTR_NON_NULL(camera, NULL);
     385
    365386    pmFPA *fpa = pmFPAAlloc(camera);    // The FPA to fill out
    366387
     
    400421                           )
    401422{
    402     assert(fpa);
    403     assert(phuView);
    404     assert(format);
     423    PS_ASSERT_PTR_NON_NULL(fpa, false);
     424    PS_ASSERT_PTR_NON_NULL(phuView, false);
     425    PS_ASSERT_PTR_NON_NULL(format, false);
    405426
    406427    // Where does the PHU go?
     
    495516                                   )
    496517{
    497     assert(fpa);
    498     assert(phu);
    499     assert(format);
     518    PS_ASSERT_PTR_NON_NULL(fpa, NULL);
     519    PS_ASSERT_PTR_NON_NULL(phu, NULL);
     520    PS_ASSERT_PTR_NON_NULL(format, NULL);
    500521
    501522    bool mdok = true;                   // Status from metadata lookups
     
    689710               )
    690711{
     712    PS_ASSERT_PTR_NON_NULL(fpa,);
     713
    691714    psTrace(__func__, 1, "FPA:\n");
    692715    if (fpa->hdu) {
Note: See TracChangeset for help on using the changeset viewer.