Changeset 860
- Timestamp:
- Jun 3, 2004, 5:20:08 PM (22 years ago)
- Location:
- trunk/psLib/test/sysUtils
- Files:
-
- 5 edited
-
tst_psHash00.c (modified) (3 diffs)
-
tst_psHash01.c (modified) (2 diffs)
-
tst_psHash02.c (modified) (3 diffs)
-
tst_psHash03.c (modified) (3 diffs)
-
tst_psHash04.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sysUtils/tst_psHash00.c
r584 r860 1 1 /***************************************************************************** 2 This code tests whether a hash tablebe allocated successfully.2 This code will test whether a hash table can be allocated successfully. 3 3 *****************************************************************************/ 4 4 #include <stdio.h> … … 12 12 int testStatus = true; 13 13 int i = 0; 14 14 int currentId = psMemGetId(); 15 int memLeaks = 0; 15 16 printPositiveTestHeader(stdout, 16 17 "psHash functions", … … 51 52 testStatus); 52 53 54 psHashFree(myHashTable, NULL); 55 56 memLeaks = psMemCheckLeaks(currentId,NULL,NULL); 57 if (0 != memLeaks) { 58 psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks); 59 } 60 psMemCheckCorruption(1); 61 53 62 return (!testStatus); 54 63 } -
trunk/psLib/test/sysUtils/tst_psHash01.c
r847 r860 36 36 psHash *myHashTable = NULL; 37 37 int testStatus = true; 38 int currentId = psMemGetId(); 39 int memLeaks = 0; 38 40 39 41 printPositiveTestHeader(stdout, … … 67 69 testStatus); 68 70 71 memLeaks = psMemCheckLeaks(currentId,NULL,NULL); 72 if (0 != memLeaks) { 73 psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks); 74 } 75 psMemCheckCorruption(1); 76 69 77 return (!testStatus); 70 78 } -
trunk/psLib/test/sysUtils/tst_psHash02.c
r584 r860 1 1 /***************************************************************************** 2 This code testswhether hash tables entries can be inserted correctly.2 This code will test whether hash tables entries can be inserted correctly. 3 3 4 4 GUS: Add code to test whether duplicates are handled correctly (use a 5 small has ttable and lots of keys).5 small hash table and lots of keys). 6 6 *****************************************************************************/ 7 7 #include <stdio.h> … … 41 41 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL}; 42 42 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL}; 43 int currentId = psMemGetId(); 44 int memLeaks = 0; 43 45 44 46 printPositiveTestHeader(stdout, … … 69 71 testStatus); 70 72 73 psHashFree(myHashTable, NULL); 74 75 memLeaks = psMemCheckLeaks(currentId,NULL,NULL); 76 if (0 != memLeaks) { 77 psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks); 78 } 79 psMemCheckCorruption(1); 80 71 81 return (!testStatus); 72 82 } -
trunk/psLib/test/sysUtils/tst_psHash03.c
r584 r860 1 1 /***************************************************************************** 2 This code testswhether hash tables entries can be removed correctly.2 This code will test whether hash tables entries can be removed correctly. 3 3 4 4 GUS: Add code to test whether duplicates are handled correctly. … … 40 40 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL}; 41 41 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL}; 42 int currentId = psMemGetId(); 43 int memLeaks = 0; 42 44 43 45 printPositiveTestHeader(stdout, … … 82 84 testStatus); 83 85 86 psHashFree(myHashTable, NULL); 87 memLeaks = psMemCheckLeaks(currentId,NULL,NULL); 88 if (0 != memLeaks) { 89 psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks); 90 } 91 psMemCheckCorruption(1); 92 84 93 return (!testStatus); 85 94 } -
trunk/psLib/test/sysUtils/tst_psHash04.c
r584 r860 1 1 /***************************************************************************** 2 This code testswhether the call psHashKeyList() function works.2 This code will test whether the call psHashKeyList() function works. 3 3 *****************************************************************************/ 4 4 #include <stdio.h> … … 36 36 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL}; 37 37 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL}; 38 int currentId = psMemGetId(); 39 int memLeaks = 0; 38 40 39 41 printPositiveTestHeader(stdout, … … 59 61 testStatus); 60 62 63 psHashFree(myHashTable, NULL); 64 65 memLeaks = psMemCheckLeaks(currentId,NULL,NULL); 66 if (0 != memLeaks) { 67 psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks); 68 } 69 psMemCheckCorruption(1); 70 61 71 return(!testStatus); 62 72 }
Note:
See TracChangeset
for help on using the changeset viewer.
