- Timestamp:
- Jan 16, 2024 8:59:26 AM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTSg.cpp
r102885 r102886 208 208 209 209 /* Use RTSgBufGetNextSegment with random starting point. */ 210 for (unsigned iRun = 0; iRun < _1K; iRun++)210 for (unsigned iRun = 0; iRun < RT_MIN(_1K, cbSgBuf1); iRun++) 211 211 { 212 212 RTSgBufReset(pSgBuf1); … … 214 214 if (iRun > 1) 215 215 { 216 size_t const cbInitial = (size_t)RTRandAdvU64Ex(hRnd, RT_MIN(iRun, cbSgBuf1), cbSgBuf1);216 size_t const cbInitial = (size_t)RTRandAdvU64Ex(hRnd, iRun, cbSgBuf1); 217 217 size_t cbAdvanced = RTSgBufAdvance(pSgBuf1, cbInitial); 218 218 RTTESTI_CHECK_MSG(cbAdvanced == cbInitial, ("iBufVar=%u iRun=%u cbAdvanced=%zu, cbInitial=%zu\n", iBufVar, iRun, cbAdvanced, cbInitial)); … … 246 246 { 247 247 uint8_t const *pbSrc = (uint8_t const *)pSgBuf1->paSegs[0].pvSeg; 248 for (unsigned iRun = 0; iRun < _1K; iRun++)248 for (unsigned iRun = 0; iRun < RT_MIN(_1K, cbSgBuf1); iRun++) 249 249 { 250 250 RTSgBufReset(pSgBuf1); … … 253 253 if (iRun > 1) 254 254 { 255 cbInitial = (size_t)RTRandAdvU64Ex(hRnd, RT_MIN(iRun, cbSgBuf1), cbSgBuf1);255 cbInitial = (size_t)RTRandAdvU64Ex(hRnd, iRun, cbSgBuf1); 256 256 size_t cbAdvanced = RTSgBufAdvance(pSgBuf1, cbInitial); 257 257 RTTESTI_CHECK_MSG(cbAdvanced == cbInitial, ("cbAdvanced=%zu, cbInitial=%zu\n",
Note:
See TracChangeset
for help on using the changeset viewer.