aboutsummaryrefslogtreecommitdiff
path: root/tests
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
parent5627537df0e92770ee40427fe879aed10b75f25c (diff)
Tests: Remove image->data
Diffstat (limited to 'tests')
-rw-r--r--tests/integration_check.c1
-rw-r--r--tests/prof2d_check.c1
-rw-r--r--tests/ring_check.c22
3 files changed, 11 insertions, 13 deletions
diff --git a/tests/integration_check.c b/tests/integration_check.c
index ccb613c3..2acd0f34 100644
--- a/tests/integration_check.c
+++ b/tests/integration_check.c
@@ -65,7 +65,6 @@ int main(int argc, char *argv[])
fclose(fh);
gsl_rng_set(rng, seed);
- image.flags = NULL;
image.beam = NULL;
image.lambda = ph_eV_to_lambda(9000.0);
diff --git a/tests/prof2d_check.c b/tests/prof2d_check.c
index c7ebd8b2..f66b6513 100644
--- a/tests/prof2d_check.c
+++ b/tests/prof2d_check.c
@@ -77,7 +77,6 @@ int main(int argc, char *argv[])
fclose(fh);
gsl_rng_set(rng, seed);
- image.flags = NULL;
image.beam = NULL;
image.lambda = ph_eV_to_lambda(9000.0);
image.bw = 0.000001;
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;