diff options
author | Adrian Hunter <ext-adrian.hunter@nokia.com> | 2008-06-05 14:00:11 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-06-16 18:02:31 +0300 |
commit | 41829562fd7687d37b953e184b1cb6edea9593f8 (patch) | |
tree | fc2cb72026bcfb81af5934b199baec9539d3aa25 /tests/fs-tests | |
parent | 8dc67be0f1c7cab9a8715e63593ffe6ccf297222 (diff) |
fs-tests: stop integrity test looping forever
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Diffstat (limited to 'tests/fs-tests')
-rw-r--r-- | tests/fs-tests/integrity/integck.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c index 517c46d..8a53c05 100644 --- a/tests/fs-tests/integrity/integck.c +++ b/tests/fs-tests/integrity/integck.c @@ -1287,7 +1287,7 @@ static void do_an_operation(void) static void create_test_data(void) { - uint64_t i; + uint64_t i, n; grow = 1; shrink = 0; @@ -1300,7 +1300,8 @@ static void create_test_data(void) grow = 0; shrink = 1; /* Drop to less than 90% full */ - for (;;) { + n = operation_count / 40; + while (n--) { uint64_t free; uint64_t total; for (i = 0; i < 10; ++i) @@ -1313,13 +1314,14 @@ static void create_test_data(void) grow = 0; shrink = 0; full = 0; - for (i = 0; i < operation_count * 2; ++i) + n = operation_count * 2; + for (i = 0; i < n; ++i) do_an_operation(); } static void update_test_data(void) { - uint64_t i; + uint64_t i, n; grow = 1; shrink = 0; @@ -1329,7 +1331,8 @@ static void update_test_data(void) grow = 0; shrink = 1; /* Drop to less than 50% full */ - for (;;) { + n = operation_count / 10; + while (n--) { uint64_t free; uint64_t total; for (i = 0; i < 10; ++i) @@ -1342,7 +1345,8 @@ static void update_test_data(void) grow = 0; shrink = 0; full = 0; - for (i = 0; i < operation_count * 2; ++i) + n = operation_count * 2; + for (i = 0; i < n; ++i) do_an_operation(); } |