aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-06-28 11:45:28 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:30 +0100
commit2b1337a91228443c2b056f780159b0590308ad30 (patch)
tree5ef2be10ca71d065a17587375637081040ca07f1 /tests
parent12280b8336b5a221d2502292cd6aded57c647ad1 (diff)
Fail test if any (large) gradients are wrong
Diffstat (limited to 'tests')
-rw-r--r--tests/pr_gradient_check.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/tests/pr_gradient_check.c b/tests/pr_gradient_check.c
index 0bade784..ca66cc76 100644
--- a/tests/pr_gradient_check.c
+++ b/tests/pr_gradient_check.c
@@ -254,6 +254,7 @@ int main(int argc, char *argv[])
UnitCell *cell;
struct quaternion orientation;
int i;
+ int val;
image.width = 1024;
image.height = 1024;
@@ -275,6 +276,8 @@ int main(int argc, char *argv[])
deg2rad(90.0),
deg2rad(90.0));
+ val = 0;
+
for ( i=0; i<1; i++ ) {
orientation = random_quaternion();
@@ -287,27 +290,27 @@ int main(int argc, char *argv[])
plot_graph(&image, incr_frac, REF_ASX);
incr_val = incr_frac * ax;
- test_gradients(&image, incr_val, REF_ASX, "ax*");
+ val += test_gradients(&image, incr_val, REF_ASX, "ax*");
incr_val = incr_frac * ay;
- test_gradients(&image, incr_val, REF_ASY, "ay*");
+ val += test_gradients(&image, incr_val, REF_ASY, "ay*");
incr_val = incr_frac * az;
- test_gradients(&image, incr_val, REF_ASZ, "az*");
+ val += test_gradients(&image, incr_val, REF_ASZ, "az*");
incr_val = incr_frac * bx;
- test_gradients(&image, incr_val, REF_BSX, "bx*");
+ val += test_gradients(&image, incr_val, REF_BSX, "bx*");
incr_val = incr_frac * by;
- test_gradients(&image, incr_val, REF_BSY, "by*");
+ val += test_gradients(&image, incr_val, REF_BSY, "by*");
incr_val = incr_frac * bz;
- test_gradients(&image, incr_val, REF_BSZ, "bz*");
+ val += test_gradients(&image, incr_val, REF_BSZ, "bz*");
incr_val = incr_frac * cx;
- test_gradients(&image, incr_val, REF_CSX, "cx*");
+ val += test_gradients(&image, incr_val, REF_CSX, "cx*");
incr_val = incr_frac * cy;
- test_gradients(&image, incr_val, REF_CSY, "cy*");
+ val += test_gradients(&image, incr_val, REF_CSY, "cy*");
incr_val = incr_frac * cz;
- test_gradients(&image, incr_val, REF_CSZ, "cz*");
+ val += test_gradients(&image, incr_val, REF_CSZ, "cz*");
}
- return 0;
+ return val;
}