aboutsummaryrefslogtreecommitdiff
path: root/tests/list_check.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-07-01 18:10:24 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:31 +0100
commitf249b77f9d3110381b729adca8c061f9fa00d09a (patch)
tree2447e0f8c6ee5129db75efcb8db030100de08630 /tests/list_check.c
parent0ec021f6e448c7341e1fb0959a9acc3cb8bd6f9a (diff)
Remove anything which deletes a reflection or optimises a RefList
Diffstat (limited to 'tests/list_check.c')
-rw-r--r--tests/list_check.c89
1 files changed, 0 insertions, 89 deletions
diff --git a/tests/list_check.c b/tests/list_check.c
index 180aeb6a..5e943c72 100644
--- a/tests/list_check.c
+++ b/tests/list_check.c
@@ -87,8 +87,6 @@ static int test_lists(int num_items)
}
- optimise_reflist(list);
-
/* Iterate over the list and check we find everything */
int count = 0;
for ( refl = first_refl(list, &iter);
@@ -154,93 +152,6 @@ static int test_lists(int num_items)
}
- /* Delete some reflections */
- for ( i=0; i<num_items/2; i++ ) {
-
- int j;
- signed int h, k, l;
- Reflection *refl;
-
- h = check[i].h;
- k = check[i].k;
- l = check[i].l;
-
- refl = find_refl(list, h, k, l);
- delete_refl(refl);
-
- /* Update all counts */
- for ( j=0; j<num_items; j++ ) {
- if ( (check[j].h == h) && (check[j].k == k)
- && (check[j].l == l) ) check[j].num--;
- }
-
- }
-
- /* Check that the deleted reflections can no longer be found */
- for ( i=0; i<num_items; i++ ) {
-
- signed int h, k, l;
- Reflection *refl;
-
- h = check[i].h;
- k = check[i].k;
- l = check[i].l;
-
- if ( check[i].num > 0 ) continue;
-
- refl = find_refl(list, h, k, l);
- if ( refl != NULL ) {
-
- fprintf(stderr, "Found %3i %i %3i after deletion.\n",
- h, k, l);
- return 1;
-
- }
-
- }
-
- /* Delete remaining duplicates */
- for ( i=0; i<num_items; i++ ) {
-
- signed int h, k, l;
- Reflection *refl;
-
- if ( check[i].num == 0 ) continue;
-
- h = check[i].h;
- k = check[i].k;
- l = check[i].l;
- refl = find_refl(list, h, k, l);
-
- do {
- int j;
- signed int ha, ka, la;
- Reflection *next;
- get_indices(refl, &ha, &ka, &la);
- next = next_found_refl(refl);
- delete_refl(refl);
- refl = next;
- for ( j=0; j<num_items; j++ ) {
- if ( (check[j].h == h) && (check[j].k == k)
- && (check[j].l == l) ) check[j].num--;
- }
- } while ( refl != NULL );
-
- if ( check[i].num != 0 ) {
- fprintf(stderr, "Found too few duplicates (%i) for "
- "%3i %3i %3i\n", check[i].num, h, k, l);
- return 1;
- }
-
- refl = find_refl(list, h, k, l);
- if ( refl != NULL ) {
- fprintf(stderr, "Found too many duplicates for "
- "%3i %3i %3i\n", h, k, l);
- return 1;
- }
-
- }
-
reflist_free(list);
free(check);