aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-10 15:37:37 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:19 +0100
commit4ffb5371e1a7cb1cb8205048723333f4bb1ac24e (patch)
tree9f65fd49a66233a4efbafd3380b118790b7af80b /tests
parenta47d84932a40867dc82c62f8a35883b0b0d11446 (diff)
tests/gpu_sim_check: Write HDF5 files if test fails
Diffstat (limited to 'tests')
-rw-r--r--tests/gpu_sim_check.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/gpu_sim_check.c b/tests/gpu_sim_check.c
index 28e85bcc..3bcaa561 100644
--- a/tests/gpu_sim_check.c
+++ b/tests/gpu_sim_check.c
@@ -141,7 +141,20 @@ int main(int argc, char *argv[])
free_detector_geometry(det);
free(beam);
- if ( perc > 1.0 ) return 1;
+ if ( perc > 1.0 ) {
+
+ STATUS("Test failed! I'm writing cpu-sim.h5 and gpu-sim.h5"
+ " for you to inspect.\n");
+
+ hdf5_write("cpu-sim.h5", cpu_image.data, cpu_image.width,
+ cpu_image.height, H5T_NATIVE_FLOAT);
+
+ hdf5_write("gpu-sim.h5", gpu_image.data, gpu_image.width,
+ gpu_image.height, H5T_NATIVE_FLOAT);
+
+ return 1;
+
+ }
return 0;
}