From 9801b606fb99023ee59c4bcfd58ca945bdcf5693 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 9 Feb 2011 15:11:39 +0100 Subject: Tidy up list_check.c --- tests/list_check.c | 127 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 71 insertions(+), 56 deletions(-) (limited to 'tests/list_check.c') diff --git a/tests/list_check.c b/tests/list_check.c index 1292d114..08bb09d5 100644 --- a/tests/list_check.c +++ b/tests/list_check.c @@ -25,8 +25,7 @@ struct refltemp { signed int h; signed int k; signed int l; - int del; - int dup; + int num; int found; }; @@ -52,8 +51,7 @@ static int test_lists(int num_items) for ( i=0; i RAND_MAX/2 ) { h = RANDOM_INDEX; @@ -62,11 +60,12 @@ static int test_lists(int num_items) } /* else use the same as last time */ /* Count the number of times this reflection appeared before */ + num = 1; for ( j=0; j 0 ) continue; + refl = find_refl(list, h, k, l); if ( refl != NULL ) { - /* Whoops, found it. Was it a duplicate? */ - if ( check[i].dup == -1 ) { - fprintf(stderr, "Found %3i %i %3i after" - " deletion.\n", h, k, l); - return 1; - } else { + fprintf(stderr, "Found %3i %i %3i after deletion.\n", + h, k, l); + return 1; + + } + + } + + /* Delete remaining duplicates */ + for ( i=0; i