36#include "irplib_plugin.h"
38#include "irplib_utils.h"
62#define LINE_LEN_MAX 1023
65#define LINE_SCAN_FMT \
66 "%" CPL_STRINGIFY(LINE_LEN_MAX) "s " \
67 "%" CPL_STRINGIFY(LINE_LEN_MAX) "s " \
68 "%" CPL_STRINGIFY(LINE_LEN_MAX) "s"
71#define DEV_RANDOM "/dev/urandom"
74#define recipe_assert(bool) \
75 ((bool) ? (cpl_msg_debug(cpl_func, \
77 " line %d (CPL-error state: '%s' in %s): %s", \
78 __LINE__, cpl_error_get_message(), \
79 cpl_error_get_where(), #bool), \
81 : (cpl_msg_error(cpl_func, \
82 "Failure in " __FILE__ \
83 " line %d (CPL-error state: '%s' in %s): %s", \
84 __LINE__, cpl_error_get_message(), \
85 cpl_error_get_where(), #bool), \
93static const cpl_parameter *irplib_parameterlist_get(
const cpl_parameterlist *,
98static void recipe_parameterlist_set(cpl_parameterlist *);
100irplib_plugin_has_sof_from_env(
const cpl_plugin *,
const char *);
102static void recipe_frameset_load(cpl_frameset *,
const char *);
105recipe_sof_test_devfile(cpl_plugin *,
const char *,
size_t,
const char *[]);
106static void recipe_sof_test_image_empty(cpl_plugin *,
size_t,
const char *[]);
107static void recipe_sof_test_local(cpl_plugin *);
108static void recipe_sof_test_from_env(cpl_plugin *);
109static void recipe_frameset_empty(cpl_frameset *);
110static void recipe_frameset_test_frame(
const cpl_frame *);
112recipe_frameset_test_frameset_diff(
const cpl_frameset *,
const cpl_frameset *);
114static cpl_errorstate inistate;
134irplib_parameterlist_get_string(
const cpl_parameterlist *self,
135 const char *instrume,
137 const char *parameter)
139 const cpl_parameter *par =
140 irplib_parameterlist_get(self, instrume, recipe, parameter);
143 (void)cpl_error_set_where(cpl_func);
148 const char *value = cpl_parameter_get_string(par);
151 (void)cpl_error_set_where(cpl_func);
169irplib_parameterlist_get_bool(
const cpl_parameterlist *self,
170 const char *instrume,
172 const char *parameter)
174 const cpl_parameter *par =
175 irplib_parameterlist_get(self, instrume, recipe, parameter);
178 (void)cpl_error_set_where(cpl_func);
183 cpl_errorstate prestate = cpl_errorstate_get();
184 const cpl_boolean value = cpl_parameter_get_bool(par);
186 if (!cpl_errorstate_is_equal(prestate))
187 (void)cpl_error_set_where(cpl_func);
206irplib_parameterlist_get_int(
const cpl_parameterlist *self,
207 const char *instrume,
209 const char *parameter)
211 const cpl_parameter *par =
212 irplib_parameterlist_get(self, instrume, recipe, parameter);
215 (void)cpl_error_set_where(cpl_func);
220 cpl_errorstate prestate = cpl_errorstate_get();
221 const int value = cpl_parameter_get_int(par);
223 if (!cpl_errorstate_is_equal(prestate))
224 (void)cpl_error_set_where(cpl_func);
242irplib_parameterlist_get_double(
const cpl_parameterlist *self,
243 const char *instrume,
245 const char *parameter)
247 const cpl_parameter *par =
248 irplib_parameterlist_get(self, instrume, recipe, parameter);
251 (void)cpl_error_set_where(cpl_func);
256 cpl_errorstate prestate = cpl_errorstate_get();
257 const double value = cpl_parameter_get_double(par);
259 if (!cpl_errorstate_is_equal(prestate))
260 (void)cpl_error_set_where(cpl_func);
282irplib_parameterlist_set_string(cpl_parameterlist *self,
283 const char *instrume,
285 const char *parameter,
286 const char *defvalue,
291 cpl_error_code error;
293 char *paramname = cpl_sprintf(
"%s.%s.%s", instrume, recipe, parameter);
295 cpl_ensure_code(paramname != NULL, cpl_error_get_code());
297 par = cpl_parameter_new_value(paramname, CPL_TYPE_STRING, man, context,
301 cpl_ensure_code(par != NULL, cpl_error_get_code());
303 error = cpl_parameter_set_alias(par, CPL_PARAMETER_MODE_CLI,
304 alias ? alias : parameter);
305 cpl_ensure_code(!error, error);
307 error = cpl_parameter_disable(par, CPL_PARAMETER_MODE_ENV);
308 cpl_ensure_code(!error, error);
310 error = cpl_parameterlist_append(self, par);
311 cpl_ensure_code(!error, error);
313 return CPL_ERROR_NONE;
333irplib_parameterlist_set_bool(cpl_parameterlist *self,
334 const char *instrume,
336 const char *parameter,
337 cpl_boolean defvalue,
342 cpl_error_code error;
344 char *paramname = cpl_sprintf(
"%s.%s.%s", instrume, recipe, parameter);
346 cpl_ensure_code(paramname != NULL, cpl_error_get_code());
348 par = cpl_parameter_new_value(paramname, CPL_TYPE_BOOL, man, context,
352 cpl_ensure_code(par != NULL, cpl_error_get_code());
354 error = cpl_parameter_set_alias(par, CPL_PARAMETER_MODE_CLI,
355 alias ? alias : parameter);
356 cpl_ensure_code(!error, error);
358 error = cpl_parameter_disable(par, CPL_PARAMETER_MODE_ENV);
359 cpl_ensure_code(!error, error);
361 error = cpl_parameterlist_append(self, par);
362 cpl_ensure_code(!error, error);
364 return CPL_ERROR_NONE;
384irplib_parameterlist_set_int(cpl_parameterlist *self,
385 const char *instrume,
387 const char *parameter,
393 cpl_error_code error;
395 char *paramname = cpl_sprintf(
"%s.%s.%s", instrume, recipe, parameter);
397 cpl_ensure_code(paramname != NULL, cpl_error_get_code());
399 par = cpl_parameter_new_value(paramname, CPL_TYPE_INT, man, context,
403 cpl_ensure_code(par != NULL, cpl_error_get_code());
405 error = cpl_parameter_set_alias(par, CPL_PARAMETER_MODE_CLI,
406 alias ? alias : parameter);
407 cpl_ensure_code(!error, error);
409 error = cpl_parameter_disable(par, CPL_PARAMETER_MODE_ENV);
410 cpl_ensure_code(!error, error);
412 error = cpl_parameterlist_append(self, par);
413 cpl_ensure_code(!error, error);
415 return CPL_ERROR_NONE;
435irplib_parameterlist_set_double(cpl_parameterlist *self,
436 const char *instrume,
438 const char *parameter,
444 cpl_error_code error;
446 char *paramname = cpl_sprintf(
"%s.%s.%s", instrume, recipe, parameter);
448 cpl_ensure_code(paramname != NULL, cpl_error_get_code());
450 par = cpl_parameter_new_value(paramname, CPL_TYPE_DOUBLE, man, context,
454 cpl_ensure_code(par != NULL, cpl_error_get_code());
456 error = cpl_parameter_set_alias(par, CPL_PARAMETER_MODE_CLI,
457 alias ? alias : parameter);
458 cpl_ensure_code(!error, error);
460 error = cpl_parameter_disable(par, CPL_PARAMETER_MODE_ENV);
461 cpl_ensure_code(!error, error);
463 error = cpl_parameterlist_append(self, par);
464 cpl_ensure_code(!error, error);
466 return CPL_ERROR_NONE;
486irplib_plugin_test(cpl_pluginlist *self,
size_t nstr,
const char *astr[])
489 int (*recipe_create)(cpl_plugin *);
490 int (*recipe_exec)(cpl_plugin *);
491 int (*recipe_deinit)(cpl_plugin *);
493 cpl_boolean is_debug;
496 is_debug = cpl_msg_get_level() <= CPL_MSG_DEBUG ? CPL_TRUE : CPL_FALSE;
499 stream = is_debug ? stdout : fopen(
"/dev/null",
"a");
501 inistate = cpl_errorstate_get();
503 assert(nstr == 0 || astr != NULL);
505 plugin = cpl_pluginlist_get_first(self);
507 if (plugin == NULL) {
508 cpl_msg_warning(cpl_func,
"With an empty pluginlist, "
509 "no tests can be made");
513 cpl_plugin_dump(plugin, stream);
515 recipe_create = cpl_plugin_get_init(plugin);
516 cpl_test(recipe_create != NULL);
518 recipe_exec = cpl_plugin_get_exec(plugin);
519 cpl_test(recipe_exec != NULL);
521 recipe_deinit = cpl_plugin_get_deinit(plugin);
522 cpl_test(recipe_deinit != NULL);
525 if (cpl_plugin_get_type(plugin) != CPL_PLUGIN_TYPE_RECIPE) {
526 cpl_msg_warning(cpl_func,
"This plugin is not of type recipe, "
527 "cannot test further");
531 if (recipe_create != NULL && recipe_exec != NULL && recipe_deinit != NULL) {
532 cpl_error_code error;
535 cpl_test_zero(recipe_create(plugin));
537 recipe = (cpl_recipe *)plugin;
539 cpl_test_nonnull(recipe->parameters);
541 recipe_parameterlist_set(recipe->parameters);
543 cpl_parameterlist_dump(recipe->parameters, stream);
545 recipe->frames = cpl_frameset_new();
547 if (irplib_plugin_has_sof_from_env(plugin,
"RECIPE_SOF_PATH")) {
548 recipe_sof_test_from_env(plugin);
551 const cpl_msg_severity msg_level = cpl_msg_get_level();
555 if (getenv(
"CPL_MSG_LEVEL") == NULL)
556 cpl_msg_set_level(CPL_MSG_OFF);
558 cpl_msg_info(cpl_func,
559 "Checking handling of pre-existing CPL error "
560 "state - may produce warning(s)/error(s):");
561 cpl_error_set(cpl_func, CPL_ERROR_EOL);
563 cpl_test(recipe_exec(plugin));
565 cpl_test_error(CPL_ERROR_EOL);
567 cpl_msg_info(cpl_func,
"Checking handling of empty frameset - "
568 "may produce warning(s)/error(s):");
570 cpl_test(recipe_exec(plugin));
571 error = cpl_error_get_code();
573 cpl_test_error(error);
576 cpl_msg_info(cpl_func,
"Checking handling of dummy frameset - "
577 "may produce warning(s)/error(s):");
579 cpl_frame *f = cpl_frame_new();
580 error = cpl_frame_set_filename(f,
"/dev/null");
581 cpl_test_eq_error(error, CPL_ERROR_NONE);
582 error = cpl_frame_set_tag(f,
"RECIPE_DUMMY_TAG");
583 cpl_test_eq_error(error, CPL_ERROR_NONE);
584 error = cpl_frameset_insert(recipe->frames, f);
585 cpl_test_eq_error(error, CPL_ERROR_NONE);
588 cpl_test(recipe_exec(plugin));
589 error = cpl_error_get_code();
591 cpl_test_error(error);
594 error = cpl_frameset_erase_frame(recipe->frames, f);
595 cpl_test_eq_error(error, CPL_ERROR_NONE);
599#ifdef IRPLIB_TEST_RANDOM_SOF
600 recipe_sof_test_devfile(plugin, DEV_RANDOM, nstr, astr);
603 recipe_sof_test_devfile(plugin,
"/dev/null", nstr, astr);
605 recipe_sof_test_devfile(plugin,
".", nstr, astr);
607 recipe_sof_test_image_empty(plugin, nstr, astr);
609 recipe_sof_test_local(plugin);
611 cpl_msg_set_level(msg_level);
614 cpl_frameset_delete(recipe->frames);
616 error = recipe_deinit(plugin);
617 cpl_test_eq_error(error, CPL_ERROR_NONE);
620 if (stream != stdout)
640recipe_parameterlist_set(cpl_parameterlist *self)
642 cpl_parameter *p = cpl_parameterlist_get_first(self);
644 for (; p != NULL; p = cpl_parameterlist_get_next(self)) {
649 if (cpl_parameter_get_default_flag(p))
652 cpl_msg_debug(cpl_func, __FILE__
" line %u: OK", __LINE__);
654 envvar = cpl_parameter_get_alias(p, CPL_PARAMETER_MODE_ENV);
655 svalue = envvar ? getenv(envvar) : NULL;
657 switch (cpl_parameter_get_type(p)) {
658 case CPL_TYPE_BOOL: {
660 svalue ? atoi(svalue) : cpl_parameter_get_default_bool(p);
661 cpl_parameter_set_bool(p, value);
666 svalue ? atoi(svalue) : cpl_parameter_get_default_int(p);
667 cpl_parameter_set_int(p, value);
670 case CPL_TYPE_DOUBLE: {
672 svalue ? atof(svalue) : cpl_parameter_get_default_double(p);
673 cpl_parameter_set_double(p, value);
676 case CPL_TYPE_STRING: {
677 const char *s_default = cpl_parameter_get_default_string(p);
680 svalue ? svalue : (s_default ? s_default :
"");
681 cpl_parameter_set_string(p, value);
704recipe_sof_test_devfile(cpl_plugin *plugin,
705 const char *filename,
709 cpl_recipe *recipe = (cpl_recipe *)plugin;
710 int (*recipe_exec)(cpl_plugin *);
712 cpl_error_code error;
718 if (filename == NULL)
721 cpl_msg_info(cpl_func,
"Testing recipe with %u %s as input ",
722 (
unsigned)nstr, filename);
724 for (i = 0; i < nstr; i++) {
725 cpl_frame *f = cpl_frame_new();
727 error = cpl_frame_set_filename(f, filename);
728 cpl_test_eq_error(error, CPL_ERROR_NONE);
730 error = cpl_frame_set_tag(f, astr[i]);
731 cpl_test_eq_error(error, CPL_ERROR_NONE);
733 error = cpl_frameset_insert(recipe->frames, f);
734 cpl_test_eq_error(error, CPL_ERROR_NONE);
737 copy = cpl_frameset_duplicate(recipe->frames);
739 recipe_exec = cpl_plugin_get_exec(plugin);
740 cpl_test(recipe_exec != NULL);
742 if (recipe_exec != NULL) {
744 cpl_test(recipe_exec(plugin));
745 error = cpl_error_get_code();
747 cpl_test_error(error);
750 recipe_frameset_test_frameset_diff(recipe->frames, copy);
752 recipe_frameset_empty(recipe->frames);
755 cpl_frameset_delete(copy);
769recipe_sof_test_image_empty(cpl_plugin *plugin,
size_t nstr,
const char *astr[])
771 cpl_recipe *recipe = (cpl_recipe *)plugin;
772 int (*recipe_exec)(cpl_plugin *);
774 cpl_error_code error;
782 cpl_msg_info(cpl_func,
"Testing recipe with %u empty images as input ",
785 iempty = cpl_image_new(13, 17, CPL_TYPE_FLOAT);
786 cpl_test_nonnull(iempty);
788 for (i = 0; i < nstr; i++) {
789 cpl_frame *f = cpl_frame_new();
791 cpl_sprintf(
"%s-raw%05u.fits", cpl_plugin_get_name(plugin),
794 error = cpl_image_save(iempty, rawname, CPL_BPP_IEEE_FLOAT, NULL,
796 cpl_test_eq_error(error, CPL_ERROR_NONE);
798 error = cpl_frame_set_filename(f, rawname);
799 cpl_test_eq_error(error, CPL_ERROR_NONE);
801 error = cpl_frame_set_tag(f, astr[i]);
802 cpl_test_eq_error(error, CPL_ERROR_NONE);
804 error = cpl_frameset_insert(recipe->frames, f);
805 cpl_test_eq_error(error, CPL_ERROR_NONE);
809 cpl_image_delete(iempty);
811 copy = cpl_frameset_duplicate(recipe->frames);
813 recipe_exec = cpl_plugin_get_exec(plugin);
814 cpl_test(recipe_exec != NULL);
816 if (recipe_exec != NULL) {
817 const cpl_frame *frame;
818 cpl_frameset_iterator *iterator = NULL;
824 retstat = recipe_exec(plugin);
825 error = cpl_error_get_code();
828 cpl_test_zero(retstat);
833 cpl_test_error(error);
835 recipe_frameset_test_frameset_diff(recipe->frames, copy);
837 for (frame = irplib_frameset_get_first_const(&iterator, recipe->frames);
838 frame != NULL; frame = irplib_frameset_get_next_const(iterator)) {
839 cpl_test_zero(remove(cpl_frame_get_filename(frame)));
841 cpl_frameset_iterator_delete(iterator);
843 recipe_frameset_empty(recipe->frames);
846 cpl_frameset_delete(copy);
862irplib_plugin_has_sof_from_env(
const cpl_plugin *plugin,
const char *envname)
864 const char *recipename = cpl_plugin_get_name(plugin);
865 const char *sof_path = envname ? getenv(envname) : NULL;
866 cpl_frameset *frames;
868 const cpl_frame *ffirst;
870 cpl_ensure(plugin != NULL, CPL_ERROR_NULL_INPUT, CPL_FALSE);
871 cpl_ensure(envname != NULL, CPL_ERROR_NULL_INPUT, CPL_FALSE);
872 cpl_ensure(recipename != NULL, CPL_ERROR_DATA_NOT_FOUND, CPL_FALSE);
873 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), CPL_FALSE);
875 if (sof_path == NULL)
878 sof_name = cpl_sprintf(
"%s/%s.sof", sof_path, recipename);
880 frames = cpl_frameset_new();
881 recipe_frameset_load(frames, sof_name);
883 ffirst = cpl_frameset_get_position_const(frames, 0);
886 cpl_frameset_delete(frames);
888 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), CPL_FALSE);
890 return ffirst ? CPL_TRUE : CPL_FALSE;
902recipe_sof_test_from_env(cpl_plugin *plugin)
904 cpl_recipe *recipe = (cpl_recipe *)plugin;
905 const char *recipename = cpl_plugin_get_name(plugin);
906 const char *var_name =
"RECIPE_SOF_PATH";
907 const char *sof_path = getenv(var_name);
911 if (sof_path == NULL) {
912 cpl_msg_warning(cpl_func,
913 "Environment variable %s is unset: "
919 cpl_msg_debug(cpl_func,
"Checking for SOFs in %s", sof_path);
921 cpl_test_nonnull(recipename);
922 if (recipename == NULL)
925 sof_name = cpl_sprintf(
"%s/%s.sof", sof_path, recipename);
927 cpl_msg_debug(cpl_func,
"Checking for SOF %s", sof_name);
929 recipe_frameset_load(recipe->frames, sof_name);
931 if (!cpl_frameset_is_empty(recipe->frames)) {
932 int (*recipe_exec)(cpl_plugin *);
933 cpl_frameset *copy = cpl_frameset_duplicate(recipe->frames);
935 recipe_exec = cpl_plugin_get_exec(plugin);
936 cpl_test(recipe_exec != NULL);
938 if (recipe_exec != NULL) {
939 cpl_error_code error;
940 cpl_msg_info(cpl_func,
"Checking handling of SOF: %s", sof_name);
943 cpl_test_zero(recipe_exec(plugin));
945 cpl_test_error(CPL_ERROR_NONE);
947 error = cpl_dfs_update_product_header(recipe->frames);
948 cpl_test_eq_error(error, CPL_ERROR_NONE);
950 recipe_frameset_test_frameset_diff(recipe->frames, copy);
952 recipe_frameset_empty(recipe->frames);
955 cpl_frameset_delete(copy);
973recipe_sof_test_local(cpl_plugin *plugin)
975 cpl_recipe *recipe = (cpl_recipe *)plugin;
976 const char *recipename = cpl_plugin_get_name(plugin);
977 char *sof_name = cpl_sprintf(
"%s.sof", recipename);
979 cpl_msg_debug(cpl_func,
"Checking for SOF %s", sof_name);
981 recipe_frameset_load(recipe->frames, sof_name);
983 if (!cpl_frameset_is_empty(recipe->frames)) {
984 int (*recipe_exec)(cpl_plugin *);
985 cpl_frameset *copy = cpl_frameset_duplicate(recipe->frames);
987 recipe_exec = cpl_plugin_get_exec(plugin);
988 cpl_test(recipe_exec != NULL);
990 if (recipe_exec != NULL) {
991 cpl_error_code error;
993 cpl_msg_info(cpl_func,
"Checking handling of SOF: %s", sof_name);
996 cpl_test_zero(recipe_exec(plugin));
998 cpl_test_error(CPL_ERROR_NONE);
1000 error = cpl_dfs_update_product_header(recipe->frames);
1001 cpl_test_eq_error(error, CPL_ERROR_NONE);
1003 recipe_frameset_test_frameset_diff(recipe->frames, copy);
1005 recipe_frameset_empty(recipe->frames);
1008 cpl_frameset_delete(copy);
1034recipe_frameset_load(cpl_frameset *set,
const char *name)
1037 char line[LINE_LEN_MAX + 1];
1038 char path[LINE_LEN_MAX + 1], group[LINE_LEN_MAX + 1], tag[LINE_LEN_MAX + 1];
1041 assert(set != NULL);
1042 assert(name != NULL);
1044 fp = fopen(name,
"r");
1046 cpl_msg_debug(cpl_func,
"Unable to open SOF file '%s'", name);
1051 for (line_number = 0; fgets(line, LINE_LEN_MAX, fp); line_number++) {
1052 cpl_frame_group grp;
1059 n = sscanf(line, LINE_SCAN_FMT, path, tag, group);
1062 cpl_msg_warning(cpl_func,
"Spurious line no. %d in %s: %s",
1063 line_number, name, line);
1068 frame = cpl_frame_new();
1071 cpl_frame_set_filename(frame, path);
1074 cpl_frame_set_tag(frame, n == 1 ?
"" : tag);
1076 cpl_frameset_insert(set, frame);
1082 if (!strcmp(group, CPL_FRAME_GROUP_RAW_ID))
1083 grp = CPL_FRAME_GROUP_RAW;
1084 else if (!strcmp(group, CPL_FRAME_GROUP_CALIB_ID))
1085 grp = CPL_FRAME_GROUP_CALIB;
1086 else if (!strcmp(group, CPL_FRAME_GROUP_PRODUCT_ID))
1087 grp = CPL_FRAME_GROUP_PRODUCT;
1089 grp = CPL_FRAME_GROUP_NONE;
1091 cpl_frame_set_group(frame, grp);
1111static const cpl_parameter *
1112irplib_parameterlist_get(
const cpl_parameterlist *self,
1113 const char *instrume,
1115 const char *parameter)
1118 const cpl_parameter *par;
1121 cpl_ensure(instrume != NULL, CPL_ERROR_NULL_INPUT, NULL);
1122 cpl_ensure(recipe != NULL, CPL_ERROR_NULL_INPUT, NULL);
1123 cpl_ensure(parameter != NULL, CPL_ERROR_NULL_INPUT, NULL);
1125 paramname = cpl_sprintf(
"%s.%s.%s", instrume, recipe, parameter);
1127 par = cpl_parameterlist_find_const(self, paramname);
1130 (void)cpl_error_set_message(cpl_func,
1131 cpl_error_get_code()
1132 ? cpl_error_get_code()
1133 : CPL_ERROR_DATA_NOT_FOUND,
1136 cpl_free(paramname);
1170recipe_frameset_empty(cpl_frameset *self)
1175 cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
1179 n = cpl_frameset_get_size(self);
1180 for (i = 0; i < n; ++i) {
1181 cpl_frame *f = cpl_frameset_get_position(self, n - 1 - i);
1182 cpl_frameset_erase_frame(self, f);
1209recipe_frameset_test_frame(
const cpl_frame *self)
1211 cpl_msg_info(cpl_func,
"Validating new frame: %s",
1212 cpl_frame_get_filename(self));
1214 cpl_test_nonnull(self);
1217 cpl_test_nonnull(cpl_frame_get_tag(self));
1220 cpl_test_eq(cpl_frame_get_group(self), CPL_FRAME_GROUP_PRODUCT);
1222 if (cpl_frame_get_type(self) != CPL_FRAME_TYPE_PAF) {
1224 cpl_test_fits(cpl_frame_get_filename(self));
1228 cpl_test_nonnull(cpl_frame_get_filename(self));
1255recipe_frameset_test_frameset_diff(
const cpl_frameset *self,
1256 const cpl_frameset *other)
1258 cpl_frameset_iterator *it1 = NULL;
1259 cpl_frameset_iterator *it2 = NULL;
1260 const cpl_frame *frame = irplib_frameset_get_first_const(&it2, other);
1263 for (; frame != NULL; frame = irplib_frameset_get_next_const(it2)) {
1264 const char *file = cpl_frame_get_filename(frame);
1267 cpl_test_nonnull(cpl_frame_get_filename(frame));
1271 cpl_frameset_iterator_delete(it2);
1276 frame = irplib_frameset_get_first_const(&it1, self);
1278 for (; frame != NULL; frame = irplib_frameset_get_next_const(it1)) {
1279 const cpl_frame *cmp;
1280 const char *file = cpl_frame_get_filename(frame);
1283 cpl_test_nonnull(cpl_frame_get_filename(frame));
1287 cmp = irplib_frameset_get_first_const(&it2, other);
1288 for (; cmp != NULL; cmp = irplib_frameset_get_next_const(it2)) {
1289 const char *cfile = cpl_frame_get_filename(cmp);
1291 if (!strcmp(file, cfile))
1294 cpl_frameset_iterator_delete(it2);
1299 cpl_test_eq(cpl_frame_get_group(frame), CPL_FRAME_GROUP_PRODUCT);
1300 recipe_frameset_test_frame(frame);
1304 cpl_frameset_iterator_delete(it1);