bool StressTest::GoToNextFile() { for (;;) { while (filesToOpen.Count() > 0) { // test next file ScopedMem<TCHAR> path(filesToOpen.At(0)); filesToOpen.RemoveAt(0); if (!IsInRange(fileRanges, ++fileIndex)) continue; if (OpenFile(path)) return true; } if (dirsToVisit.Count() > 0) { // test next directory ScopedMem<TCHAR> path(dirsToVisit.At(0)); dirsToVisit.RemoveAt(0); OpenDir(path); continue; } if (--cycles <= 0) return false; // start next cycle if (file::Exists(basePath)) filesToOpen.Append(str::Dup(basePath)); else OpenDir(basePath); } }