CR2RE Pipeline Reference Manual 1.6.7
hdrl_cat_apio-test.c
1/*
2 * This file is part of the HDRL
3 * Copyright (C) 2017 European Southern Observatory
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#include <cpl_test.h>
21
22#include "../hdrl_cat_apio.h"
23
24
25int main(void)
26{
27 cpl_test_init(PACKAGE_BUGREPORT,CPL_MSG_WARNING);
28
29 /* Create an input apm structure */
30 ap_t ap;
31 ap.lsiz = 2048;
32 ap.csiz = 2048;
33 ap.inframe = NULL;
34 ap.conframe = NULL;
35
36 /* Initialize */
37 hdrl_apinit(&ap);
38
39 /* Test some of the various bits of the structure to see if they are the correct values */
40 cpl_test_eq( ap.maxpa, 1024);
41 cpl_test_eq( ap.maxip, 0);
42 cpl_test_nonnull( ap.lastline);
43 cpl_test_nonnull( ap.pstack);
44 cpl_test_nonnull( ap.parent);
45 cpl_test_eq( ap.pstack[10], 10);
46 cpl_test_eq( ap.parent[10].pnop, -1);
47 cpl_test_eq( ap.parent[10].pnbp, -1);
48 cpl_test_eq( ap.ipstack, 1);
49 cpl_test_nonnull( ap.bstack);
50 cpl_test_nonnull( ap.blink);
51 cpl_test_nonnull( ap.plessey);
52 cpl_test_eq( ap.bstack[10], 10);
53 cpl_test_eq( ap.ibstack, 2);
54 cpl_test_eq( ap.nimages, 0);
55 cpl_test_eq( ap.areal[1], 2 * ap.areal[0]);
56 cpl_test_eq( ap.npl, ap.lsiz);
57 cpl_test_eq( ap.npl_pix, 0);
58 cpl_test_nonnull( ap.plarray);
59 cpl_test_eq( ap.backmap.nby, -1);
60 cpl_test_null( ap.backmap.bvals);
61 cpl_test_null( ap.indata);
62 cpl_test_null( ap.confdata);
63
64 /* Clean up */
65 hdrl_apclose(&ap);
66
67
68 return cpl_test_end(0);
69}
void hdrl_apinit(ap_t *ap)
Initialize the ap structure.
Definition: hdrl_cat_apio.c:54
void hdrl_apclose(ap_t *ap)
Close ap structure.