Changeset 829
- Timestamp:
- Jun 2, 2004, 10:02:42 AM (22 years ago)
- Location:
- trunk/psLib/test/sysUtils
- Files:
-
- 2 edited
-
tst_psMemory.c (modified) (3 diffs)
-
verified/tst_psMemory.stderr (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sysUtils/tst_psMemory.c
r722 r829 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-0 5-19 00:09:25$8 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-02 20:02:42 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 102 102 int currentId = psMemGetId(); 103 103 int ref = 0; 104 psMemProblemCallback cb;105 104 106 105 psLogMsg(__func__,PS_LOG_INFO,"memory reference count shall be incrementable/decrementable"); … … 133 132 } 134 133 135 psLogMsg(__func__,PS_LOG_INFO,"expect error from free as multiple referenced buffer is freed."); 136 137 problemCallbackCalled = 0; 138 cb = psMemProblemCallbackSet(memProblemCallback); 134 psLogMsg(__func__,PS_LOG_INFO,"psFree shall be just decrement a multiple refererenced pointer."); 139 135 140 136 psFree(mem); 141 137 142 psMemProblemCallbackSet(cb); 143 144 if (problemCallbackCalled != 1) { 145 psError(__func__,"Expected memProblemCallback to be called once, but was called %d times.", 146 problemCallbackCalled); 138 ref = psMemGetRefCounter(mem); 139 if (ref != 1) { 140 psError(__func__,"Expected to find buffer reference count to be 1, but it was %d.",ref); 147 141 return 1; 148 142 } -
trunk/psLib/test/sysUtils/verified/tst_psMemory.stderr
r725 r829 17 17 <DATE> <TIME> <HOST> |I|TPOutOfMemory |Upon requesting more memory than is available, psalloc shall call the psMemExhaustedCallback. 18 18 <DATE> <TIME> <HOST> |I|TPOutOfMemoryExhaustedCallback|Custom MemExhaustedCallback was invoked. 19 <DATE> <TIME> <HOST> |A|p_psAlloc |Failed to allocate 1073741823 bytes at tst_psMemory.c:17819 <DATE> <TIME> <HOST> |A|p_psAlloc |Failed to allocate 4611686018427387903 bytes at tst_psMemory.c:170 20 20 21 21 ---> TESTPOINT PASSED (psMemory{450-TPOutOfMemory} | tst_psMemory.c) … … 59 59 <DATE> <TIME> <HOST> |I|TPcheckLeaks |following psMemCheckLeaks call should produce one instance. 60 60 file:line ID 61 tst_psMemory.c:33 9161 tst_psMemory.c:333 1 62 62 <DATE> <TIME> <HOST> |I|TPcheckLeaks |Testing psMemCheckLeaks again with a different leak location 63 63 <DATE> <TIME> <HOST> |I|TPcheckLeaks |following psMemCheckLeaks call should produce one error. 64 64 file:line ID 65 tst_psMemory.c:36 91165 tst_psMemory.c:363 11 66 66 <DATE> <TIME> <HOST> |I|TPcheckLeaks |Testing psMemCheckLeaks again with multiple leak locations. 67 67 <DATE> <TIME> <HOST> |I|TPcheckLeaks |following psMemCheckLeaks call should produce two errors. 68 68 file:line ID 69 tst_psMemory.c:39 71670 tst_psMemory.c:39 71469 tst_psMemory.c:391 16 70 tst_psMemory.c:391 14 71 71 72 72 ---> TESTPOINT PASSED (psMemory{454-TPcheckLeaks} | tst_psMemory.c) … … 80 80 <DATE> <TIME> <HOST> |I|TPmemCorruption|psMemCheckCorruption shall detect memory corruptions 81 81 <DATE> <TIME> <HOST> |I|TPmemCorruption|psMemCheckCorruption should output an error message and memProblemCallback callback should be called. 82 <DATE> <TIME> <HOST> |E|psMemCheckCorruption|psMemCheckCorruption: memory block 1 is corrupted (buffer underflow 0xdeadbeef 0x2 )83 <DATE> <TIME> <HOST> |I|memProblemCallback|memory callback called for id 1 (psMemCheckCorruption:22 6).82 <DATE> <TIME> <HOST> |E|psMemCheckCorruption|psMemCheckCorruption: memory block 1 is corrupted (buffer underflow 0xdeadbeef 0x2deadbeef) 83 <DATE> <TIME> <HOST> |I|memProblemCallback|memory callback called for id 1 (psMemCheckCorruption:228). 84 84 85 85 ---> TESTPOINT PASSED (psMemory{455-TPmemCorruption} | tst_psMemory.c) … … 92 92 93 93 <DATE> <TIME> <HOST> |I|TPFreeReferencedMemory|memory reference count shall be incrementable/decrementable 94 <DATE> <TIME> <HOST> |I|TPFreeReferencedMemory|expect error from free as multiple referenced buffer is freed. 95 <DATE> <TIME> <HOST> |E|p_psFree |The buffer being freed is referenced elsewhere. Buffer's reference count was decremented instead. 96 <DATE> <TIME> <HOST> |I|memProblemCallback|memory callback called for id 1 (tst_psMemory.c:140). 94 <DATE> <TIME> <HOST> |I|TPFreeReferencedMemory|psFree shall be just decrement a multiple refererenced pointer. 97 95 98 96 ---> TESTPOINT PASSED (psMemory{456-TPFreeReferencedMemory} | tst_psMemory.c)
Note:
See TracChangeset
for help on using the changeset viewer.
