FORS Pipeline Reference Manual  5.0.9
fors_point-test.c
1 /* $Id: fors_point-test.c,v 1.1 2007-08-28 13:33:09 jmlarsen Exp $
2  *
3  * This file is part of the FORS Library
4  * Copyright (C) 2002-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /*
22  * $Author: jmlarsen $
23  * $Date: 2007-08-28 13:33:09 $
24  * $Revision: 1.1 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 
32 #include <fors_point.h>
33 #include <test.h>
34 
44 static void
46 {
47  fors_point *p1 = fors_point_new(1, 2);
48  fors_point *p2 = fors_point_new(2, 2);
49 
50  test_abs( fors_point_distsq(p1, p2), 1.0, 0.01 );
51 
52  fors_point_delete(&p1);
53  fors_point_delete(&p2);
54 
55  return;
56 }
57 
58 
62 int main(void)
63 {
64  TEST_INIT;
65 
66  test_point();
67 
68  TEST_END;
69 }
70 
fors_point * fors_point_new(double x, double y)
Constructor.
Definition: fors_point.c:53
int main(void)
Generic library tests.
Definition: fors-test.c:57
void fors_point_delete(fors_point **p)
Destructor.
Definition: fors_point.c:87
static void test_point(void)
test
double fors_point_distsq(const fors_point *p, const fors_point *q)
Metric.
Definition: fors_point.c:103