VirtualBox

Changeset 101753 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 3, 2023 3:57:39 PM (13 months ago)
Author:
vboxsync
Message:

added more detailed logging, tstRTSg.cpp testcase

Location:
trunk/src/VBox/Runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/sg.cpp

    r100908 r101753  
    11/* $Id$ */
    22/** @file
    3  * IPRT - S/G buffer handling.
     3 * IPRT - Scatter / Gather buffer handling.
    44 */
    55
  • trunk/src/VBox/Runtime/testcase/tstRTSg.cpp

    r99961 r101753  
    11/* $Id$ */
    22/** @file
    3  * IPRT Testcase - S/G Buffers.
     3 * IPRT Testcase - Scatter / Gather Buffers.
    44 */
    55
     
    198198            {
    199199                size_t const cbInitial = (size_t)RTRandU64Ex(iRun, cbSgBuf1);
    200                 RTTESTI_CHECK(RTSgBufAdvance(pSgBuf1, cbInitial) == cbInitial);
     200                size_t cbAdvanced = RTSgBufAdvance(pSgBuf1, cbInitial);
     201                RTTESTI_CHECK_MSG(cbAdvanced == cbInitial, ("cbAdvanced=%zu, cbInitial=%zu\n", cbAdvanced, cbInitial));
     202                /* should probably print part of pSgBuf1 values... */
    201203                cbLeft -= cbInitial;
    202204            }
    203205            for (;;)
    204206            {
    205                 RTTESTI_CHECK(RTSgBufCalcLengthLeft(pSgBuf1) == cbLeft);
     207                RTTESTI_CHECK_MSG(RTSgBufCalcLengthLeft(pSgBuf1) == cbLeft, ("pSgBuf1_calcLen=%zu, cbLeft=%zu\n",
     208                                                                             RTSgBufCalcLengthLeft(pSgBuf1), cbLeft));
    206209                size_t cbThisSeg = 0;
    207210                void *pvThisSeg = RTSgBufGetNextSegment(pSgBuf1, &cbThisSeg);
     
    212215                cbLeft -= cbThisSeg;
    213216            }
    214             RTTESTI_CHECK(cbLeft == 0);
     217            RTTESTI_CHECK_MSG(cbLeft == 0, ("cbLeft=%zu\n", cbLeft));
    215218            RTTESTI_CHECK(RTSgBufIsAtEnd(pSgBuf1));
    216219            RTTESTI_CHECK(RTSgBufCalcLengthLeft(pSgBuf1) == 0);
     
    234237                {
    235238                    cbInitial = (size_t)RTRandU64Ex(iRun, cbSgBuf1);
    236                     RTTESTI_CHECK(RTSgBufAdvance(pSgBuf1, cbInitial) == cbInitial);
     239                    size_t cbAdvanced = RTSgBufAdvance(pSgBuf1, cbInitial);
     240                    RTTESTI_CHECK_MSG(cbAdvanced == cbInitial, ("cbAdvanced=%zu, cbInitial=%zu\n",
     241                                                                cbAdvanced, cbInitial));
    237242                    cbLeft -= cbInitial;
    238243                }
     
    249254                RTTESTI_CHECK(cbCopied <= cbLeft);
    250255                RTTESTI_CHECK(cbCopied <= cbToCopy);
    251                 RTTESTI_CHECK(cbCopied == RT_MIN(cbToCopy, cbLeft));
     256                RTTESTI_CHECK_MSG(cbCopied == RT_MIN(cbToCopy, cbLeft), ("cbCopied=%zu, cbToCopy=%zu, cbLeft=%zu\n",
     257                                                                         cbCopied, cbToCopy, cbLeft));
    252258                RTTESTI_CHECK(memcmp(&pbSrc[cbInitial], pbDst, cbCopied) == 0);
    253259
    254                 RTTESTI_CHECK(RTSgBufCalcLengthLeft(pSgBuf1) == cbLeft - cbCopied);
     260                RTTESTI_CHECK_MSG(RTSgBufCalcLengthLeft(pSgBuf1) == cbLeft - cbCopied,
     261                                  ("pSgBuf1_calcLen=%zu cbLeft=%zu cbCopied=%zu\n",
     262                                   RTSgBufCalcLengthLeft(pSgBuf1), cbLeft, cbCopied));
    255263            }
    256264
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette