VIRCAM Pipeline  2.3.10
imcore_apinit-test.c
1 /* $Id: imcore_apinit-test.c,v 1.1 2015/10/15 11:27:22 jim Exp $
2  *
3  * This file is part of the CASU Pipeline utilities
4  * Copyright (C) 2015 European Southern Observatory
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 /*
22  * $Author: jim $
23  * $Date: 2015/10/15 11:27:22 $
24  * $Revision: 1.1 $
25  * $Name: $
26  */
27 
28 #include <stdio.h>
29 #include <stdlib.h>
30 
31 #include <cpl_init.h>
32 #include <cpl_test.h>
33 #include <casu_utils.h>
34 #include <casu_mods.h>
35 #include "../imcore.h"
36 
37 
38 int main(void) {
39  ap_t ap;
40 
41  /* Initialise */
42 
43  cpl_test_init(PACKAGE_BUGREPORT,CPL_MSG_WARNING);
44 
45  /* Create an input apm structure */
46 
47  ap.lsiz = 2048;
48  ap.csiz = 2048;
49  ap.xtnum = 0;
50  ap.inframe = NULL;
51  ap.conframe = NULL;
52  imcore_apinit(&ap);
53 
54  /* Test some of the various bits of the structure to see if they are
55  the correct values */
56 
57  cpl_test_eq(ap.maxpa,1024);
58  cpl_test_eq(ap.maxip,0);
59  cpl_test_nonnull(ap.lastline);
60  cpl_test_nonnull(ap.pstack);
61  cpl_test_nonnull(ap.parent);
62  cpl_test_eq(ap.pstack[10],10);
63  cpl_test_eq(ap.parent[10].pnop,-1);
64  cpl_test_eq(ap.parent[10].pnbp,-1);
65  cpl_test_eq(ap.ipstack,1);
66  cpl_test_nonnull(ap.bstack);
67  cpl_test_nonnull(ap.blink);
68  cpl_test_nonnull(ap.plessey);
69  cpl_test_eq(ap.bstack[10],10);
70  cpl_test_eq(ap.ibstack,2);
71  cpl_test_eq(ap.nimages,0);
72  cpl_test_eq(ap.areal[1],2*ap.areal[0]);
73  cpl_test_eq(ap.npl,ap.lsiz);
74  cpl_test_eq(ap.npl_pix,0);
75  cpl_test_nonnull(ap.plarray);
76  cpl_test_eq(ap.backmap.nby,-1);
77  cpl_test_null(ap.backmap.bvals);
78  cpl_test_null(ap.indata);
79  cpl_test_null(ap.confdata);
80 
81  /* Get out of here */
82 
83  imcore_apclose(&ap);
84  return(cpl_test_end(0));
85 
86 }
87 
88 /*
89 
90 $Log: imcore_apinit-test.c,v $
91 Revision 1.1 2015/10/15 11:27:22 jim
92 new
93 
94 
95 */
void imcore_apclose(ap_t *ap)
Close ap structure.
Definition: apinit.c:186
void imcore_apinit(ap_t *ap)
Initialise the ap structure.
Definition: apinit.c:65