From 81fdf61e5530fb6f766a3d50b0185571a7929d8a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 5 Oct 2015 17:59:59 +0200 Subject: Tests: Remove image->data --- tests/integration_check.c | 1 - tests/prof2d_check.c | 1 - tests/ring_check.c | 22 +++++++++++----------- 3 files changed, 11 insertions(+), 13 deletions(-) (limited to 'tests') 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; fswidth; fs++ ) { for ( ss=0; ssheight; 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; fswidth; fs++ ) { for ( ss=0; ssheight; 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 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 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; -- cgit v1.2.3