IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 829


Ignore:
Timestamp:
Jun 2, 2004, 10:02:42 AM (22 years ago)
Author:
desonia
Message:

Adjusted tests to the new behavior of psFree/psMemDecrRefCounter.

Location:
trunk/psLib/test/sysUtils
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/sysUtils/tst_psMemory.c

    r722 r829  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-05-19 00:09:25 $
     8 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-06-02 20:02:42 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    102102    int currentId = psMemGetId();
    103103    int ref = 0;
    104     psMemProblemCallback cb;
    105104
    106105    psLogMsg(__func__,PS_LOG_INFO,"memory reference count shall be incrementable/decrementable");
     
    133132    }
    134133
    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.");
    139135
    140136    psFree(mem);
    141137
    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);
    147141        return 1;
    148142    }
  • trunk/psLib/test/sysUtils/verified/tst_psMemory.stderr

    r725 r829  
    1717 <DATE> <TIME> <HOST> |I|TPOutOfMemory  |Upon requesting more memory than is available, psalloc shall call the psMemExhaustedCallback.
    1818 <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:178
     19 <DATE> <TIME> <HOST> |A|p_psAlloc      |Failed to allocate 4611686018427387903 bytes at tst_psMemory.c:170
    2020
    2121---> TESTPOINT PASSED (psMemory{450-TPOutOfMemory} | tst_psMemory.c)
     
    5959 <DATE> <TIME> <HOST> |I|TPcheckLeaks   |following psMemCheckLeaks call should produce one instance.
    6060                   file:line ID
    61          tst_psMemory.c:339  1
     61         tst_psMemory.c:333  1
    6262 <DATE> <TIME> <HOST> |I|TPcheckLeaks   |Testing psMemCheckLeaks again with a different leak location
    6363 <DATE> <TIME> <HOST> |I|TPcheckLeaks   |following psMemCheckLeaks call should produce one error.
    6464                   file:line ID
    65          tst_psMemory.c:369  11
     65         tst_psMemory.c:363  11
    6666 <DATE> <TIME> <HOST> |I|TPcheckLeaks   |Testing psMemCheckLeaks again with multiple leak locations.
    6767 <DATE> <TIME> <HOST> |I|TPcheckLeaks   |following psMemCheckLeaks call should produce two errors.
    6868                   file:line ID
    69          tst_psMemory.c:397  16
    70          tst_psMemory.c:397  14
     69         tst_psMemory.c:391  16
     70         tst_psMemory.c:391  14
    7171
    7272---> TESTPOINT PASSED (psMemory{454-TPcheckLeaks} | tst_psMemory.c)
     
    8080 <DATE> <TIME> <HOST> |I|TPmemCorruption|psMemCheckCorruption shall detect memory corruptions
    8181 <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:226).
     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).
    8484
    8585---> TESTPOINT PASSED (psMemory{455-TPmemCorruption} | tst_psMemory.c)
     
    9292
    9393 <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.
    9795
    9896---> TESTPOINT PASSED (psMemory{456-TPFreeReferencedMemory} | tst_psMemory.c)
Note: See TracChangeset for help on using the changeset viewer.