aboutsummaryrefslogtreecommitdiff
path: root/tests/ring_check.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-10-05 17:59:59 +0200
committerThomas White <taw@physics.org>2015-10-05 18:03:18 +0200
commit81fdf61e5530fb6f766a3d50b0185571a7929d8a (patch)
treec71dd4a06192969d6266b0f5e1c881e017360a4e /tests/ring_check.c
parent5627537df0e92770ee40427fe879aed10b75f25c (diff)
Tests: Remove image->data
Diffstat (limited to 'tests/ring_check.c')
-rw-r--r--tests/ring_check.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/ring_check.c b/tests/ring_check.c
index 8ced12d5..5ee5ea44 100644
--- a/tests/ring_check.c
+++ b/tests/ring_check.c
@@ -62,7 +62,7 @@ static void third_integration_check(struct image *image, int n_trials,
for ( fs=0; fs<image->width; fs++ ) {
for ( ss=0; ss<image->height; ss++ ) {
- image->data[fs+image->width*ss]
+ image->dp[0][fs+image->width*ss]
= poisson_noise(rng, 1000.0);
}
}
@@ -121,9 +121,9 @@ static void fourth_integration_check(struct image *image, int n_trials,
for ( fs=0; fs<image->width; fs++ ) {
for ( ss=0; ss<image->height; ss++ ) {
int idx = fs+image->width*ss;
- image->data[idx] = poisson_noise(rng, 1000.0);
+ image->dp[0][idx] = poisson_noise(rng, 1000.0);
if ( (fs-64)*(fs-64) + (ss-64)*(ss-64) > 9*9 ) continue;
- image->data[idx] += 1000.0;
+ image->dp[0][idx] += 1000.0;
pcount++;
}
}
@@ -179,10 +179,10 @@ int main(int argc, char *argv[])
fclose(fh);
gsl_rng_set(rng, seed);
- image.data = malloc(128*128*sizeof(float));
+ image.dp = malloc(sizeof(float *));
+ image.dp[0] = malloc(128*128*sizeof(float));
bad = calloc(128*128, sizeof(int));
image.bad = &bad;
- image.flags = NULL;
image.beam = NULL;
image.lambda = ph_eV_to_lambda(1000.0);
@@ -211,7 +211,7 @@ int main(int argc, char *argv[])
image.width = 128;
image.height = 128;
- memset(image.data, 0, 128*128*sizeof(float));
+ memset(image.dp[0], 0, 128*128*sizeof(float));
image.n_crystals = 0;
image.crystals = NULL;
@@ -238,7 +238,7 @@ int main(int argc, char *argv[])
for ( fs=0; fs<image.width; fs++ ) {
for ( ss=0; ss<image.height; ss++ ) {
if ( (fs-64)*(fs-64) + (ss-64)*(ss-64) > 9*9 ) continue;
- image.data[fs+image.width*ss] = 1000.0;
+ image.dp[0][fs+image.width*ss] = 1000.0;
npx++;
}
}
@@ -278,9 +278,9 @@ int main(int argc, char *argv[])
npx = 0;
for ( fs=0; fs<image.width; fs++ ) {
for ( ss=0; ss<image.height; ss++ ) {
- image.data[fs+image.width*ss] = 1000.0;
+ image.dp[0][fs+image.width*ss] = 1000.0;
if ( (fs-64)*(fs-64) + (ss-64)*(ss-64) > 9*9 ) continue;
- image.data[fs+image.width*ss] += 1000.0;
+ image.dp[0][fs+image.width*ss] += 1000.0;
npx++;
}
}
@@ -310,11 +310,11 @@ int main(int argc, char *argv[])
}
-
free(image.beam);
free(image.det->panels);
free(image.det);
- free(image.data);
+ free(image.dp[0]);
+ free(image.dp);
gsl_rng_free(rng);
if ( fail ) return 1;