37 #include "irplib_cat.h"
42 static void irplib_cat_all_test(
void);
50 cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING);
52 irplib_cat_all_test();
54 return cpl_test_end(0);
57 static void irplib_cat_all_test(
void)
59 cpl_propertylist * prop_wcs;
61 double ra1, ra2, dec1, dec2;
64 prop_wcs = cpl_propertylist_new();
65 cpl_test_nonnull(prop_wcs);
66 cpl_propertylist_append_double(prop_wcs,
"CRVAL1", 0.);
67 cpl_propertylist_append_double(prop_wcs,
"CRVAL2", 0.);
68 cpl_propertylist_append_int(prop_wcs,
"CRPIX1", 1);
69 cpl_propertylist_append_int(prop_wcs,
"CRPIX2", 1);
70 cpl_propertylist_append_double(prop_wcs,
"CD1_1", .001);
71 cpl_propertylist_append_double(prop_wcs,
"CD1_2", 0.);
72 cpl_propertylist_append_double(prop_wcs,
"CD2_1", 00.);
73 cpl_propertylist_append_double(prop_wcs,
"CD2_2", .001);
74 cpl_propertylist_append_int(prop_wcs,
"NAXIS", 2);
75 cpl_propertylist_append_int(prop_wcs,
"NAXIS1", 1000);
76 cpl_propertylist_append_int(prop_wcs,
"NAXIS2", 1000);
77 wcs = cpl_wcs_new_from_propertylist(prop_wcs);
78 if(cpl_error_get_code() == CPL_ERROR_NO_WCS)
80 cpl_msg_warning(__func__,
"No WCS present. Tests disabled");
81 cpl_test_error(CPL_ERROR_NO_WCS);
83 cpl_propertylist_delete(prop_wcs);
86 cpl_test_nonnull(wcs);
89 cpl_test_error(CPL_ERROR_NONE);
90 cpl_test_abs(ra1, 0.00, DBL_EPSILON);
91 cpl_test_abs(ra2, 0.99, DBL_EPSILON);
92 cpl_test_abs(dec1, 0.00, DBL_EPSILON);
93 cpl_test_abs(dec2, 0.99, DBL_EPSILON);
97 cpl_propertylist_delete(prop_wcs);