Changeset 101753 in vbox for trunk/src/VBox
- Timestamp:
- Nov 3, 2023 3:57:39 PM (13 months ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/sg.cpp
r100908 r101753 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - S /Gbuffer handling.3 * IPRT - Scatter / Gather buffer handling. 4 4 */ 5 5 -
trunk/src/VBox/Runtime/testcase/tstRTSg.cpp
r99961 r101753 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT Testcase - S /GBuffers.3 * IPRT Testcase - Scatter / Gather Buffers. 4 4 */ 5 5 … … 198 198 { 199 199 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... */ 201 203 cbLeft -= cbInitial; 202 204 } 203 205 for (;;) 204 206 { 205 RTTESTI_CHECK(RTSgBufCalcLengthLeft(pSgBuf1) == cbLeft); 207 RTTESTI_CHECK_MSG(RTSgBufCalcLengthLeft(pSgBuf1) == cbLeft, ("pSgBuf1_calcLen=%zu, cbLeft=%zu\n", 208 RTSgBufCalcLengthLeft(pSgBuf1), cbLeft)); 206 209 size_t cbThisSeg = 0; 207 210 void *pvThisSeg = RTSgBufGetNextSegment(pSgBuf1, &cbThisSeg); … … 212 215 cbLeft -= cbThisSeg; 213 216 } 214 RTTESTI_CHECK (cbLeft == 0);217 RTTESTI_CHECK_MSG(cbLeft == 0, ("cbLeft=%zu\n", cbLeft)); 215 218 RTTESTI_CHECK(RTSgBufIsAtEnd(pSgBuf1)); 216 219 RTTESTI_CHECK(RTSgBufCalcLengthLeft(pSgBuf1) == 0); … … 234 237 { 235 238 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)); 237 242 cbLeft -= cbInitial; 238 243 } … … 249 254 RTTESTI_CHECK(cbCopied <= cbLeft); 250 255 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)); 252 258 RTTESTI_CHECK(memcmp(&pbSrc[cbInitial], pbDst, cbCopied) == 0); 253 259 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)); 255 263 } 256 264
Note:
See TracChangeset
for help on using the changeset viewer.