aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt3
-rw-r--r--tests/ev_enum1.c17
-rw-r--r--tests/ev_enum1.geom12
3 files changed, 21 insertions, 11 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index b33e08db..d086d1a8 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -142,7 +142,8 @@ add_executable(ev_enum1 ev_enum1.c)
target_include_directories(ev_enum1 PRIVATE ${COMMON_INCLUDES})
target_link_libraries(ev_enum1 ${COMMON_LIBRARIES} -lhdf5)
add_test(NAME ev_enum1
- COMMAND ev_enum1 ${CMAKE_CURRENT_SOURCE_DIR}/ev_enum1.h5)
+ COMMAND ev_enum1 ${CMAKE_CURRENT_SOURCE_DIR}/ev_enum1.h5
+ ${CMAKE_CURRENT_SOURCE_DIR}/ev_enum1.geom)
add_executable(ev_enum2 ev_enum2.c)
target_include_directories(ev_enum2 PRIVATE ${COMMON_INCLUDES})
diff --git a/tests/ev_enum1.c b/tests/ev_enum1.c
index c1a93320..67cccb5b 100644
--- a/tests/ev_enum1.c
+++ b/tests/ev_enum1.c
@@ -35,26 +35,23 @@
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
-#include <hdf5.h>
-extern char **expand_paths(hid_t fh, char *pattern, int *n_evs);
+#include <image.h>
int main(int argc, char *argv[])
{
- hid_t fh;
char **event_ids;
int n_event_ids;
int i;
+ DataTemplate *dtempl;
- fh = H5Fopen(argv[1], H5F_ACC_RDONLY, H5P_DEFAULT);
- if ( fh < 0 ) {
- printf("Couldn't open file\n");
+ dtempl = data_template_new_from_file(argv[2]);
+ if ( dtempl == NULL ) {
+ ERROR("Failed to load data template\n");
return 1;
}
- event_ids = expand_paths(fh,
- "/data/panelA/%/panel_data1t/%/array",
- &n_event_ids);
+ event_ids = image_expand_frames(dtempl, argv[1], &n_event_ids);
if ( event_ids == NULL ) {
printf("event_ids = NULL\n");
@@ -91,7 +88,7 @@ int main(int argc, char *argv[])
}
free(event_ids);
- H5Fclose(fh);
+ data_template_free(dtempl);
return 0;
}
diff --git a/tests/ev_enum1.geom b/tests/ev_enum1.geom
new file mode 100644
index 00000000..2062e86a
--- /dev/null
+++ b/tests/ev_enum1.geom
@@ -0,0 +1,12 @@
+panel/min_fs = 0
+panel/min_ss = 1
+panel/max_fs = 0
+panel/max_ss = 1
+panel/corner_x = -100
+panel/corner_y = -100
+panel/clen = 50 mm
+panel/res = 1000000
+panel/adu_per_photon = 1
+panel/dim0 = fs
+panel/dim1 = ss
+panel/data = /data/panelA/%/panel_data1t/%/array \ No newline at end of file