IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 15, 2004, 10:14:44 AM (22 years ago)
Author:
harman
Message:

Added time init tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/astronomy/tst_psTime_04.c

    r2331 r2364  
    1 
    2 
    3 /** @file  tst_psTime_03.c
     1/** @file  tst_psTime_04.c
    42 *
    53 *  @brief Test driver for psTime functions
    64 *
    75 *  This test driver contains the following tests for psTime:
    8  *     Test A - Initialize time
    9  *     Test B - Attempt top open non-existant time config file
    10  *     Test D - Free data
     6 *      Test A - Initialize time
     7 *      Test B - Attempt to open non-existant time config file
     8 *      Test C - Attempt to open non-existant time data files
     9 *      Test D - Attempt to read incorrect number of files
     10 *      Test E - Attempt to read incorrect number of from values
     11 *      Test F - Attempt to read data file with typo in number
     12 *      Test G - Free data
    1113 *
    1214 *  @author  Ross Harman, MHPCC
    1315 *
    14  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    15  *  @date  $Date: 2004-11-10 23:40:04 $
     16 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     17 *  @date  $Date: 2004-11-15 20:14:44 $
    1618 *
    1719 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2527int main(int argc, char* argv[])
    2628{
    27 
    2829    // Test A - Initialize time
    2930    printPositiveTestHeader(stdout, "psTime", "Test A - Initialize time");
    3031    bool status = true;
    3132    status = psTimeInit("../../config/psTime.config");
     33    psTimeFinalize();
    3234    printFooter(stdout, "psTime", "Test A - Initialize time", true);
    3335
    3436
    35     // Test B - Attempt top open non-existant time config file
    36     printNegativeTestHeader(stdout,"psTime", "Test B - Attempt top open non-existant time config file",
     37    // Test B - Attempt to open non-existant time config file
     38    printNegativeTestHeader(stdout,"psTime", "Test B - Attempt to open non-existant time config file",
    3739                            "Failed to open file 'zzz'.  Check if it exists and it has the proper permissions.", 0);
    3840    status = psTimeInit("zzz");
    39     printFooter(stdout, "psTime", "Test B - Attempt top open non-existant time config file", true);
    40 
    41     // Test C - Attempt top open non-existant time data file
    42     printNegativeTestHeader(stdout,"psTime", "Test B - Attempt top open non-existant time config file",
    43                             "Failed to open file 'zzz'.  Check if it exists and it has the proper permissions.", 0);
    44     status = psTimeInit("./test.psTime.config");
    45     printFooter(stdout, "psTime", "Test B - Attempt top open non-existant time config file", true);
     41    printFooter(stdout, "psTime", "Test B - Attempt to open non-existant time config file", true);
    4642
    4743
    48     // Test D - Free data
    49     printPositiveTestHeader(stdout, "psTime", "Test D - Free data");
     44    // Test C - Attempt to open non-existant time data files
     45    printNegativeTestHeader(stdout,"psTime", "Test C - Attempt to open non-existant time data files",
     46                            "Failed to open file 'zzz'.  Check if it exists and it has the proper permissions.", 0);
     47    status = psTimeInit("./test.psTime.config1");
     48    psTimeFinalize();
     49    printFooter(stdout, "psTime", "Test C - Attempt to open non-existant time data files", true);
     50
     51
     52    // Test D - Attempt to read incorrect number of files
     53    printNegativeTestHeader(stdout,"psTime", "Test D - Attempt to read incorrect number of files",
     54                            "Incorrect number of table files entered. Found: 3. Expected: 4.", 0);
     55    status = psTimeInit("./test.psTime.config2");
     56    psTimeFinalize();
     57    printFooter(stdout, "psTime", "Test D - Attempt to read incorrect number of files", true);
     58
     59
     60    // Test E - Attempt to read incorrect number of from values
     61    printNegativeTestHeader(stdout,"psTime", "Test E - Attempt to read incorrect number of from values",
     62                            "Incorrect vector size. Size: 3, Expected 4.", 0);
     63    status = psTimeInit("./test.psTime.config3");
     64    psTimeFinalize();
     65    printFooter(stdout, "psTime", "Test E - Attempt to read incorrect number of from values", true);
     66
     67
     68    // Test F - Attempt to read data file with typo in number
     69    printNegativeTestHeader(stdout,"psTime", "Test F - Attempt to read data file with typo in number",
     70                            "Unable to parse string, number on line 16.", 0);
     71    status = psTimeInit("./test.psTime.config4");
     72    psTimeFinalize();
     73    printFooter(stdout, "psTime", "Test F - Attempt to read data file with typo in number", true);
     74
     75
     76    // Test G - Free data
     77    printPositiveTestHeader(stdout, "psTime", "Test G - Free data");
    5078    psTimeFinalize();
    5179    psMemCheckLeaks(0, NULL, stdout);
     
    5583        printf("ERROR: Found %d bad memory blocks\n", nBad);
    5684    }
    57     printFooter(stdout, "psTime", "Test D - Free data", true);
     85    printFooter(stdout, "psTime", "Test G - Free data", true);
     86
    5887    return 0;
    5988}
Note: See TracChangeset for help on using the changeset viewer.