From bf9f60856756ef13e1996583a8955cf5707cfefa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 24 Apr 2009 10:03:44 +0000 Subject: [PATCH] * The multiple file creation was not correct, and could create way more files than planned. Now, it always adds 10% to the max file/dir count unil 50% is reached. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30361 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../random_file_actions/random_file_actions.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/tests/system/random_file_actions/random_file_actions.cpp b/src/tests/system/random_file_actions/random_file_actions.cpp index c8d2daa9f1..532d2580dc 100644 --- a/src/tests/system/random_file_actions/random_file_actions.cpp +++ b/src/tests/system/random_file_actions/random_file_actions.cpp @@ -799,9 +799,10 @@ main(int argc, char** argv) if (files.size() < maxFileCount) create_file(dirs, files); } else { - // create some more files to fill up the list - uint32 count = min_c(maxFileCount, files.size() + 10); - for (uint32 i = 0; i < count; i++) { + // create some more files to fill up the list (ie. 10%) + uint32 count + = min_c(maxFileCount, files.size() + maxFileCount / 10); + for (uint32 i = files.size(); i < count; i++) { create_file(dirs, files); } } @@ -812,9 +813,10 @@ main(int argc, char** argv) if (dirs.size() < maxDirCount) create_dir(dirs); } else { - // create some more directories to fill up the list - uint32 count = min_c(maxDirCount, dirs.size() + 5); - for (uint32 i = 0; i < count; i++) { + // create some more directories to fill up the list (ie. 10%) + uint32 count + = min_c(maxDirCount, dirs.size() + maxDirCount / 10); + for (uint32 i = dirs.size(); i < count; i++) { create_dir(dirs); } }