Changeset 99640 in vbox for trunk/src/VBox/Main/testcase/tstGuestCtrlParseBuffer.cpp
- Timestamp:
- May 5, 2023 1:44:46 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/tstGuestCtrlParseBuffer.cpp
r99393 r99640 216 216 size_t cBlocks = 0; 217 217 218 unsigned aToRead[] = { 256, 23, 13 }; 219 unsigned i = 0;218 unsigned aToRead[] = { 256, 23, 13 }; /* Array of certain read amounts to check for in a sequence. */ 219 unsigned idxToRead = 0; /* Index within aToRead. */ 220 220 221 221 uint64_t cbToRead = cbFileSize; … … 226 226 do 227 227 { 228 size_t cbChunk = RT_MIN(cbToRead, i < RT_ELEMENTS(aToRead) ? aToRead[i++] : RTRandU64Ex(8, RT_MIN(sizeof(buf), 64))); 229 if (cbChunk > cbToRead) 230 cbChunk = cbToRead; 228 size_t cbChunk = cbToRead; 229 size_t const cbToReadFromArray = idxToRead < RT_ELEMENTS(aToRead) ? aToRead[idxToRead++] : 0; 230 if (cbToReadFromArray) 231 cbChunk = RT_MIN(cbChunk, cbToReadFromArray); 232 cbChunk = RT_MIN(cbChunk, RTRandU64Ex(8, RT_MIN(sizeof(buf), 64))); 231 233 if (cbChunk) 232 234 {
Note:
See TracChangeset
for help on using the changeset viewer.