aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/PJ_aea.c1
-rw-r--r--src/PJ_hammer.c44
-rw-r--r--src/PJ_hatano.c52
-rw-r--r--src/PJ_healpix.c119
-rw-r--r--src/PJ_igh.c44
-rw-r--r--src/PJ_imw_p.c44
-rw-r--r--src/PJ_isea.c30
-rw-r--r--src/PJ_krovak.c44
-rw-r--r--src/PJ_natearth.c44
-rw-r--r--src/PJ_natearth2.c44
-rw-r--r--src/PJ_nell.c44
-rw-r--r--src/PJ_nell_h.c44
-rw-r--r--src/PJ_nocol.c31
-rw-r--r--src/PJ_nsper.c44
-rw-r--r--src/PJ_nzmg.c44
-rw-r--r--src/PJ_ob_tran.c38
-rw-r--r--src/PJ_ocea.c44
-rw-r--r--src/PJ_oea.c44
-rw-r--r--src/PJ_omerc.c44
-rw-r--r--src/PJ_ortho.c44
-rw-r--r--src/PJ_patterson.c44
-rw-r--r--src/PJ_poly.c59
-rw-r--r--src/PJ_putp2.c46
-rw-r--r--src/PJ_putp3.c92
-rw-r--r--src/PJ_putp4p.c92
-rw-r--r--src/PJ_putp5.c88
-rw-r--r--src/PJ_putp6.c88
-rw-r--r--src/PJ_qsc.c59
-rw-r--r--src/pj_apply_gridshift.c16
-rw-r--r--src/pj_init.c5
-rw-r--r--src/projects.h2
31 files changed, 51 insertions, 1427 deletions
diff --git a/src/PJ_aea.c b/src/PJ_aea.c
index 5e8e3333..f48d2e9b 100644
--- a/src/PJ_aea.c
+++ b/src/PJ_aea.c
@@ -211,6 +211,7 @@ PJ *PROJECTION(leac) {
if (0==Q)
return pj_default_destructor (P, ENOMEM);
P->opaque = Q;
+ P->destructor = destructor;
Q->phi2 = pj_param(P->ctx, P->params, "rlat_1").f;
Q->phi1 = pj_param(P->ctx, P->params, "bsouth").i ? - M_HALFPI: M_HALFPI;
diff --git a/src/PJ_hammer.c b/src/PJ_hammer.c
index c18c9a69..443ce247 100644
--- a/src/PJ_hammer.c
+++ b/src/PJ_hammer.c
@@ -72,46 +72,4 @@ PJ *PROJECTION(hammer) {
}
-#ifndef PJ_SELFTEST
-int pj_hammer_selftest (void) {return 0;}
-#else
-
-int pj_hammer_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=hammer +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 223373.78870324057, 111703.90739776699},
- { 223373.78870324057, -111703.90739776699},
- {-223373.78870324057, 111703.90739776699},
- {-223373.78870324057, -111703.90739776699},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.001790493109965961, 0.00089524655487369749},
- { 0.001790493109965961, -0.00089524655487369749},
- {-0.001790493109965961, 0.00089524655487369749},
- {-0.001790493109965961, -0.00089524655487369749},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_hammer_selftest (void) {return 10000;}
diff --git a/src/PJ_hatano.c b/src/PJ_hatano.c
index be95fe73..ea4bacf8 100644
--- a/src/PJ_hatano.c
+++ b/src/PJ_hatano.c
@@ -79,54 +79,4 @@ PJ *PROJECTION(hatano) {
return P;
}
-#ifndef PJ_SELFTEST
-int pj_hatano_selftest (void) {return 0;}
-#else
-
-int pj_hatano_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=hatano +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 189878.87894652804, 131409.8024406255
-},
- { 189881.08195244463, -131409.14227607418
-},
- {-189878.87894652804, 131409.8024406255
-},
- {-189881.08195244463, -131409.14227607418
-},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.0021064624821817597, 0.00076095689425791926
-},
- { 0.0021064624821676096, -0.00076095777439265377
-},
- {-0.0021064624821817597, 0.00076095689425791926
-},
- {-0.0021064624821676096, -0.00076095777439265377
-},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_hatano_selftest (void) {return 10000;}
diff --git a/src/PJ_healpix.c b/src/PJ_healpix.c
index 438cb595..2d2af805 100644
--- a/src/PJ_healpix.c
+++ b/src/PJ_healpix.c
@@ -669,120 +669,5 @@ PJ *PROJECTION(rhealpix) {
}
-#ifndef PJ_SELFTEST
-int pj_healpix_selftest (void) {return 0;}
-#else
-
-int pj_healpix_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char e_args[] = {"+proj=healpix +ellps=GRS80 +lat_1=0.5 +lat_2=2"};
- char s_args[] = {"+proj=healpix +R=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY e_fwd_expect[] = {
- { 222390.10394923863, 130406.58866448226},
- { 222390.10394923863, -130406.58866448054},
- {-222390.10394923863, 130406.58866448226},
- {-222390.10394923863, -130406.58866448054},
- };
-
- XY s_fwd_expect[] = {
- { 223402.14425527418, 131588.04444199943},
- { 223402.14425527418, -131588.04444199943},
- {-223402.14425527418, 131588.04444199943},
- {-223402.14425527418, -131588.04444199943},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP e_inv_expect[] = {
- { 0.0017986411845524453, 0.00076679453057823619},
- { 0.0017986411845524453, -0.00076679453057823619},
- {-0.0017986411845524453, 0.00076679453057823619},
- {-0.0017986411845524453, -0.00076679453057823619},
- };
-
- LP s_inv_expect[] = {
- { 0.0017904931097838226, 0.00075990887733981202},
- { 0.0017904931097838226, -0.00075990887733981202},
- {-0.0017904931097838226, 0.00075990887733981202},
- {-0.0017904931097838226, -0.00075990887733981202},
- };
-
- return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
-}
-
-
-#endif
-
-#ifndef PJ_SELFTEST
-int pj_rhealpix_selftest (void) {return 0;}
-#else
-
-int pj_rhealpix_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char e_args[] = {"+proj=rhealpix +ellps=GRS80 +lat_1=0.5 +lat_2=2"};
- char s_args[] = {"+proj=rhealpix +R=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY e_fwd_expect[] = {
- { 222390.10394923863, 130406.58866448226},
- { 222390.10394923863, -130406.58866448054},
- {-222390.10394923863, 130406.58866448226},
- {-222390.10394923863, -130406.58866448054},
- };
-
- XY s_fwd_expect[] = {
- { 223402.14425527418, 131588.04444199943},
- { 223402.14425527418, -131588.04444199943},
- {-223402.14425527418, 131588.04444199943},
- {-223402.14425527418, -131588.04444199943},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP e_inv_expect[] = {
- { 0.0017986411845524453, 0.00076679453057823619},
- { 0.0017986411845524453, -0.00076679453057823619},
- {-0.0017986411845524453, 0.00076679453057823619},
- {-0.0017986411845524453, -0.00076679453057823619},
- };
-
- LP s_inv_expect[] = {
- { 0.0017904931097838226, 0.00075990887733981202},
- { 0.0017904931097838226, -0.00075990887733981202},
- {-0.0017904931097838226, 0.00075990887733981202},
- {-0.0017904931097838226, -0.00075990887733981202},
- };
-
- return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
-}
-
-
-#endif
+int pj_healpix_selftest (void) {return 10000;}
+int pj_rhealpix_selftest (void) {return 10000;}
diff --git a/src/PJ_igh.c b/src/PJ_igh.c
index 33cdde22..01cfa246 100644
--- a/src/PJ_igh.c
+++ b/src/PJ_igh.c
@@ -222,46 +222,4 @@ PJ *PROJECTION(igh) {
}
-#ifndef PJ_SELFTEST
-int pj_igh_selftest (void) {return 0;}
-#else
-
-int pj_igh_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=igh +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 223878.49745627123, 111701.07212763709},
- { 223708.37131305804, -111701.07212763709},
- {-222857.74059699223, 111701.07212763709},
- {-223027.86674020503, -111701.07212763709},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.001790489447892545, 0.00089524655489191132},
- { 0.0017904906685957927, -0.00089524655489191132},
- {-0.001790496772112032, 0.00089524655489191132},
- {-0.0017904955514087843, -0.00089524655489191132},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_igh_selftest (void) {return 10000;}
diff --git a/src/PJ_imw_p.c b/src/PJ_imw_p.c
index 7fd31fbb..f0c88efb 100644
--- a/src/PJ_imw_p.c
+++ b/src/PJ_imw_p.c
@@ -212,46 +212,4 @@ PJ *PROJECTION(imw_p) {
}
-#ifndef PJ_SELFTEST
-int pj_imw_p_selftest (void) {return 0;}
-#else
-
-int pj_imw_p_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char e_args[] = {"+proj=imw_p +ellps=GRS80 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY e_fwd_expect[] = {
- { 222588.4411393762, 55321.128653809537},
- { 222756.90637768712, -165827.58428832365},
- {-222588.4411393762, 55321.128653809537},
- {-222756.90637768712, -165827.58428832365},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP e_inv_expect[] = {
- { 0.0017966991379592214, 0.50090492361427374},
- { 0.0017966979081574697, 0.49909507588689922},
- {-0.0017966991379592214, 0.50090492361427374},
- {-0.0017966979081574697, 0.49909507588689922},
- };
-
- return pj_generic_selftest (e_args, 0, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, 0, inv_in, e_inv_expect, 0);
-}
-
-
-#endif
+int pj_imw_p_selftest (void) {return 10000;}
diff --git a/src/PJ_isea.c b/src/PJ_isea.c
index 223d8f28..72c34744 100644
--- a/src/PJ_isea.c
+++ b/src/PJ_isea.c
@@ -1148,32 +1148,4 @@ PJ *PROJECTION(isea) {
}
-#ifndef PJ_SELFTEST
-int pj_isea_selftest (void) {return 0;}
-#else
-
-int pj_isea_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=isea +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- {-1097074.9480224741, 3442909.3090371834},
- {-1097074.9482647954, 3233611.7285857084},
- {-1575486.3536415542, 3442168.3420281881},
- {-1575486.353880283, 3234352.6955947056},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, 0, 0, 0);
-}
-
-
-#endif
+int pj_isea_selftest (void) {return 10000;}
diff --git a/src/PJ_krovak.c b/src/PJ_krovak.c
index 640ce07f..929a2a6d 100644
--- a/src/PJ_krovak.c
+++ b/src/PJ_krovak.c
@@ -220,46 +220,4 @@ PJ *PROJECTION(krovak) {
}
-#ifndef PJ_SELFTEST
-int pj_krovak_selftest (void) {return 0;}
-#else
-
-int pj_krovak_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char e_args[] = {"+proj=krovak +ellps=GRS80 +no_defs"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY e_fwd_expect[] = {
- {-3196535.2325636409, -6617878.8675514441},
- {-3260035.4405521089, -6898873.6148780314},
- {-3756305.3288691747, -6478142.5615715114},
- {-3831703.6585019818, -6759107.1701553948},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP e_inv_expect[] = {
- {24.836218918719162, 59.758403933233858},
- {24.836315484509566, 59.756888425730189},
- {24.830447747947495, 59.758403933233858},
- {24.830351182157091, 59.756888425730189},
- };
-
- return pj_generic_selftest (e_args, 0, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, 0, inv_in, e_inv_expect, 0);
-}
-
-
-#endif
+int pj_krovak_selftest (void) {return 10000;}
diff --git a/src/PJ_natearth.c b/src/PJ_natearth.c
index 9c40f3da..2395ebb5 100644
--- a/src/PJ_natearth.c
+++ b/src/PJ_natearth.c
@@ -96,46 +96,4 @@ PJ *PROJECTION(natearth) {
return P;
}
-#ifndef PJ_SELFTEST
-int pj_natearth_selftest (void) {return 0;}
-#else
-
-int pj_natearth_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=natearth +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 194507.265257889288, 112508.737358294515},
- { 194507.265257889288, -112508.737358294515},
- {-194507.265257889288, 112508.737358294515},
- {-194507.265257889288, -112508.737358294515},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00205638349586440223, 0.000888823913291242177},
- { 0.00205638349586440223, -0.000888823913291242177},
- {-0.00205638349586440223, 0.000888823913291242177},
- {-0.00205638349586440223, -0.000888823913291242177},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_natearth_selftest (void) {return 10000;}
diff --git a/src/PJ_natearth2.c b/src/PJ_natearth2.c
index 95bb8646..162fd768 100644
--- a/src/PJ_natearth2.c
+++ b/src/PJ_natearth2.c
@@ -93,46 +93,4 @@ PJ *PROJECTION(natearth2) {
return P;
}
-#ifndef PJ_SELFTEST
-int pj_natearth2_selftest (void) {return 0;}
-#else
-
-int pj_natearth2_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=natearth2 +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 189255.172934730799, 113022.495810907014},
- { 189255.172934730799, -113022.495810907014},
- {-189255.172934730799, 113022.495810907014},
- {-189255.172934730799, -113022.495810907014},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00211344929691056112, 0.000884779612080993237},
- { 0.00211344929691056112, -0.000884779612080993237},
- {-0.00211344929691056112, 0.000884779612080993237},
- {-0.00211344929691056112, -0.000884779612080993237},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_natearth2_selftest (void) {return 10000;}
diff --git a/src/PJ_nell.c b/src/PJ_nell.c
index ac071fc9..c4d65b88 100644
--- a/src/PJ_nell.c
+++ b/src/PJ_nell.c
@@ -47,46 +47,4 @@ PJ *PROJECTION(nell) {
return P;
}
-#ifndef PJ_SELFTEST
-int pj_nell_selftest (void) {return 0;}
-#else
-
-int pj_nell_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=nell +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 223385.132504695706, 111698.23644718733},
- { 223385.132504695706, -111698.23644718733},
- {-223385.132504695706, 111698.23644718733},
- {-223385.132504695706, -111698.23644718733},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00179049310989310567, 0.000895246554910125161},
- { 0.00179049310989310567, -0.000895246554910125161},
- {-0.00179049310989310567, 0.000895246554910125161},
- {-0.00179049310989310567, -0.000895246554910125161},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_nell_selftest (void) {return 10000;}
diff --git a/src/PJ_nell_h.c b/src/PJ_nell_h.c
index fe9a75c6..ebc8be90 100644
--- a/src/PJ_nell_h.c
+++ b/src/PJ_nell_h.c
@@ -50,46 +50,4 @@ PJ *PROJECTION(nell_h) {
}
-#ifndef PJ_SELFTEST
-int pj_nell_h_selftest (void) {return 0;}
-#else
-
-int pj_nell_h_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=nell_h +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 223385.131640952837, 111698.236533561678},
- { 223385.131640952837, -111698.236533561678},
- {-223385.131640952837, 111698.236533561678},
- {-223385.131640952837, -111698.236533561678},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00179049310989310567, 0.000895246554910125378},
- { 0.00179049310989310567, -0.000895246554910125378},
- {-0.00179049310989310567, 0.000895246554910125378},
- {-0.00179049310989310567, -0.000895246554910125378},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_nell_h_selftest (void) {return 10000;}
diff --git a/src/PJ_nocol.c b/src/PJ_nocol.c
index 934ba7ab..aed5c382 100644
--- a/src/PJ_nocol.c
+++ b/src/PJ_nocol.c
@@ -50,33 +50,4 @@ PJ *PROJECTION(nicol) {
return P;
}
-
-#ifndef PJ_SELFTEST
-int pj_nicol_selftest (void) {return 0;}
-#else
-
-int pj_nicol_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=nicol +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 223374.561814139714, 111732.553988545071},
- { 223374.561814139714, -111732.553988545071},
- {-223374.561814139714, 111732.553988545071},
- {-223374.561814139714, -111732.553988545071},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, 0, 0, 0);
-}
-
-
-#endif
+int pj_nicol_selftest (void) {return 10000;}
diff --git a/src/PJ_nsper.c b/src/PJ_nsper.c
index 6c8ef74a..b83b807b 100644
--- a/src/PJ_nsper.c
+++ b/src/PJ_nsper.c
@@ -241,46 +241,4 @@ int pj_nsper_selftest (void) {
#endif
-#ifndef PJ_SELFTEST
-int pj_tpers_selftest (void) {return 0;}
-#else
-
-int pj_tpers_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=tpers +a=6400000 +h=1000000 +azi=20"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 170820.288955531199, 180460.865555804776},
- { 246853.941538942483, -28439.8780357754222},
- {-246853.941538942483, 28439.8780357754222},
- {-170820.288955531199, -180460.865555804776}
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00198870552603137678, 0.000228871872278689991},
- { 0.00137632081376749859, -0.00145364129728205432},
- {-0.00137632081376749859, 0.00145364129728205432},
- {-0.00198870552603137678, -0.000228871872278689991},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_tpers_selftest (void) {return 10000;}
diff --git a/src/PJ_nzmg.c b/src/PJ_nzmg.c
index b489e32f..04128cfb 100644
--- a/src/PJ_nzmg.c
+++ b/src/PJ_nzmg.c
@@ -119,46 +119,4 @@ PJ *PROJECTION(nzmg) {
}
-#ifndef PJ_SELFTEST
-int pj_nzmg_selftest (void) {return 0;}
-#else
-
-int pj_nzmg_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char e_args[] = {"+proj=nzmg +ellps=GRS80 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY e_fwd_expect[] = {
- {3352675144.74742508, -7043205391.10024357},
- {3691989502.77930641, -6729069415.33210468},
- {4099000768.45323849, -7863208779.66724873},
- {4466166927.36997604, -7502531736.62860489},
- };
-
- XY inv_in[] = {
- { 200000, 100000},
- { 200000,-100000},
- {-200000, 100000},
- {-200000,-100000}
- };
-
- LP e_inv_expect[] = {
- {175.48208682711271, -69.4226921826331846},
- {175.756819472543611, -69.5335710883796168},
- {134.605119233460016, -61.4599957106629091},
- {134.333684315954827, -61.6215536756024349},
- };
-
- return pj_generic_selftest (e_args, 0, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, 0, inv_in, e_inv_expect, 0);
-}
-
-
-#endif
+int pj_nzmg_selftest (void) {return 10000;}
diff --git a/src/PJ_ob_tran.c b/src/PJ_ob_tran.c
index 4f064809..3add8b29 100644
--- a/src/PJ_ob_tran.c
+++ b/src/PJ_ob_tran.c
@@ -228,10 +228,10 @@ PJ *PROJECTION(ob_tran) {
if (fabs(phip) > TOL) { /* oblique */
Q->cphip = cos(phip);
Q->sphip = sin(phip);
- P->fwd = o_forward;
+ P->fwd = Q->link->fwd ? o_forward : 0;
P->inv = Q->link->inv ? o_inverse : 0;
} else { /* transverse */
- P->fwd = t_forward;
+ P->fwd = Q->link->fwd ? t_forward : 0;
P->inv = Q->link->inv ? t_inverse : 0;
}
@@ -243,42 +243,10 @@ int pj_ob_tran_selftest (void) {return 0;}
#else
int pj_ob_tran_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
double d;
PJ *P;
PJ_COORD a, b;
- char s_args[] = {"+proj=ob_tran +R=6400000 +o_proj=latlon +o_lon_p=20 +o_lat_p=20 +lon_0=180"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- {-2.6856872138416592, 1.2374302350496296},
- {-2.6954069748943286, 1.2026833954513816},
- {-2.8993663925401947, 1.2374302350496296},
- {-2.8896466314875244, 1.2026833954513816},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 121.5518748407577, -2.5361001573966084},
- { 63.261184340201858, 17.585319578673531},
- {-141.10073322351622, 26.091712304855108},
- {-65.862385598848391, 51.830295078417215},
- };
-
/* -- Tests from nad/testvarious -------------------------------------------- */
P = proj_create (0, "+proj=ob_tran +o_proj=moll +R=6378137.0 +o_lon_p=0 +o_lat_p=0 +lon_0=180");
if (0==P)
@@ -303,7 +271,7 @@ int pj_ob_tran_selftest (void) {
/* -------------------------------------------------------------------------- */
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
+ return 0;
}
#endif \ No newline at end of file
diff --git a/src/PJ_ocea.c b/src/PJ_ocea.c
index d3fe9fe7..b4b6d68c 100644
--- a/src/PJ_ocea.c
+++ b/src/PJ_ocea.c
@@ -97,46 +97,4 @@ PJ *PROJECTION(ocea) {
}
-#ifndef PJ_SELFTEST
-int pj_ocea_selftest (void) {return 0;}
-#else
-
-int pj_ocea_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=ocea +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- {19994423.837934087962, 223322.760576727800},
- {20217962.128015257418, 223322.760576729401},
- {19994423.837934091687, -223322.760576726549},
- {20217962.128015264869, -223322.760576724948},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 179.999104753445, 0.001790493110},
- {-179.999104753445, 0.001790493110},
- { 179.999104753445, -0.001790493110},
- {-179.999104753445, -0.001790493110},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_ocea_selftest (void) {return 10000;}
diff --git a/src/PJ_oea.c b/src/PJ_oea.c
index 800a266e..aeef87c0 100644
--- a/src/PJ_oea.c
+++ b/src/PJ_oea.c
@@ -83,46 +83,4 @@ PJ *PROJECTION(oea) {
}
-#ifndef PJ_SELFTEST
-int pj_oea_selftest (void) {return 0;}
-#else
-
-int pj_oea_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=oea +a=6400000 +lat_1=0.5 +lat_2=2 +n=1 +m=2 +theta=3"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 228926.872097864107, 99870.4884300760023},
- { 217242.584036940476, -123247.885607474513},
- {-217242.584036940476, 123247.885607474556},
- {-228926.872097864078, -99870.4884300760168},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.0017411857167771369, 0.000987726819566195693},
- { 0.00183489288577854998, -0.000800312481495174641},
- {-0.00183489288577854954, 0.000800312481495174966},
- {-0.00174118571677713712, -0.000987726819566195043},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_oea_selftest (void) {return 10000;}
diff --git a/src/PJ_omerc.c b/src/PJ_omerc.c
index f0b4b439..b29033eb 100644
--- a/src/PJ_omerc.c
+++ b/src/PJ_omerc.c
@@ -224,46 +224,4 @@ PJ *PROJECTION(omerc) {
}
-#ifndef PJ_SELFTEST
-int pj_omerc_selftest (void) {return 0;}
-#else
-
-int pj_omerc_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char e_args[] = {"+proj=omerc +ellps=GRS80 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY e_fwd_expect[] = {
- { 222650.796885261341, 110642.229314983808},
- { 222650.796885261341, -110642.229314983808},
- {-222650.796885261545, 110642.229314983808},
- {-222650.796885261545, -110642.229314983808},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP e_inv_expect[] = {
- { 0.00179663056816996357, 0.000904369474808157338},
- { 0.00179663056816996357, -0.000904369474820879583},
- {-0.0017966305681604536, 0.000904369474808157338},
- {-0.0017966305681604536, -0.000904369474820879583},
- };
-
- return pj_generic_selftest (e_args, 0, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, 0, inv_in, e_inv_expect, 0);
-}
-
-
-#endif
+int pj_omerc_selftest (void) {return 10000;}
diff --git a/src/PJ_ortho.c b/src/PJ_ortho.c
index 14e228f7..a497b160 100644
--- a/src/PJ_ortho.c
+++ b/src/PJ_ortho.c
@@ -131,46 +131,4 @@ PJ *PROJECTION(ortho) {
}
-#ifndef PJ_SELFTEST
-int pj_ortho_selftest (void) {return 0;}
-#else
-
-int pj_ortho_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=ortho +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 223322.76057672748, 111695.401198614476},
- { 223322.76057672748, -111695.401198614476},
- {-223322.76057672748, 111695.401198614476},
- {-223322.76057672748, -111695.401198614476},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.0017904931102938101, 0.000895246554928338998},
- { 0.0017904931102938101, -0.000895246554928338998},
- {-0.0017904931102938101, 0.000895246554928338998},
- {-0.0017904931102938101, -0.000895246554928338998},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_ortho_selftest (void) {return 10000;}
diff --git a/src/PJ_patterson.c b/src/PJ_patterson.c
index 40b90010..9f9e3e39 100644
--- a/src/PJ_patterson.c
+++ b/src/PJ_patterson.c
@@ -114,46 +114,4 @@ PJ *PROJECTION(patterson) {
}
-#ifndef PJ_SELFTEST
-int pj_patterson_selftest (void) {return 0;}
-#else
-
-int pj_patterson_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=patterson +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- {223402.144255274179, 113354.250397779804},
- {223402.144255274179, -113354.250397779804},
- {-223402.144255274179, 113354.250397779804},
- {-223402.144255274179, -113354.250397779804},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- {0.00179049310978382265, 0.000882190140807953657},
- {0.00179049310978382265, -0.000882190140807953657},
- {-0.00179049310978382265, 0.000882190140807953657},
- {-0.00179049310978382265, -0.000882190140807953657},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_patterson_selftest (void) {return 10000;}
diff --git a/src/PJ_poly.c b/src/PJ_poly.c
index 209669c0..d748be09 100644
--- a/src/PJ_poly.c
+++ b/src/PJ_poly.c
@@ -165,61 +165,4 @@ PJ *PROJECTION(poly) {
}
-#ifndef PJ_SELFTEST
-int pj_poly_selftest (void) {return 0;}
-#else
-
-int pj_poly_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char e_args[] = {"+proj=poly +ellps=GRS80 +lat_1=0.5 +lat_2=2"};
- char s_args[] = {"+proj=poly +R=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY e_fwd_expect[] = {
- { 222605.285770237475, 110642.194561440483},
- { 222605.285770237475, -110642.194561440483},
- {-222605.285770237475, 110642.194561440483},
- {-222605.285770237475, -110642.194561440483},
- };
-
- XY s_fwd_expect[] = {
- { 223368.105210218986, 111769.110491224754},
- { 223368.105210218986, -111769.110491224754},
- {-223368.105210218986, 111769.110491224754},
- {-223368.105210218986, -111769.110491224754},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP e_inv_expect[] = {
- { 0.00179663056846135222, 0.000904369476631838518},
- { 0.00179663056846135222, -0.000904369476631838518},
- {-0.00179663056846135222, 0.000904369476631838518},
- {-0.00179663056846135222, -0.000904369476631838518},
- };
-
- LP s_inv_expect[] = {
- { 0.0017904931100023887, 0.000895246554454779222},
- { 0.0017904931100023887, -0.000895246554454779222},
- {-0.0017904931100023887, 0.000895246554454779222},
- {-0.0017904931100023887, -0.000895246554454779222},
- };
-
- return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
-}
-
-
-#endif
+int pj_poly_selftest (void) {return 10000;}
diff --git a/src/PJ_putp2.c b/src/PJ_putp2.c
index 83aa5f45..59eca8a6 100644
--- a/src/PJ_putp2.c
+++ b/src/PJ_putp2.c
@@ -1,5 +1,5 @@
#define PJ_LIB__
-#include <projects.h>
+#include "projects.h"
PROJ_HEAD(putp2, "Putnins P2") "\n\tPCyl., Sph.";
@@ -57,46 +57,4 @@ PJ *PROJECTION(putp2) {
return P;
}
-#ifndef PJ_SELFTEST
-int pj_putp2_selftest (void) {return 0;}
-#else
-
-int pj_putp2_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=putp2 +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 211638.039634339279, 117895.033043379764},
- { 211638.039634339279, -117895.033043379764},
- {-211638.039634339279, 117895.033043379764},
- {-211638.039634339279, -117895.033043379764},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00188980221640386672, 0.000848201580276863377},
- { 0.00188980221640386672, -0.000848201580276863377},
- {-0.00188980221640386672, 0.000848201580276863377},
- {-0.00188980221640386672, -0.000848201580276863377},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_putp2_selftest (void) {return 10000;}
diff --git a/src/PJ_putp3.c b/src/PJ_putp3.c
index cb216370..dfd152f8 100644
--- a/src/PJ_putp3.c
+++ b/src/PJ_putp3.c
@@ -63,93 +63,5 @@ PJ *PROJECTION(putp3p) {
return P;
}
-
-#ifndef PJ_SELFTEST
-int pj_putp3_selftest (void) {return 0;}
-#else
-
-int pj_putp3_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=putp3 +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 178227.115507793525, 89124.5607860879827},
- { 178227.115507793525, -89124.5607860879827},
- {-178227.115507793525, 89124.5607860879827},
- {-178227.115507793525, -89124.5607860879827},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00224405032986489889, 0.00112202516475805899},
- { 0.00224405032986489889, -0.00112202516475805899},
- {-0.00224405032986489889, 0.00112202516475805899},
- {-0.00224405032986489889, -0.00112202516475805899},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
-
-
-#ifndef PJ_SELFTEST
-int pj_putp3p_selftest (void) {return 0;}
-#else
-
-int pj_putp3p_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=putp3p +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 178238.118539984745, 89124.5607860879827},
- { 178238.118539984745, -89124.5607860879827},
- {-178238.118539984745, 89124.5607860879827},
- {-178238.118539984745, -89124.5607860879827},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00224405032969050844, 0.00112202516475805899},
- { 0.00224405032969050844, -0.00112202516475805899},
- {-0.00224405032969050844, 0.00112202516475805899},
- {-0.00224405032969050844, -0.00112202516475805899},
-
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_putp3_selftest (void) {return 10000;}
+int pj_putp3p_selftest (void) {return 10000;}
diff --git a/src/PJ_putp4p.c b/src/PJ_putp4p.c
index 197f24c4..576ffbf6 100644
--- a/src/PJ_putp4p.c
+++ b/src/PJ_putp4p.c
@@ -1,6 +1,6 @@
#define PJ_LIB__
#include <errno.h>
-#include <projects.h>
+#include "projects.h"
struct pj_opaque {
double C_x, C_y;
@@ -71,91 +71,5 @@ PJ *PROJECTION(weren) {
}
-#ifndef PJ_SELFTEST
-int pj_putp4p_selftest (void) {return 0;}
-#else
-
-int pj_putp4p_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=putp4p +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 195241.47734938623, 127796.782307926231},
- { 195241.47734938623, -127796.782307926231},
- {-195241.47734938623, 127796.782307926231},
- {-195241.47734938623, -127796.782307926231},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00204852830860296001, 0.000782480174932193733},
- { 0.00204852830860296001, -0.000782480174932193733},
- {-0.00204852830860296001, 0.000782480174932193733},
- {-0.00204852830860296001, -0.000782480174932193733},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
-
-
-#ifndef PJ_SELFTEST
-int pj_weren_selftest (void) {return 0;}
-#else
-
-int pj_weren_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=weren +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 223378.515757633519, 146214.093042288267},
- { 223378.515757633519, -146214.093042288267},
- {-223378.515757633519, 146214.093042288267},
- {-223378.515757633519, -146214.093042288267},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00179049310987240413, 0.000683917989676492265},
- { 0.00179049310987240413, -0.000683917989676492265},
- {-0.00179049310987240413, 0.000683917989676492265},
- {-0.00179049310987240413, -0.000683917989676492265},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-
-#endif
+int pj_putp4p_selftest (void) {return 10000;}
+int pj_weren_selftest (void) {return 10000;}
diff --git a/src/PJ_putp5.c b/src/PJ_putp5.c
index f8b431b1..2a847fa7 100644
--- a/src/PJ_putp5.c
+++ b/src/PJ_putp5.c
@@ -69,89 +69,5 @@ PJ *PROJECTION(putp5p) {
return P;
}
-#ifndef PJ_SELFTEST
-int pj_putp5_selftest (void) {return 0;}
-#else
-
-int pj_putp5_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=putp5 +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 226367.21338056153, 113204.56855847509},
- { 226367.21338056153, -113204.56855847509},
- {-226367.21338056153, 113204.56855847509},
- {-226367.21338056153, -113204.56855847509},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00176671315102969553, 0.000883356575387199546},
- { 0.00176671315102969553, -0.000883356575387199546},
- {-0.00176671315102969553, 0.000883356575387199546},
- {-0.00176671315102969553, -0.000883356575387199546},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-#endif
-
-
-#ifndef PJ_SELFTEST
-int pj_putp5p_selftest (void) {return 0;}
-#else
-
-int pj_putp5p_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=putp5p +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 226388.175248755841, 113204.56855847509},
- { 226388.175248755841, -113204.56855847509},
- {-226388.175248755841, 113204.56855847509},
- {-226388.175248755841, -113204.56855847509},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00176671315090204742, 0.000883356575387199546},
- { 0.00176671315090204742, -0.000883356575387199546},
- {-0.00176671315090204742, 0.000883356575387199546},
- {-0.00176671315090204742, -0.000883356575387199546},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-#endif
+int pj_putp5_selftest (void) {return 10000;}
+int pj_putp5p_selftest (void) {return 10000;}
diff --git a/src/PJ_putp6.c b/src/PJ_putp6.c
index 50859f14..be86f805 100644
--- a/src/PJ_putp6.c
+++ b/src/PJ_putp6.c
@@ -92,89 +92,5 @@ PJ *PROJECTION(putp6p) {
}
-#ifndef PJ_SELFTEST
-int pj_putp6_selftest (void) {return 0;}
-#else
-
-int pj_putp6_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=putp6 +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 226369.395133402577, 110218.523796520662},
- { 226369.395133402577, -110218.523796520749},
- {-226369.395133402577, 110218.523796520662},
- {-226369.395133402577, -110218.523796520749},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00176671315102969921, 0.000907295534210503544},
- { 0.00176671315102969921, -0.000907295534205924308},
- {-0.00176671315102969921, 0.000907295534210503544},
- {-0.00176671315102969921, -0.000907295534205924308},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-#endif
-
-
-#ifndef PJ_SELFTEST
-int pj_putp6p_selftest (void) {return 0;}
-#else
-
-int pj_putp6p_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char s_args[] = {"+proj=putp6p +a=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY s_fwd_expect[] = {
- { 198034.195132195076, 125989.475461323193},
- { 198034.195132195076, -125989.475461323193},
- {-198034.195132195076, 125989.475461323193},
- {-198034.195132195076, -125989.475461323193},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP s_inv_expect[] = {
- { 0.00201955053120177067, 0.000793716441164738612},
- { 0.00201955053120177067, -0.000793716441164738612},
- {-0.00201955053120177067, 0.000793716441164738612},
- {-0.00201955053120177067, -0.000793716441164738612},
- };
-
- return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect);
-}
-
-#endif
+int pj_putp6_selftest (void) {return 10000;}
+int pj_putp6p_selftest (void) {return 10000;}
diff --git a/src/PJ_qsc.c b/src/PJ_qsc.c
index f30a7048..c8079f9e 100644
--- a/src/PJ_qsc.c
+++ b/src/PJ_qsc.c
@@ -399,61 +399,4 @@ PJ *PROJECTION(qsc) {
}
-#ifndef PJ_SELFTEST
-int pj_qsc_selftest (void) {return 0;}
-#else
-
-int pj_qsc_selftest (void) {
- double tolerance_lp = 1e-10;
- double tolerance_xy = 1e-7;
-
- char e_args[] = {"+proj=qsc +ellps=GRS80 +lat_1=0.5 +lat_2=2"};
- char s_args[] = {"+proj=qsc +R=6400000 +lat_1=0.5 +lat_2=2"};
-
- LP fwd_in[] = {
- { 2, 1},
- { 2,-1},
- {-2, 1},
- {-2,-1}
- };
-
- XY e_fwd_expect[] = {
- { 304638.450843852363, 164123.870923793991},
- { 304638.450843852363, -164123.870923793991},
- {-304638.450843852363, 164123.870923793962},
- {-304638.450843852421, -164123.870923793904},
- };
-
- XY s_fwd_expect[] = {
- { 305863.792402890511, 165827.722754715243},
- { 305863.792402890511, -165827.722754715243},
- {-305863.792402890511, 165827.722754715243},
- {-305863.792402890569, -165827.722754715156},
- };
-
- XY inv_in[] = {
- { 200, 100},
- { 200,-100},
- {-200, 100},
- {-200,-100}
- };
-
- LP e_inv_expect[] = {
- { 0.00132134098471627126, 0.000610652900922527926},
- { 0.00132134098471627126, -0.000610652900922527926},
- {-0.00132134098471627126, 0.000610652900922527926},
- {-0.00132134098471627126, -0.000610652900922527926},
- };
-
- LP s_inv_expect[] = {
- { 0.00131682718763827234, 0.000604493198178676161},
- { 0.00131682718763827234, -0.000604493198178676161},
- {-0.00131682718763827234, 0.000604493198178676161},
- {-0.00131682718763827234, -0.000604493198178676161},
- };
-
- return pj_generic_selftest (e_args, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, e_fwd_expect, s_fwd_expect, inv_in, e_inv_expect, s_inv_expect);
-}
-
-
-#endif
+int pj_qsc_selftest (void) {return 10000;}
diff --git a/src/pj_apply_gridshift.c b/src/pj_apply_gridshift.c
index 7d9ac94b..a2267cbd 100644
--- a/src/pj_apply_gridshift.c
+++ b/src/pj_apply_gridshift.c
@@ -112,16 +112,14 @@ int pj_apply_gridshift_2( PJ *defn, int inverse,
static struct CTABLE* find_ctable(projCtx ctx, LP input, int grid_count, PJ_GRIDINFO **tables) {
int itable;
- double epsilon;
- struct CTABLE *ct = NULL;
/* keep trying till we find a table that works */
for( itable = 0; itable < grid_count; itable++ )
{
PJ_GRIDINFO *gi = tables[itable];
- ct = gi->ct;
- epsilon = (fabs(ct->del.phi)+fabs(ct->del.lam))/10000.0;
+ struct CTABLE *ct = gi->ct;
+ double epsilon = (fabs(ct->del.phi)+fabs(ct->del.lam))/10000.0;
/* skip tables that don't match our point at all. */
if ( ct->ll.phi - epsilon > input.phi
|| ct->ll.lam - epsilon > input.lam
@@ -164,9 +162,10 @@ static struct CTABLE* find_ctable(projCtx ctx, LP input, int grid_count, PJ_GRID
}
}
/* if we get this far we have found a suitable grid */
- break;
+ return ct;
}
- return ct;
+
+ return NULL;
}
/************************************************************************/
@@ -204,7 +203,10 @@ int pj_apply_gridshift_3( projCtx ctx, PJ_GRIDINFO **tables, int grid_count,
output.lam = HUGE_VAL;
ct = find_ctable(ctx, input, grid_count, tables);
- output = nad_cvt( input, inverse, ct );
+ if( ct != NULL )
+ {
+ output = nad_cvt( input, inverse, ct );
+ }
if ( output.lam != HUGE_VAL && debug_count++ < 20 )
pj_log( ctx, PJ_LOG_DEBUG_MINOR, "pj_apply_gridshift(): used %s", ct->id );
diff --git a/src/pj_init.c b/src/pj_init.c
index f69d9eae..534f0827 100644
--- a/src/pj_init.c
+++ b/src/pj_init.c
@@ -500,7 +500,7 @@ pj_init_ctx(projCtx ctx, int argc, char **argv) {
/* find projection selection */
if (!(name = pj_param(ctx, start, "sproj").s))
- return pj_default_destructor (PIN, PJD_ERR_PROJ_NOT_NAMED);
+ return pj_dealloc_params (ctx, start, PJD_ERR_PROJ_NOT_NAMED);
for (i = 0; (s = pj_list[i].id) && strcmp(name, s) ; ++i) ;
if (!s)
@@ -693,7 +693,10 @@ pj_init_ctx(projCtx ctx, int argc, char **argv) {
/* projection specific initialization */
PIN = proj(PIN);
if ((0==PIN) || ctx->last_errno)
+ {
+ pj_free(PIN);
return 0;
+ }
return PIN;
}
diff --git a/src/projects.h b/src/projects.h
index a43826d2..a28c08d1 100644
--- a/src/projects.h
+++ b/src/projects.h
@@ -84,7 +84,7 @@ extern "C" {
#endif
/* prototype hypot for systems where absent */
-#if !defined(_WIN32) || !defined(__ANSI__)
+#if !(defined(HAVE_C99_MATH) && HAVE_C99_MATH)
extern double hypot(double, double);
#endif