From 4136b74e1b7adbbabc0e789ca8689fab6f0e32aa Mon Sep 17 00:00:00 2001 From: Jesse McDonald Date: Mon, 9 Nov 2009 09:42:01 -0600 Subject: [PATCH] If (any) option is given, run GC test forever. Otherwise just run it once. --- rosella.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rosella.c b/rosella.c index 78c9abd..5f03a62 100644 --- a/rosella.c +++ b/rosella.c @@ -14,7 +14,7 @@ static void test_builtins(void); static void test_weak_boxes_and_wills(void); -static void test_garbage_collection(void); +static void test_garbage_collection(bool keep_going); static void print_value(value_t v); static void print_gc_stats(void); @@ -39,7 +39,7 @@ int main(int argc, char **argv) test_builtins(); test_weak_boxes_and_wills(); - test_garbage_collection(); + test_garbage_collection(argc > 1); return 0; } @@ -88,7 +88,7 @@ static void test_weak_boxes_and_wills(void) unregister_gc_root(&tmp_root); } -static void test_garbage_collection(void) +static void test_garbage_collection(bool keep_going) { gc_root_t root; int count = 0; @@ -143,7 +143,8 @@ static void test_garbage_collection(void) gc_stats.max_ns = 0; count = 0; - break; + if (!keep_going) + break; } }