Changeset 2364
- Timestamp:
- Nov 15, 2004, 10:14:44 AM (22 years ago)
- Location:
- trunk/psLib/test/astronomy
- Files:
-
- 6 added
- 1 edited
-
test.psTime.config (added)
-
test.psTime.config1 (added)
-
test.psTime.config2 (added)
-
test.psTime.config3 (added)
-
test.psTime.config4 (added)
-
test.ser7.dat (added)
-
tst_psTime_04.c (modified) (3 diffs)
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 4 2 * 5 3 * @brief Test driver for psTime functions 6 4 * 7 5 * 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 11 13 * 12 14 * @author Ross Harman, MHPCC 13 15 * 14 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-11-1 0 23:40:04 $16 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-11-15 20:14:44 $ 16 18 * 17 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 27 int main(int argc, char* argv[]) 26 28 { 27 28 29 // Test A - Initialize time 29 30 printPositiveTestHeader(stdout, "psTime", "Test A - Initialize time"); 30 31 bool status = true; 31 32 status = psTimeInit("../../config/psTime.config"); 33 psTimeFinalize(); 32 34 printFooter(stdout, "psTime", "Test A - Initialize time", true); 33 35 34 36 35 // Test B - Attempt to popen non-existant time config file36 printNegativeTestHeader(stdout,"psTime", "Test B - Attempt to popen 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", 37 39 "Failed to open file 'zzz'. Check if it exists and it has the proper permissions.", 0); 38 40 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); 46 42 47 43 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"); 50 78 psTimeFinalize(); 51 79 psMemCheckLeaks(0, NULL, stdout); … … 55 83 printf("ERROR: Found %d bad memory blocks\n", nBad); 56 84 } 57 printFooter(stdout, "psTime", "Test D - Free data", true); 85 printFooter(stdout, "psTime", "Test G - Free data", true); 86 58 87 return 0; 59 88 }
Note:
See TracChangeset
for help on using the changeset viewer.
