IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 31, 2005, 12:02:28 PM (21 years ago)
Author:
evanalst
Message:

Updates to time functions for SDR-14.

File:
1 edited

Legend:

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

    r3682 r4059  
    1313 *
    1414 *  @author  Ross Harman, MHPCC
     15 *  @author  Eric Van Alst, MHPCC
    1516 *
    16  *  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
    17  *  @date  $Date: 2005-04-07 20:27:41 $
     17 *  @version $Revision: 1.12 $  $Name: not supported by cvs2svn $
     18 *  @date  $Date: 2005-05-31 22:02:25 $
    1819 *
    1920 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2526#include "psTest.h"
    2627
     28static psS32 testTimeInit1(void);
     29static psS32 testTimeInit2(void);
     30static psS32 testTimeInit3(void);
     31static psS32 testTimeInit4(void);
     32static psS32 testTimeInit5(void);
     33static psS32 testTimeInit6(void);
    2734
    28 int main(int argc, char* argv[])
     35testDescription tests[] = {
     36                              {testTimeInit1,000,"p_psTimeInit",0,false},
     37                              {testTimeInit2,000,"p_psTimeInit",0,false},
     38                              {testTimeInit3,000,"p_psTimeInit",0,false},
     39                              {testTimeInit4,000,"p_psTimeInit",0,false},
     40                              {testTimeInit5,000,"p_psTimeInit",0,false},
     41                              {testTimeInit6,000,"p_psTimeInit",0,false},
     42                              {NULL}
     43                          };
     44
     45psS32 main(psS32 argc, char* argv[])
    2946{
    30     // Test A - Initialize time
    31     printPositiveTestHeader(stdout, "psTime", "Test A - Initialize time");
    32     psLibInit(true, "psTime.config");
    33     psLibFinalize();
    34     printFooter(stdout, "psTime", "Test A - Initialize time", true);
    35 
    36 
    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",
    39                             "Failed to open file 'zzz'.  Check if it exists and it has the proper permissions.", 0);
    40     psLibInit(true, "zzz");
    41     printFooter(stdout, "psTime", "Test B - Attempt to open non-existant time config file", true);
    42 
    43 
    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     psLibInit(true, "test.psTime.config1");
    48     psLibFinalize();
    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     psLibInit(true, "test.psTime.config2");
    56     psLibFinalize();
    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     psLibInit(true, "test.psTime.config3");
    64     psLibFinalize();
    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     psLibInit(true, "test.psTime.config4");
    72     psLibFinalize();
    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");
    78     psLibFinalize();
    79     if( psMemCheckLeaks(0, NULL, stdout,false) != 0 ) {
    80         psError(PS_ERR_UNKNOWN,true,"Memory leak detected.");
    81         return 10;
     47    if(!runTestSuite(stderr,"psTime",tests,argc,argv)) {
     48        return 1;
    8249    }
    83     psMemCheckCorruption(0);
    84     int nBad = psMemCheckCorruption(0);
    85     if(nBad) {
    86         printf("ERROR: Found %d bad memory blocks\n", nBad);
    87     }
    88     printFooter(stdout, "psTime", "Test G - Free data", true);
    8950
    9051    return 0;
    9152}
    9253
     54psS32 testTimeInit1(void)
     55{
     56    // Test A - Initialize time
     57    psLibInit(true, "psTime.config");
     58    psLibFinalize();
     59
     60    return 0;
     61}
     62
     63psS32 testTimeInit2(void)
     64{
     65    // Test B - Attempt to open non-existant time config file
     66    psLibInit(true, "zzz");
     67
     68    return 0;
     69}
     70
     71psS32 testTimeInit3(void)
     72{
     73    // Test C - Attempt to open non-existant time data files
     74    psLibInit(true, "test.psTime.config1");
     75    psLibFinalize();
     76
     77    return 0;
     78}
     79
     80psS32 testTimeInit4(void)
     81{
     82    // Test D - Attempt to read incorrect number of files
     83    psLibInit(true, "test.psTime.config2");
     84    psLibFinalize();
     85
     86    return 0;
     87}
     88
     89psS32 testTimeInit5(void)
     90{
     91    // Test E - Attempt to read incorrect number of from values
     92    psLibInit(true, "test.psTime.config3");
     93    psLibFinalize();
     94
     95    return 0;
     96}
     97
     98psS32 testTimeInit6(void)
     99{
     100    // Test F - Attempt to read data file with typo in number
     101    psLibInit(true, "test.psTime.config4");
     102    psLibFinalize();
     103
     104    return 0;
     105}
     106
Note: See TracChangeset for help on using the changeset viewer.