From 41829562fd7687d37b953e184b1cb6edea9593f8 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Thu, 5 Jun 2008 14:00:11 +0300 Subject: fs-tests: stop integrity test looping forever Signed-off-by: Adrian Hunter --- tests/fs-tests/integrity/integck.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'tests/fs-tests/integrity') 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(); } -- cgit v1.2.3