Changeset 17515 for trunk/psLib/test/sys
- Timestamp:
- May 4, 2008, 2:09:04 PM (18 years ago)
- Location:
- trunk/psLib/test/sys
- Files:
-
- 3 edited
-
tap_psError.c (modified) (9 diffs)
-
tap_psString.c (modified) (3 diffs)
-
tap_psTrace.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sys/tap_psError.c
r13084 r17515 5 5 * @author Eric Van Alst, MHPCC 6 6 * 7 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $8 * @date $Date: 200 7-05-01 00:08:52$7 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-05-05 00:09:04 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 19 19 #include "pstap.h" 20 20 21 // XXX in this file, several operations are only validated by printing an output to the screen. 22 // we should define an output file and compare the contents of the output file to expectations. 23 // I've commented out these features for now 24 25 # if (0) 21 26 // Function used in testError02 to verify the psErrorStackPrintV function 22 27 static void myErrorStackPrint( … … 32 37 va_end(ap); 33 38 } 34 39 # endif 35 40 36 41 psS32 main( psS32 argc, char* argv[] ) … … 83 88 psErrorCode code=PS_ERR_BAD_PARAMETER_VALUE; 84 89 ok(psError(code, true, "Error code = %d", code) == code, "Failed return value verify."); 85 psErrorStackPrint(stderr,"ERROR STACK PRINT Test1A");90 // psErrorStackPrint(stderr,"ERROR STACK PRINT Test1A"); 86 91 ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks"); 87 92 } … … 94 99 ok(psError(code+1, true, "Error code = %d", code+1) == code+1, 95 100 "Failed return with empty string."); 96 psErrorStackPrint(stderr,"ERROR STACK PRINT Test1B");101 // psErrorStackPrint(stderr,"ERROR STACK PRINT Test1B"); 97 102 ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks"); 98 103 } … … 104 109 ok(psError(-1, true, "Error code = %d", -1) == -1, 105 110 "Failed return with undefined code."); 106 psErrorStackPrint(stderr,"ERROR STACK PRINT Test1D");111 // psErrorStackPrint(stderr,"ERROR STACK PRINT Test1D"); 107 112 ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks"); 108 113 } … … 115 120 ok(psError(code, false, "Error code = %d", code) == code, 116 121 "Failed return with false new arg."); 117 psErrorStackPrint(stderr,"ERROR STACK PRINT Test1E");122 // psErrorStackPrint(stderr,"ERROR STACK PRINT Test1E"); 118 123 ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks"); 119 124 } … … 124 129 psMemId id = psMemGetId(); 125 130 ok(psError(9, true, "Errno code = %d", 9) == 9, "Error Code" ); 126 psErrorStackPrint(stderr,"ERROR STACK PRINT Test1F");131 // psErrorStackPrint(stderr,"ERROR STACK PRINT Test1F"); 127 132 ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks"); 128 133 } … … 138 143 ok(psError(code, true, "Error code = %d", code) == code, 139 144 "Failed return value verify."); 140 myErrorStackPrint(stderr,"ERROR STACK PRINT Test%dA",2);145 // myErrorStackPrint(stderr,"ERROR STACK PRINT Test%dA",2); 141 146 ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks"); 142 147 } -
trunk/psLib/test/sys/tap_psString.c
r13799 r17515 20 20 * @author Eric Van Alst, MHPCC 21 21 * 22 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $23 * @date $Date: 200 7-06-13 23:32:11$22 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 23 * @date $Date: 2008-05-05 00:09:04 $ 24 24 * 25 25 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 38 38 psLogSetFormat("HLNM"); 39 39 psLogSetLevel(PS_LOG_INFO); 40 plan_tests(6 8);40 plan_tests(65); 41 41 42 42 … … 455 455 psFree(str); 456 456 457 char charStr[10]; 458 ok(!psMemCheckType(PS_DATA_STRING, charStr), 459 "Input string is a psDataType"); 457 // XXX EAM this function raises an abort since we are trying to test a non-psLib memory block 458 // char charStr[10]; 459 // ok(!psMemCheckType(PS_DATA_STRING, charStr), "Input string is a psDataType"); 460 460 461 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 461 462 } -
trunk/psLib/test/sys/tap_psTrace.c
r12781 r17515 19 19 plan_tests(54); 20 20 21 # define DEBUG 1 22 # if (DEBUG) 23 FILE *output = fopen ("/dev/null", "w"); 24 int outFD = fileno (output); 25 # else 26 int outFD = 2; 27 # endif 28 21 29 // testTrace00() 22 30 { 23 31 psMemId id = psMemGetId(); 24 32 psS32 lev = 0; 25 (void)psTraceSetDestination( 2);33 (void)psTraceSetDestination(outFD); 26 34 for (int i=0;i<10;i++) { 27 35 (void)psTraceSetLevel(".", i); … … 58 66 { 59 67 psMemId id = psMemGetId(); 60 (void)psTraceSetDestination( 2);68 (void)psTraceSetDestination(outFD); 61 69 (void)psTraceSetLevel(".A.B.C.D.E", 5); 62 70 psTrace(".A.C.D.C",1,"You should not see this"); … … 72 80 psMemId id = psMemGetId(); 73 81 psTraceReset(); 74 (void)psTraceSetDestination( 2);82 (void)psTraceSetDestination(outFD); 75 83 (void)psTraceSetLevel(".A.B", 2); 76 84 (void)psTraceSetLevel(".A.B.C.D.E", 5); … … 97 105 { 98 106 psMemId id = psMemGetId(); 99 (void)psTraceSetDestination( 2);107 (void)psTraceSetDestination(outFD); 100 108 101 109 for (int i=0;i<10;i++) { … … 134 142 for (int nb = 0 ; nb<4;nb++) { 135 143 if (nb == 0) 136 (void)psTraceSetDestination( 1);144 (void)psTraceSetDestination(((outFD == 2) ? 1 : outFD)); 137 145 if (nb == 1) 138 (void)psTraceSetDestination( 2);146 (void)psTraceSetDestination(((outFD == 2) ? 2 : outFD)); 139 147 if (nb == 2) 140 (void)psTraceSetDestination( 0);148 (void)psTraceSetDestination(((outFD == 2) ? 0 : outFD)); 141 149 if (nb == 3) 142 150 (void)psTraceSetDestination(FD); … … 174 182 { 175 183 psMemId id = psMemGetId(); 176 (void)psTraceSetDestination( 2);184 (void)psTraceSetDestination(outFD); 177 185 (void)psTraceSetLevel(".", 9); 178 186 (void)psTraceSetLevel(".a", 8); … … 213 221 { 214 222 psMemId id = psMemGetId(); 215 (void)psTraceSetDestination( 2);223 (void)psTraceSetDestination(outFD); 216 224 (void)psTraceSetLevel(".", 9); 217 225 (void)psTraceSetLevel(".a", 8); … … 287 295 ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks"); 288 296 } 297 298 # if (DEBUG) 299 close (outFD); 300 # endif 301 289 302 }
Note:
See TracChangeset
for help on using the changeset viewer.
