Changeset 584
- Timestamp:
- May 5, 2004, 2:20:50 PM (22 years ago)
- Location:
- trunk/psLib/test/sysUtils
- Files:
-
- 15 edited
-
Makefile (modified) (3 diffs)
-
tst_psHash00.c (modified) (4 diffs)
-
tst_psHash01.c (modified) (2 diffs)
-
tst_psHash02.c (modified) (3 diffs)
-
tst_psHash03.c (modified) (3 diffs)
-
tst_psHash04.c (modified) (2 diffs)
-
tst_psLogMsg00.c (modified) (2 diffs)
-
tst_psLogMsg01.c (modified) (2 diffs)
-
tst_psLogMsg02.c (modified) (2 diffs)
-
tst_psLogMsg03.c (modified) (2 diffs)
-
tst_psTrace00.c (modified) (2 diffs)
-
tst_psTrace01.c (modified) (2 diffs)
-
tst_psTrace02.c (modified) (2 diffs)
-
tst_psTrace03.c (modified) (2 diffs)
-
tst_psTrace04.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sysUtils/Makefile
r560 r584 3 3 ## Makefile: test/sysUtils 4 4 ## 5 ## $Revision: 1. 6$ $Name: not supported by cvs2svn $6 ## $Date: 2004-05-0 1 23:04:35$5 ## $Revision: 1.7 $ $Name: not supported by cvs2svn $ 6 ## $Date: 2004-05-06 00:20:50 $ 7 7 ## 8 8 ## Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 10 10 ############################################################################### 11 11 12 ###############################################################################13 # Note: I added specific entries for the psTrace files. The reason I did14 # this was because the generic rules were failing on the existing test15 # code (and hence, on my tst_psTraceXX.c code as well). I am tempted to16 # fix the generic rules, but that might break existing codes. When this17 # problem is resolved, I'll remove the specific rules for psTrace. -GLG18 # Also, psLogMsg.19 # Also, psHash.20 ###############################################################################21 12 include ../../src/Makefile.Globals 22 13 23 14 PSLIB_INCL_DIR = ../../include 15 24 16 PSLIB_LIB_DIR = ../../lib 25 17 26 TARGET = tst_psError \ 27 tstMemory \ 28 atst_psAbort_01 \ 29 atst_psAbort_02 \ 30 atst_psAbort_03 \ 31 tst_psStringCopy 32 TARGET_TRACE = tst_psTrace00 tst_psTrace01 tst_psTrace02 tst_psTrace03 \ 33 tst_psTrace04 34 TARGET_LOGMSG = tst_psLogMsg00 tst_psLogMsg01 tst_psLogMsg02 tst_psLogMsg03 35 TARGET_HASH = tst_psHash00 tst_psHash01 tst_psHash02 tst_psHash03 tst_psHash04 18 TARGET = atst_psAbort_01 \ 19 atst_psAbort_02 \ 20 atst_psAbort_03 \ 21 tstMemory \ 22 tst_psError \ 23 tst_psHash00 \ 24 tst_psHash01 \ 25 tst_psHash02 \ 26 tst_psHash03 \ 27 tst_psHash04 \ 28 tst_psLogMsg00 \ 29 tst_psLogMsg01 \ 30 tst_psLogMsg02 \ 31 tst_psLogMsg03 \ 32 tst_psStringCopy \ 33 tst_psTrace00 \ 34 tst_psTrace01 \ 35 tst_psTrace02 \ 36 tst_psTrace03 \ 37 tst_psTrace04 36 38 37 all: $(TARGET) 38 psTrace: $(TARGET_TRACE) 39 psLogMsg: $(TARGET_LOGMSG) 40 psHash: $(TARGET_HASH) 39 all: $(TARGET) 41 40 42 tst_psError: tst_psError.o43 41 atst_psAbort_01: atst_psAbort_01.o 44 42 atst_psAbort_02: atst_psAbort_02.o 45 43 atst_psAbort_03: atst_psAbort_03.o 44 tstMemory: tstMemory.o 45 tst_psError: tst_psError.o 46 tst_psHash00: tst_psHash00.o 47 tst_psHash01: tst_psHash01.o 48 tst_psHash02: tst_psHash02.o 49 tst_psHash03: tst_psHash03.o 50 tst_psHash04: tst_psHash04.o 51 tst_psLogMsg00: tst_psLogMsg00.o 52 tst_psLogMsg01: tst_psLogMsg01.o 53 tst_psLogMsg02: tst_psLogMsg02.o 54 tst_psLogMsg03: tst_psLogMsg03.o 46 55 tst_psStringCopy: tst_psStringCopy.o 56 tst_psTrace00: tst_psTrace00.o 57 tst_psTrace01: tst_psTrace01.o 58 tst_psTrace02: tst_psTrace02.o 59 tst_psTrace03: tst_psTrace03.o 60 tst_psTrace04: tst_psTrace04.o 47 61 48 62 clean: … … 50 64 $(RM) $(TARGET) *.o *.lint 51 65 52 tst_psHash00: tst_psHash00.c53 $(CC) tst_psHash00.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash0054 55 tst_psHash01: tst_psHash01.c56 $(CC) tst_psHash01.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash0157 58 tst_psHash02: tst_psHash02.c59 $(CC) tst_psHash02.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash0260 61 tst_psHash03: tst_psHash03.c62 $(CC) tst_psHash03.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash0363 64 tst_psHash04: tst_psHash04.c65 $(CC) tst_psHash04.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash0466 67 tst_psLogMsg00: tst_psLogMsg00.c68 $(CC) tst_psLogMsg00.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg0069 70 tst_psLogMsg01: tst_psLogMsg01.c71 $(CC) tst_psLogMsg01.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg0172 73 tst_psLogMsg02: tst_psLogMsg02.c74 $(CC) tst_psLogMsg02.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg0275 76 tst_psLogMsg03: tst_psLogMsg03.c77 $(CC) tst_psLogMsg03.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg0378 79 tst_psTrace00: tst_psTrace00.c80 $(CC) tst_psTrace00.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psTrace0081 82 tst_psTrace01: tst_psTrace01.c83 $(CC) tst_psTrace01.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psTrace0184 85 tst_psTrace02: tst_psTrace02.c86 $(CC) tst_psTrace02.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psTrace0287 88 tst_psTrace03: tst_psTrace03.c89 $(CC) tst_psTrace03.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psTrace0390 91 tst_psTrace04: tst_psTrace04.c92 $(CC) tst_psTrace04.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psTrace0493 94 66 %.o : %.c 95 $(CC) $(CFLAGS) $(CPPFLAGS) -I .. -I$(PSLIB_INCL_DIR) -c -o $@ $<67 $(CC) $(CFLAGS) $(CPPFLAGS) -I$(PSLIB_INCL_DIR) -c -o $@ $< 96 68 97 69 % : %.o 98 $(CC) $(LDFLAGS) -L$(PSLIB_LIB_DIR) - L.. -lpslib -lpstest -o $@ $<70 $(CC) $(LDFLAGS) -L$(PSLIB_LIB_DIR) -lpslib -lpstest -o $@ $< 99 71 100 72 %.lint: %.c 101 73 splint +posixlib -exportlocal -realcompare $(INCLUDE_GLOBAL) $? > $@; cat $@ 102 74 103 distclean: 104 rm -rf $(TARGET_TRACE) $(TARGET_LOGMSG) $(TARGET_HASH) 75 -
trunk/psLib/test/sysUtils/tst_psHash00.c
r560 r584 7 7 #include "psHash.h" 8 8 #define NUM_HASH_TABLE_BUCKETS 10 9 main()9 int main() 10 10 { 11 11 psHash *myHashTable = NULL; … … 26 26 if (myHashTable->nbucket != NUM_HASH_TABLE_BUCKETS) { 27 27 fprintf(stderr, "%s: myHashTable->nbucket not set properly.\n", 28 __func__ , i);28 __func__); 29 29 testStatus = false; 30 30 … … 33 33 if (myHashTable->buckets == NULL) { 34 34 fprintf(stderr, "%s: myHashTable->buckets is NULL.\n", 35 __func__ , i);35 __func__); 36 36 testStatus = false; 37 37 … … 51 51 testStatus); 52 52 53 exit(!testStatus);53 return (!testStatus); 54 54 } -
trunk/psLib/test/sysUtils/tst_psHash01.c
r560 r584 32 32 } 33 33 34 main()34 int main() 35 35 { 36 36 psHash *myHashTable = NULL; 37 37 int testStatus = true; 38 int i = 0;39 38 40 39 printPositiveTestHeader(stdout, … … 68 67 testStatus); 69 68 70 exit(!testStatus);69 return (!testStatus); 71 70 } -
trunk/psLib/test/sysUtils/tst_psHash02.c
r560 r584 6 6 *****************************************************************************/ 7 7 #include <stdio.h> 8 #include <string.h> 8 9 #include "pslib.h" 9 10 #include "psTest.h" … … 32 33 } 33 34 34 main()35 int main() 35 36 { 36 37 psHash *myHashTable = NULL; … … 68 69 testStatus); 69 70 70 exit(!testStatus);71 return (!testStatus); 71 72 } -
trunk/psLib/test/sysUtils/tst_psHash03.c
r560 r584 5 5 *****************************************************************************/ 6 6 #include <stdio.h> 7 #include <string.h> 7 8 #include "pslib.h" 8 9 #include "psTest.h" … … 31 32 } 32 33 33 main()34 int main() 34 35 { 35 36 psHash *myHashTable = NULL; … … 81 82 testStatus); 82 83 83 exit(!testStatus);84 return (!testStatus); 84 85 } -
trunk/psLib/test/sysUtils/tst_psHash04.c
r561 r584 29 29 } 30 30 31 main()31 int main() 32 32 { 33 33 psHash *myHashTable = NULL; 34 34 int testStatus = true; 35 35 int i = 0; 36 ID *id = NULL;37 36 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL}; 38 37 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL}; … … 60 59 testStatus); 61 60 62 exit(!testStatus);61 return(!testStatus); 63 62 } -
trunk/psLib/test/sysUtils/tst_psLogMsg00.c
r560 r584 6 6 #include "psTest.h" 7 7 8 main()8 int main() 9 9 { 10 10 int i = 0; 11 int lev = 0;12 11 int testStatus = true; 13 12 … … 26 25 "default log levels", 27 26 testStatus); 28 exit(!testStatus);27 return(!testStatus); 29 28 } -
trunk/psLib/test/sysUtils/tst_psLogMsg01.c
r560 r584 9 9 #include "psTest.h" 10 10 11 main()11 int main() 12 12 { 13 13 int i = 0; 14 int lev = 0;15 14 int testStatus = true; 16 15 … … 34 33 "psSetLogLevel()", 35 34 testStatus); 36 exit(!testStatus);35 return(!testStatus); 37 36 } -
trunk/psLib/test/sysUtils/tst_psLogMsg02.c
r560 r584 9 9 #include "psTest.h" 10 10 11 main()11 int main() 12 12 { 13 13 int i = 0; 14 int lev = 0;15 14 int testStatus = true; 16 15 … … 66 65 "psSetLogFormat()", 67 66 testStatus); 68 exit(!testStatus);67 return(!testStatus); 69 68 } -
trunk/psLib/test/sysUtils/tst_psLogMsg03.c
r560 r584 10 10 #include "psTest.h" 11 11 12 main()12 int main() 13 13 { 14 14 int i = 0; 15 int lev = 0;16 15 int testStatus = true; 17 16 … … 42 41 "psSetLogDestination()", 43 42 testStatus); 44 exit(!testStatus);43 return(!testStatus); 45 44 } -
trunk/psLib/test/sysUtils/tst_psTrace00.c
r560 r584 6 6 #include "psTest.h" 7 7 8 main()8 int main() 9 9 { 10 10 int i = 0; … … 59 59 "Testing psSetTraceLevel and psGetTraceLevel", 60 60 testStatus); 61 exit(!testStatus);61 return(!testStatus); 62 62 } -
trunk/psLib/test/sysUtils/tst_psTrace01.c
r560 r584 6 6 #include "psTest.h" 7 7 8 main()8 int main() 9 9 { 10 10 int i = 0; … … 45 45 successFlag); 46 46 47 exit(!successFlag);47 return(!successFlag); 48 48 } -
trunk/psLib/test/sysUtils/tst_psTrace02.c
r560 r584 7 7 #include "psTest.h" 8 8 9 main()9 int main() 10 10 { 11 int i = 0;12 int lev = 0;13 int errorFlag = 0;14 15 11 printPositiveTestHeader(stdout, 16 12 "psTrace functions", … … 44 40 true); 45 41 46 exit(0);42 return(0); 47 43 } -
trunk/psLib/test/sysUtils/tst_psTrace03.c
r560 r584 7 7 #include "psTest.h" 8 8 9 main()9 int main() 10 10 { 11 11 printPositiveTestHeader(stdout, … … 36 36 true); 37 37 38 exit(0);38 return(0); 39 39 } -
trunk/psLib/test/sysUtils/tst_psTrace04.c
r560 r584 7 7 #include "psTest.h" 8 8 9 main()9 int main() 10 10 { 11 11 printPositiveTestHeader(stdout, … … 45 45 "psTraceReset() did not reset all levels of the tree.", 46 46 false); 47 exit(1);47 return(1); 48 48 } else { 49 49 printFooter(stdout, … … 51 51 "psTraceReset()", 52 52 true); 53 exit(0);53 return(0); 54 54 } 55 55 }
Note:
See TracChangeset
for help on using the changeset viewer.
