diff options
66 files changed, 108 insertions, 3798 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_labrd.c b/src/PJ_labrd.c index 4b5d93a5..7db03249 100644 --- a/src/PJ_labrd.c +++ b/src/PJ_labrd.c @@ -129,46 +129,4 @@ PJ *PROJECTION(labrd) { } -#ifndef PJ_SELFTEST -int pj_labrd_selftest (void) {return 0;} -#else - -int pj_labrd_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=labrd +ellps=GRS80 +lon_0=0.5 +lat_0=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - { 166973.166090228391, -110536.912730266107}, - { 166973.168287157256, -331761.993650884193}, - {-278345.500519976194, -110469.032642031714}, - {-278345.504185269645, -331829.870790275279}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.501797719349373672, 2.00090435742047923}, - {0.501797717380853658, 1.99909564058898681}, - {0.498202280650626328, 2.00090435742047923}, - {0.498202282619146342, 1.99909564058898681}, - }; - - 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_labrd_selftest (void) {return 10000;} diff --git a/src/PJ_laea.c b/src/PJ_laea.c index 0c5d5db9..5cf5f5cd 100644 --- a/src/PJ_laea.c +++ b/src/PJ_laea.c @@ -296,61 +296,4 @@ PJ *PROJECTION(laea) { } -#ifndef PJ_SELFTEST -int pj_laea_selftest (void) {return 0;} -#else - -int pj_laea_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=laea +ellps=GRS80 +lat_1=0.5 +lat_2=2"}; - char s_args[] = {"+proj=laea +R=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - { 222602.471450095181, 110589.82722441027}, - { 222602.471450095181, -110589.827224408786}, - {-222602.471450095181, 110589.82722441027}, - {-222602.471450095181, -110589.827224408786}, - }; - - XY s_fwd_expect[] = { - { 223365.281370124663, 111716.668072915665}, - { 223365.281370124663, -111716.668072915665}, - {-223365.281370124663, 111716.668072915665}, - {-223365.281370124663, -111716.668072915665}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - { 0.00179663056847900867, 0.000904369475966495845}, - { 0.00179663056847900867, -0.000904369475966495845}, - {-0.00179663056847900867, 0.000904369475966495845}, - {-0.00179663056847900867, -0.000904369475966495845}, - }; - - LP s_inv_expect[] = { - { 0.00179049311002060264, 0.000895246554791735271}, - { 0.00179049311002060264, -0.000895246554791735271}, - {-0.00179049311002060264, 0.000895246554791735271}, - {-0.00179049311002060264, -0.000895246554791735271}, - }; - - 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_laea_selftest (void) {return 10000;} diff --git a/src/PJ_lagrng.c b/src/PJ_lagrng.c index e30f6a36..584f9a7a 100644 --- a/src/PJ_lagrng.c +++ b/src/PJ_lagrng.c @@ -62,32 +62,4 @@ PJ *PROJECTION(lagrng) { } -#ifndef PJ_SELFTEST -int pj_lagrng_selftest (void) {return 0;} -#else - -int pj_lagrng_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=lagrng +a=6400000 +W=2 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 111703.37591722561, 27929.8319080333386}, - { 111699.122088816002, -83784.1780133577704}, - {-111703.37591722561, 27929.8319080333386}, - {-111699.122088816002, -83784.1780133577704}, - }; - - 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_lagrng_selftest (void) {return 10000;} diff --git a/src/PJ_larr.c b/src/PJ_larr.c index cd6e6c8a..dc791ba0 100644 --- a/src/PJ_larr.c +++ b/src/PJ_larr.c @@ -25,32 +25,4 @@ PJ *PROJECTION(larr) { } -#ifndef PJ_SELFTEST -int pj_larr_selftest (void) {return 0;} -#else - -int pj_larr_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=larr +a=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - {223393.637624200899, 111707.215961255497}, - {223393.637624200899, -111707.215961255497}, - {-223393.637624200899, 111707.215961255497}, - {-223393.637624200899, -111707.215961255497}, - }; - - 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_larr_selftest (void) {return 10000;} diff --git a/src/PJ_lask.c b/src/PJ_lask.c index d0efeb7d..998b3bbe 100644 --- a/src/PJ_lask.c +++ b/src/PJ_lask.c @@ -37,32 +37,4 @@ PJ *PROJECTION(lask) { return P; } -#ifndef PJ_SELFTEST -int pj_lask_selftest (void) {return 0;} -#else - -int pj_lask_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=lask +a=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 217928.275907355128, 112144.32922014239}, - { 217928.275907355128, -112144.32922014239}, - {-217928.275907355128, 112144.32922014239}, - {-217928.275907355128, -112144.32922014239}, - }; - - 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_lask_selftest (void) {return 10000;} diff --git a/src/PJ_latlong.c b/src/PJ_latlong.c index 35c573aa..612bef78 100644 --- a/src/PJ_latlong.c +++ b/src/PJ_latlong.c @@ -131,7 +131,7 @@ PJ *PROJECTION(lonlat) { * * The code should be covered by the tests in nad/. * */ -int pj_latlong_selftest (void) {return 0;} -int pj_longlat_selftest (void) {return 0;} -int pj_latlon_selftest (void) {return 0;} -int pj_lonlat_selftest (void) {return 0;} +int pj_latlong_selftest (void) {return 10000;} +int pj_longlat_selftest (void) {return 10000;} +int pj_latlon_selftest (void) {return 10000;} +int pj_lonlat_selftest (void) {return 10000;} diff --git a/src/PJ_lcc.c b/src/PJ_lcc.c index 78c227b8..4a392690 100644 --- a/src/PJ_lcc.c +++ b/src/PJ_lcc.c @@ -145,46 +145,4 @@ PJ *PROJECTION(lcc) { } -#ifndef PJ_SELFTEST -int pj_lcc_selftest (void) {return 0;} -#else - -int pj_lcc_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=lcc +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.439735968423, 110660.533870799671}, - { 222756.879700278747, -110532.797660827026}, - {-222588.439735968423, 110660.533870799671}, - {-222756.879700278747, -110532.797660827026}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - { 0.00179635940600536667, 0.000904232207322381741}, - { 0.00179635817735249777, -0.000904233135128348995}, - {-0.00179635940600536667, 0.000904232207322381741}, - {-0.00179635817735249777, -0.000904233135128348995}, - }; - - 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_lcc_selftest (void) {return 10000;} diff --git a/src/PJ_lcca.c b/src/PJ_lcca.c index cf1aa83f..6aa33c4f 100644 --- a/src/PJ_lcca.c +++ b/src/PJ_lcca.c @@ -160,46 +160,4 @@ PJ *PROJECTION(lcca) { -#ifndef PJ_SELFTEST -int pj_lcca_selftest (void) {return 0;} -#else - -int pj_lcca_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=lcca +ellps=GRS80 +lat_0=1 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - { 222605.285770237417, 67.8060072715846616}, - { 222740.037637936533, -221125.539829601563}, - {-222605.285770237417, 67.8060072715846616}, - {-222740.037637936533, -221125.539829601563}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - { 0.00179690290525662526, 1.00090436621350798}, - { 0.00179690192174008037, 0.999095632791497268}, - {-0.00179690290525662526, 1.00090436621350798}, - {-0.00179690192174008037, 0.999095632791497268}, - }; - - 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_lcca_selftest (void) {return 10000;} diff --git a/src/PJ_loxim.c b/src/PJ_loxim.c index a4ae074b..2b3e922d 100644 --- a/src/PJ_loxim.c +++ b/src/PJ_loxim.c @@ -72,46 +72,4 @@ PJ *PROJECTION(loxim) { } -#ifndef PJ_SELFTEST -int pj_loxim_selftest (void) {return 0;} -#else - -int pj_loxim_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=loxim +a=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 223382.295791338867, 55850.5360638185448}, - { 223393.637462243292, -167551.608191455656}, - {-223382.295791338867, 55850.5360638185448}, - {-223393.637462243292, -167551.608191455656}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - { 0.00179056141104335601, 0.500895246554891926}, - { 0.00179056116683692576, 0.499104753445108074}, - {-0.00179056141104335601, 0.500895246554891926}, - {-0.00179056116683692576, 0.499104753445108074}, - }; - - 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_loxim_selftest (void) {return 10000;} diff --git a/src/PJ_lsat.c b/src/PJ_lsat.c index 7319bee7..b3c36fe8 100644 --- a/src/PJ_lsat.c +++ b/src/PJ_lsat.c @@ -209,46 +209,4 @@ PJ *PROJECTION(lsat) { } -#ifndef PJ_SELFTEST -int pj_lsat_selftest (void) {return 0;} -#else - -int pj_lsat_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=lsat +ellps=GRS80 +lat_1=0.5 +lat_2=2 +lsat=1 +path=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {18241950.01455855, 9998256.83982293494}, - {18746856.2533194572, 10215761.669925211}, - {18565503.6836331636, 9085039.14672705345}, - {19019696.9020289108, 9247763.0394328218}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {126.000423834530011, 0.00172378224025701425}, - {126.002213738256714, 0.00188015467480917966}, - {126.000734468914601, -0.00188015467480917966}, - {126.002524372641304, -0.00172378224025701425}, - }; - - 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_lsat_selftest (void) {return 10000;} diff --git a/src/PJ_mbt_fps.c b/src/PJ_mbt_fps.c index c35da04c..6499249c 100644 --- a/src/PJ_mbt_fps.c +++ b/src/PJ_mbt_fps.c @@ -53,46 +53,4 @@ PJ *PROJECTION(mbt_fps) { return P; } -#ifndef PJ_SELFTEST -int pj_mbt_fps_selftest (void) {return 0;} -#else - -int pj_mbt_fps_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=mbt_fps +a=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 198798.176129849948, 125512.017254530627}, - { 198798.176129849948, -125512.017254530627}, - {-198798.176129849948, 125512.017254530627}, - {-198798.176129849948, -125512.017254530627}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - { 0.00201197086238270742, 0.000796711850174446003}, - { 0.00201197086238270742, -0.000796711850174446003}, - {-0.00201197086238270742, 0.000796711850174446003}, - {-0.00201197086238270742, -0.000796711850174446003}, - }; - - 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_mbt_fps_selftest (void) {return 10000;} diff --git a/src/PJ_mbtfpp.c b/src/PJ_mbtfpp.c index 2bbb16b1..61254859 100644 --- a/src/PJ_mbtfpp.c +++ b/src/PJ_mbtfpp.c @@ -61,46 +61,4 @@ PJ *PROJECTION(mbtfpp) { return P; } -#ifndef PJ_SELFTEST -int pj_mbtfpp_selftest (void) {return 0;} -#else - -int pj_mbtfpp_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=mbtfpp +a=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - {206804.786929820373, 120649.762565792524}, - {206804.786929820373, -120649.762565792524}, - {-206804.786929820373, 120649.762565792524}, - {-206804.786929820373, -120649.762565792524}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - {0.00193395359462902698, 0.00082883725477665357}, - {0.00193395359462902698, -0.00082883725477665357}, - {-0.00193395359462902698, 0.00082883725477665357}, - {-0.00193395359462902698, -0.00082883725477665357}, - }; - - 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_mbtfpp_selftest (void) {return 10000;} diff --git a/src/PJ_mbtfpq.c b/src/PJ_mbtfpq.c index 4901401e..a3743b59 100644 --- a/src/PJ_mbtfpq.c +++ b/src/PJ_mbtfpq.c @@ -70,46 +70,4 @@ PJ *PROJECTION(mbtfpq) { return P; } -#ifndef PJ_SELFTEST -int pj_mbtfpq_selftest (void) {return 0;} -#else - -int pj_mbtfpq_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=mbtfpq +a=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 209391.854738393013, 119161.040199054827}, - { 209391.854738393013, -119161.040199054827}, - {-209391.854738393013, 119161.040199054827}, - {-209391.854738393013, -119161.040199054827}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - { 0.00191010555824111571, 0.000839185447792341723}, - { 0.00191010555824111571, -0.000839185447792341723}, - {-0.00191010555824111571, 0.000839185447792341723}, - {-0.00191010555824111571, -0.000839185447792341723}, - }; - - 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_mbtfpq_selftest (void) {return 10000;} diff --git a/src/PJ_merc.c b/src/PJ_merc.c index d17a2d50..994d540f 100644 --- a/src/PJ_merc.c +++ b/src/PJ_merc.c @@ -77,61 +77,4 @@ PJ *PROJECTION(merc) { } -#ifndef PJ_SELFTEST -int pj_merc_selftest (void) {return 0;} -#else - -int pj_merc_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=merc +ellps=GRS80 +lat_1=0.5 +lat_2=2"}; - char s_args[] = {"+proj=merc +R=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - { 222638.981586547132, 110579.965218249708}, - { 222638.981586547132, -110579.965218249112}, - {-222638.981586547132, 110579.965218249708}, - {-222638.981586547132, -110579.965218249112}, - }; - - XY s_fwd_expect[] = { - { 223402.144255274179, 111706.743574944077}, - { 223402.144255274179, -111706.743574944485}, - {-223402.144255274179, 111706.743574944077}, - {-223402.144255274179, -111706.743574944485}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - { 0.00179663056823904264, 0.00090436947522799056}, - { 0.00179663056823904264, -0.00090436947522799056}, - {-0.00179663056823904264, 0.00090436947522799056}, - {-0.00179663056823904264, -0.00090436947522799056}, - }; - - LP s_inv_expect[] = { - { 0.00179049310978382265, 0.000895246554845297135}, - { 0.00179049310978382265, -0.000895246554858019272}, - {-0.00179049310978382265, 0.000895246554845297135}, - {-0.00179049310978382265, -0.000895246554858019272}, - }; - - 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_merc_selftest (void) {return 10000;} diff --git a/src/PJ_mill.c b/src/PJ_mill.c index 829bc3be..c491d79d 100644 --- a/src/PJ_mill.c +++ b/src/PJ_mill.c @@ -34,46 +34,4 @@ PJ *PROJECTION(mill) { } -#ifndef PJ_SELFTEST -int pj_mill_selftest (void) {return 0;} -#else - -int pj_mill_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=mill +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, 111704.701754393827}, - { 223402.144255274179, -111704.701754396243}, - {-223402.144255274179, 111704.701754393827}, - {-223402.144255274179, -111704.701754396243}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - { 0.00179049310978382265, 0.000895246554873922024}, - { 0.00179049310978382265, -0.000895246554873922024}, - {-0.00179049310978382265, 0.000895246554873922024}, - {-0.00179049310978382265, -0.000895246554873922024}, - }; - - 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_mill_selftest (void) {return 10000;} diff --git a/src/PJ_misrsom.c b/src/PJ_misrsom.c index 5c5a226f..77717f03 100644 --- a/src/PJ_misrsom.c +++ b/src/PJ_misrsom.c @@ -216,61 +216,4 @@ PJ *PROJECTION(misrsom) { } -#ifndef PJ_SELFTEST -int pj_misrsom_selftest (void) {return 0;} -#else - -int pj_misrsom_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=misrsom +ellps=GRS80 +lat_1=0.5 +lat_2=2 +path=1"}; - char s_args[] = {"+proj=misrsom +R=6400000 +lat_1=0.5 +lat_2=2 +path=1"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {18556630.3683698252, 9533394.6753112711}, - {19041866.0067297369, 9707182.17532352544}, - {18816810.1301847994, 8647669.64980295487}, - {19252610.7845367305, 8778164.08580140397}, - }; - - XY s_fwd_expect[] = { - {18641249.2791703865, 9563342.53233416565}, - {19130982.4615812786, 9739539.59350463562}, - {18903483.5150115378, 8675064.50061797537}, - {19343388.3998006098, 8807471.90406848863}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {127.759503987730625, 0.00173515039622462014}, - {127.761295471077958, 0.00187196632421706517}, - {127.759775773557251, -0.00187196632421891525}, - {127.76156725690457, -0.00173515039622462014}, - }; - - LP s_inv_expect[] = { - {127.75950514818588, 0.00171623111593511971}, - {127.761290323778738, 0.00185412132880796244}, - {127.759780920856471, -0.00185412132880796244}, - {127.761566096449329, -0.00171623111593511971}, - }; - - 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_misrsom_selftest (void) {return 10000;} diff --git a/src/PJ_mod_ster.c b/src/PJ_mod_ster.c index 767863c1..ca81a43f 100644 --- a/src/PJ_mod_ster.c +++ b/src/PJ_mod_ster.c @@ -278,255 +278,8 @@ PJ *PROJECTION(gs50) { } -#ifndef PJ_SELFTEST -int pj_mil_os_selftest (void) {return 0;} -#else - -int pj_mil_os_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=mil_os +R=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - {-1908527.94959420455, -1726237.4730614475}, - {-1916673.02291848511, -1943133.88812552323}, - {-2344429.41208962305, -1706258.05121891224}, - {-2354637.83553299867, -1926468.60513541684}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - {20.0020363939492398, 18.0009683469140498}, - {20.0020363715837419, 17.999031631815086}, - {19.9979636060507602, 18.0009683469140498}, - {19.9979636284162581, 17.999031631815086}, - }; - - 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_lee_os_selftest (void) {return 0;} -#else - -int pj_lee_os_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=lee_os +R=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - {-25564478.9526050538, 154490848.8286255}, - { 30115393.9385746419, 125193997.439701974}, - {-31039340.5921660066, 57678685.0448915437}, - {-3088419.93942357088, 58150091.0991110131}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - {-164.997479457813824, -9.99875886103541411}, - {-164.997479438558884, -10.0012411200022751}, - {-165.002520542186289, -9.99875886103545142}, - {-165.002520561440946, -10.0012411200022999}, - }; - - 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_gs48_selftest (void) {return 0;} -#else - -int pj_gs48_selftest (void) { - double tolerance_lp = 1e-12; - double tolerance_xy = 1e-8; - - char s_args[] = {"+proj=gs48 +R=6370997"}; - - /* All latitudes and longitudes within the continental US */ - LP fwd_in[] = { - { -119.0, 40.0}, - { -70.0, 64.0}, - { -80.0, 25.0}, - { -95.0, 35.0} - }; - - XY s_fwd_expect[] = { - { -1923908.446529345820, 355874.658944479190}, - { 1354020.375109298155, 3040846.007866524626}, - { 1625139.160484319553, -1413614.894029108109}, - { 90241.658071457961, -439595.048485902138}, - }; - - XY inv_in[] = { - { -1923000.0, 355000.0}, - { 1354000.0, 3040000.0}, - { 1625000.0, -1413000.0}, - { 90000.0, -439000.0}, - }; - - LP s_inv_expect[] = { - {-118.987112613284, 39.994449789388}, - { -70.005208999424, 63.993387835525}, - { -80.000346610440, 25.005602546594}, - { -95.002606473071, 35.005424705030}, - }; - - 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_alsk_selftest (void) {return 0;} -#else - -int pj_alsk_selftest (void) { - - /* The standard test points are way outside the definition area bounds, hence we relax tolerances */ - double tolerance_lp = 1e-12; - double tolerance_xy = 1e-8; - - char e_args[] = {"+proj=alsk +ellps=clrk66"}; - char s_args[] = {"+proj=alsk +R=6370997"}; - - LP fwd_in[] = { - {-160.0, 55.0}, - {-160.0, 70.0}, - {-145.0, 70.0}, - {-145.0, 60.0} - }; - - XY e_fwd_expect[] = { - {-513253.146950842060, -968928.031867943470}, - {-305001.133897637190, 687494.464958650530}, - {266454.305088600490, 683423.477493030950}, - {389141.322439243960, -423913.251230396680}, - }; - - XY s_fwd_expect[] = { - {-511510.319410844070, -967150.991676078060}, - {-303744.771290368980, 685439.745941123230}, - {265354.974019662940, 681386.892874573010}, - {387711.995394026630, -422980.685505462640}, - }; - - XY inv_in[] = { - {-500000.0, -950000.0}, - {-305000.0, 700000.0}, - { 250000.0, 700000.0}, - { 400000.0, -400000.0} - }; - - LP e_inv_expect[] = { - {-159.830804302926, 55.183195262220}, - {-160.042203155537, 70.111086864056}, - {-145.381043551466, 70.163900908411}, - {-144.758985461448, 60.202929200739}, - }; - - LP s_inv_expect[] = { - {-159.854014457557, 55.165653849074}, - {-160.082332371601, 70.128307617632}, - {-145.347827407243, 70.181566919011}, - {-144.734239827146, 60.193564732505}, - }; - - 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_gs50_selftest (void) {return 0;} -#else - -int pj_gs50_selftest (void) { - double tolerance_lp = 1e-12; - double tolerance_xy = 1e-8; - - char e_args[] = {"+proj=gs50 +ellps=clrk66"}; - char s_args[] = {"+proj=gs50 +R=6370997"}; - - LP fwd_in[] = { - {-160.0, 65.0}, - {-130.0, 45.0}, - { -65.0, 45.0}, - { -80.0, 36.0}, - }; - - XY e_fwd_expect[] = { - {-1874628.5377402329, 2660907.942291015300}, - { -771831.51885333552, 48465.166491304852}, - { 4030931.8339815089, 1323687.864777399200}, - { 3450764.2615361013, -175619.041820732440}, - }; - - XY s_fwd_expect[] = { - {-1867268.2534600089, 2656506.230401823300}, - { -769572.18967299373, 48324.312440863941}, - { 4019393.068680791200, 1320191.309350289200}, - { 3442685.615172345700, -178760.423489428680}, - }; - - XY inv_in[] = { - {-1800000.0, 2600000.0}, - { -800000.0, 500000.0}, - { 4000000.0, 1300000.0}, - { 3900000.0, -170000.0}, - }; - - LP e_inv_expect[] = { - {-157.989284999679, 64.851559609698}, - {-131.171390466814, 49.084969745967}, - { -65.491568685301, 44.992837923774}, - { -75.550660091101, 34.191114075743}, - }; - - LP s_inv_expect[] = { - {-158.163295044933, 64.854288364994}, - {-131.206816959506, 49.082915350974}, - { -65.348945220767, 44.957292681774}, - { -75.446820242089, 34.185406225616}, - }; - - 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_mil_os_selftest (void) {return 10000;} +int pj_lee_os_selftest (void) {return 10000;} +int pj_gs48_selftest (void) {return 10000;} +int pj_alsk_selftest (void) {return 10000;} +int pj_gs50_selftest (void) {return 10000;} diff --git a/src/PJ_moll.c b/src/PJ_moll.c index 8470bb3e..80dd70d0 100644 --- a/src/PJ_moll.c +++ b/src/PJ_moll.c @@ -106,138 +106,6 @@ PJ *PROJECTION(wag5) { return P; } - -#ifndef PJ_SELFTEST -int pj_moll_selftest (void) {return 0;} -#else - -int pj_moll_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=moll +a=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - {201113.698641813244, 124066.283433859542}, - {201113.698641813244, -124066.283433859542}, - {-201113.698641813244, 124066.283433859542}, - {-201113.698641813244, -124066.283433859542}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - {0.00198873782220854774, 0.000806005080362811612}, - {0.00198873782220854774, -0.000806005080362811612}, - {-0.00198873782220854774, 0.000806005080362811612}, - {-0.00198873782220854774, -0.000806005080362811612}, - }; - - 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_wag4_selftest (void) {return 0;} -#else - -int pj_wag4_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=wag4 +a=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 192801.218662384286, 129416.216394802992}, - { 192801.218662384286, -129416.216394802992}, - {-192801.218662384286, 129416.216394802992}, - {-192801.218662384286, -129416.216394802992}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - { 0.00207450259783523421, 0.000772682950537716476}, - { 0.00207450259783523421, -0.000772682950537716476}, - {-0.00207450259783523421, 0.000772682950537716476}, - {-0.00207450259783523421, -0.000772682950537716476}, - }; - - 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_wag5_selftest (void) {return 0;} -#else - -int pj_wag5_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=wag5 +a=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - - XY s_fwd_expect[] = { - { 203227.05192532466, 138651.631442713202}, - { 203227.05192532466, -138651.631442713202}, - {-203227.05192532466, 138651.631442713202}, - {-203227.05192532466, -138651.631442713202}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - - - - LP s_inv_expect[] = { - { 0.00196807227086416396, 0.00072121615041701424}, - { 0.00196807227086416396, -0.00072121615041701424}, - {-0.00196807227086416396, 0.00072121615041701424}, - {-0.00196807227086416396, -0.00072121615041701424}, - }; - - 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_moll_selftest (void) {return 10000;} +int pj_wag4_selftest (void) {return 10000;} +int pj_wag5_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_robin.c b/src/PJ_robin.c index d3f92cd9..a9bac6ec 100644 --- a/src/PJ_robin.c +++ b/src/PJ_robin.c @@ -154,46 +154,4 @@ PJ *PROJECTION(robin) { } -#ifndef PJ_SELFTEST -int pj_robin_selftest (void) {return 0;} -#else - -int pj_robin_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=robin +a=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 189588.423282507836, 107318.530350702888}, - { 189588.423282507836, -107318.530350702888}, - {-189588.423282507836, 107318.530350702888}, - {-189588.423282507836, -107318.530350702888}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - { 0.002109689065506131, 0.000931805533547745983}, - { 0.002109689065506131, -0.000931805533547745983}, - {-0.002109689065506131, 0.000931805533547745983}, - {-0.002109689065506131, -0.000931805533547745983}, - }; - - 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_robin_selftest (void) {return 10000;} diff --git a/src/PJ_rpoly.c b/src/PJ_rpoly.c index 8f7b16c6..36e5a63e 100644 --- a/src/PJ_rpoly.c +++ b/src/PJ_rpoly.c @@ -1,6 +1,6 @@ #define PJ_LIB__ #include <errno.h> -#include <projects.h> +#include "projects.h" struct pj_opaque { double phi1; @@ -53,32 +53,4 @@ PJ *PROJECTION(rpoly) { } -#ifndef PJ_SELFTEST -int pj_rpoly_selftest (void) {return 0;} -#else - -int pj_rpoly_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=rpoly +a=6400000 +lat_1=0.5 +lat_2=2"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 223368.09830201423, 111769.110486991223}, - { 223368.09830201423, -111769.110486991223}, - {-223368.09830201423, 111769.110486991223}, - {-223368.09830201423, -111769.110486991223}, - }; - - 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_rpoly_selftest (void) {return 10000;} diff --git a/src/PJ_sch.c b/src/PJ_sch.c index cd4aa95e..4ea3404d 100644 --- a/src/PJ_sch.c +++ b/src/PJ_sch.c @@ -229,4 +229,4 @@ PJ *PROJECTION(sch) { /* Skipping sef-test since the test system is not capable of handling * 3D coordinate systems for the time being. Relying on tests in ../nad/ */ -int pj_sch_selftest (void) {return 0;} +int pj_sch_selftest (void) {return 10000;} diff --git a/src/PJ_sconics.c b/src/PJ_sconics.c index b434c430..1e00a17e 100644 --- a/src/PJ_sconics.c +++ b/src/PJ_sconics.c @@ -215,473 +215,10 @@ PJ *PROJECTION(vitk1) { } -#ifndef PJ_SELFTEST -int pj_euler_selftest (void) {return 0;} -#else - -int pj_euler_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=euler +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=euler +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {222597.63465910763, 111404.24054991946}, - {222767.16563187627, -111234.6764910177}, - {-222597.63465910763, 111404.24054991946}, - {-222767.16563187627, -111234.6764910177}, - }; - - XY s_fwd_expect[] = { - {223360.65559869423, 111786.11238979101}, - {223530.76769031584, -111615.96709862351}, - {-223360.65559869423, 111786.11238979101}, - {-223530.76769031584, -111615.96709862351}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0017962807023075235, 0.0008983146697688839}, - {0.0017962794738334226, -0.00089831589842987965}, - {-0.0017962807023075235, 0.0008983146697688839}, - {-0.0017962794738334226, -0.00089831589842987965}, - }; - - LP s_inv_expect[] = { - {0.0017901444369360026, 0.00089524594522202015}, - {0.001790143216840731, -0.00089524716533368484}, - {-0.0017901444369360026, 0.00089524594522202015}, - {-0.001790143216840731, -0.00089524716533368484}, - }; - - 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_murd1_selftest (void) {return 0;} -#else - -int pj_murd1_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=murd1 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=murd1 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {222600.81347355421, 111404.24418054636}, - {222770.3492878644, -111234.6728566746}, - {-222600.81347355421, 111404.24418054636}, - {-222770.3492878644, -111234.6728566746}, - }; - - XY s_fwd_expect[] = { - {223363.84530949194, 111786.11603286299}, - {223533.96225925098, -111615.96345182261}, - {-223363.84530949194, 111786.11603286299}, - {-223533.96225925098, -111615.96345182261}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0017962550410516366, 0.0008983146697688839}, - {0.0017962538125775522, -0.00089831589842987965}, - {-0.0017962550410516366, 0.0008983146697688839}, - {-0.0017962538125775522, -0.00089831589842987965}, - }; - - LP s_inv_expect[] = { - {0.0017901188633413715, 0.00089524594522202015}, - {0.0017901176432461162, -0.00089524716492657387}, - {-0.0017901188633413715, 0.00089524594522202015}, - {-0.0017901176432461162, -0.00089524716492657387}, - }; - - 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_murd2_selftest (void) {return 0;} -#else - -int pj_murd2_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=murd2 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=murd2 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {222588.09975123021, 111426.14002741246}, - {222757.72626701824, -111341.43131750476}, - {-222588.09975123021, 111426.14002741246}, - {-222757.72626701824, -111341.43131750476}, - }; - - XY s_fwd_expect[] = { - {223351.08800702673, 111808.08693438848}, - {223521.2959691704, -111723.08785967289}, - {-223351.08800702673, 111808.08693438848}, - {-223521.2959691704, -111723.08785967289}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0017963574947305447, 0.00089788747830845382}, - {0.0017963562661689487, -0.00089788809264252983}, - {-0.0017963574947305447, 0.00089788747830845382}, - {-0.0017963562661689487, -0.00089788809264252983}, - }; - - LP s_inv_expect[] = { - {0.0017902209670287586, 0.00089482021163422854}, - {0.0017902197468465887, -0.00089482082161134206}, - {-0.0017902209670287586, 0.00089482021163422854}, - {-0.0017902197468465887, -0.00089482082161134206}, - }; - - 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_murd3_selftest (void) {return 0;} -#else - -int pj_murd3_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=murd3 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=murd3 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {222600.81407757697, 111404.24660137216}, - {222770.35473389886, -111234.67043217793}, - {-222600.81407757697, 111404.24660137216}, - {-222770.35473389886, -111234.67043217793}, - }; - - XY s_fwd_expect[] = { - {223363.84591558515, 111786.11846198692}, - {223533.96772395336, -111615.96101901523}, - {-223363.84591558515, 111786.11846198692}, - {-223533.96772395336, -111615.96101901523}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0017962550166583809, 0.0008983146697688839}, - {0.0017962537881492445, -0.00089831589842987965}, - {-0.0017962550166583809, 0.0008983146697688839}, - {-0.0017962537881492445, -0.00089831589842987965}, - }; - - LP s_inv_expect[] = { - {0.0017901188390313859, 0.00089524594522202015}, - {0.0017901176189013177, -0.00089524716533368484}, - {-0.0017901188390313859, 0.00089524594522202015}, - {-0.0017901176189013177, -0.00089524716533368484}, - }; - - 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_pconic_selftest (void) {return 0;} -#else - -int pj_pconic_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=pconic +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=pconic +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {222588.09884161691, 111416.60477006658}, - {222757.71809109033, -111331.88153107995}, - {-222588.09884161691, 111416.60477006658}, - {-222757.71809109033, -111331.88153107995}, - }; - - XY s_fwd_expect[] = { - {223351.08709429545, 111798.5189920546}, - {223521.28776521701, -111713.50533845725}, - {-223351.08709429545, 111798.5189920546}, - {-223521.28776521701, -111713.50533845725}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0017963575313784969, 0.0008979644089172499}, - {0.0017963563027642206, -0.00089796502355327969}, - {-0.0017963575313784969, 0.0008979644089172499}, - {-0.0017963563027642206, -0.00089796502355327969}, - }; - - LP s_inv_expect[] = { - {0.0017902210035514285, 0.0008948968793741558}, - {0.0017902197833169374, -0.00089489748965381963}, - {-0.0017902210035514285, 0.0008948968793741558}, - {-0.0017902197833169374, -0.00089489748965381963}, - }; - - 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_tissot_selftest (void) {return 0;} -#else - -int pj_tissot_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=tissot +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=tissot +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {222641.07869963095, 54347.828487281469}, - {222810.61451394114, -168291.08854993948}, - {-222641.07869963095, 54347.828487281469}, - {-222810.61451394114, -168291.08854993948}, - }; - - XY s_fwd_expect[] = { - {223404.24855684943, 54534.122161157939}, - {223574.36550660848, -168867.95732352766}, - {-223404.24855684943, 54534.122161157939}, - {-223574.36550660848, -168867.95732352766}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0017962807107425871, 0.51344495513064536}, - {0.0017962794822333915, 0.51164832456244658}, - {-0.0017962807107425871, 0.51344495513064536}, - {-0.0017962794822333915, 0.51164832456244658}, - }; - - LP s_inv_expect[] = { - {0.0017901444453421915, 0.51344188640609856}, - {0.001790143225212064, 0.51165139329554277}, - {-0.0017901444453421915, 0.51344188640609856}, - {-0.001790143225212064, 0.51165139329554277}, - }; - - 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_vitk1_selftest (void) {return 0;} -#else - -int pj_vitk1_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=vitk1 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=vitk1 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {222607.17121145778, 111404.25144243463}, - {222776.71670959776, -111234.66558744459}, - {-222607.17121145778, 111404.25144243463}, - {-222776.71670959776, -111234.66558744459}, - }; - - XY s_fwd_expect[] = { - {223370.22484047143, 111786.12331964359}, - {223540.3515072545, -111615.9561576751}, - {-223370.22484047143, 111786.12331964359}, - {-223540.3515072545, -111615.9561576751}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0017962037198570686, 0.0008983146697688839}, - {0.0017962024913830157, -0.00089831589842987965}, - {-0.0017962037198570686, 0.0008983146697688839}, - {-0.0017962024913830157, -0.00089831589842987965}, - }; - - LP s_inv_expect[] = { - {0.0017900677174648159, 0.00089524594522202015}, - {0.0017900664973695916, -0.00089524716533368484}, - {-0.0017900677174648159, 0.00089524594522202015}, - {-0.0017900664973695916, -0.00089524716533368484}, - }; - - 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_euler_selftest (void) {return 10000;} +int pj_murd1_selftest (void) {return 10000;} +int pj_murd2_selftest (void) {return 10000;} +int pj_murd3_selftest (void) {return 10000;} +int pj_pconic_selftest (void) {return 10000;} +int pj_tissot_selftest (void) {return 10000;} +int pj_vitk1_selftest (void) {return 10000;} diff --git a/src/PJ_somerc.c b/src/PJ_somerc.c index 7324d48a..69fb6d47 100644 --- a/src/PJ_somerc.c +++ b/src/PJ_somerc.c @@ -89,61 +89,4 @@ PJ *PROJECTION(somerc) { } -#ifndef PJ_SELFTEST -int pj_somerc_selftest (void) {return 0;} -#else - -int pj_somerc_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=somerc +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=somerc +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {222638.98158654713, 110579.96521824898}, - {222638.98158654713, -110579.96521825089}, - {-222638.98158654713, 110579.96521824898}, - {-222638.98158654713, -110579.96521825089}, - }; - - XY s_fwd_expect[] = { - {223402.14425527418, 111706.74357494408}, - {223402.14425527418, -111706.74357494518}, - {-223402.14425527418, 111706.74357494408}, - {-223402.14425527418, -111706.74357494518}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0017966305682390426, 0.00090436947704129484}, - {0.0017966305682390426, -0.00090436947704377105}, - {-0.0017966305682390426, 0.00090436947704129484}, - {-0.0017966305682390426, -0.00090436947704377105}, - }; - - LP s_inv_expect[] = { - {0.0017904931097838226, 0.00089524655485801927}, - {0.0017904931097838226, -0.00089524655484529714}, - {-0.0017904931097838226, 0.00089524655485801927}, - {-0.0017904931097838226, -0.00089524655484529714}, - }; - - 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_somerc_selftest (void) {return 10000;} diff --git a/src/PJ_stere.c b/src/PJ_stere.c index 500b512d..82d83061 100644 --- a/src/PJ_stere.c +++ b/src/PJ_stere.c @@ -314,109 +314,5 @@ PJ *PROJECTION(ups) { } -#ifndef PJ_SELFTEST -int pj_stere_selftest (void) {return 0;} -#else - -int pj_stere_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=stere +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=stere +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - { 222644.8545501172, 110610.8834741739}, - { 222644.8545501172, -110610.8834741739}, - {-222644.8545501172, 110610.8834741739}, - {-222644.8545501172, -110610.8834741739}, - }; - - XY s_fwd_expect[] = { - { 223407.81025950745, 111737.938996443}, - { 223407.81025950745, -111737.938996443}, - {-223407.81025950745, 111737.938996443}, - {-223407.81025950745, -111737.938996443}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - { 0.0017966305682022392, 0.00090436947502443507}, - { 0.0017966305682022392, -0.00090436947502443507}, - {-0.0017966305682022392, 0.00090436947502443507}, - {-0.0017966305682022392, -0.00090436947502443507}, - }; - - LP s_inv_expect[] = { - { 0.001790493109747395, 0.00089524655465513144}, - { 0.001790493109747395, -0.00089524655465513144}, - {-0.001790493109747395, 0.00089524655465513144}, - {-0.001790493109747395, -0.00089524655465513144}, - }; - - 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_ups_selftest (void) {return 0;} -#else - -int pj_ups_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=ups +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {2433455.5634384668, -10412543.301512826}, - {2448749.1185681992, -10850493.419804076}, - {1566544.4365615332, -10412543.301512826}, - {1551250.8814318008, -10850493.419804076}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {-44.998567498074834, 64.9182362867341}, - {-44.995702709112308, 64.917020250675748}, - {-45.004297076028529, 64.915804280954518}, - {-45.001432287066002, 64.914588377560719}, - }; - - 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_stere_selftest (void) {return 10000;} +int pj_ups_selftest (void) {return 10000;} diff --git a/src/PJ_sterea.c b/src/PJ_sterea.c index e0ff15e7..8a73f453 100644 --- a/src/PJ_sterea.c +++ b/src/PJ_sterea.c @@ -115,61 +115,4 @@ PJ *PROJECTION(sterea) { } -#ifndef PJ_SELFTEST -int pj_sterea_selftest (void) {return 0;} -#else - -int pj_sterea_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=sterea +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=sterea +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - { 222644.89410919772, 110611.09187173686}, - { 222644.89410919772, -110611.09187173827}, - {-222644.89410919772, 110611.09187173686}, - {-222644.89410919772, -110611.09187173827}, - }; - - XY s_fwd_expect[] = { - { 223407.81025950745, 111737.93899644315}, - { 223407.81025950745, -111737.93899644315}, - {-223407.81025950745, 111737.93899644315}, - {-223407.81025950745, -111737.93899644315}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - { 0.0017966305682019911, 0.00090436947683099009}, - { 0.0017966305682019911, -0.00090436947684371233}, - {-0.0017966305682019911, 0.00090436947683099009}, - {-0.0017966305682019911, -0.00090436947684371233}, - }; - - LP s_inv_expect[] = { - { 0.001790493109747395, 0.00089524655465446378}, - { 0.001790493109747395, -0.00089524655465446378}, - {-0.001790493109747395, 0.00089524655465446378}, - {-0.001790493109747395, -0.00089524655465446378}, - }; - - 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_sterea_selftest (void) {return 10000;} diff --git a/src/PJ_sts.c b/src/PJ_sts.c index 3e6168bd..0349e67b 100644 --- a/src/PJ_sts.c +++ b/src/PJ_sts.c @@ -64,8 +64,6 @@ static PJ *setup(PJ *P, double p, double q, int mode) { - - PJ *PROJECTION(fouc) { struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque)); if (0==Q) @@ -75,66 +73,6 @@ PJ *PROJECTION(fouc) { } -#ifndef PJ_SELFTEST -int pj_fouc_selftest (void) {return 0;} -#else -int pj_fouc_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=fouc +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=fouc +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {222588.12067589167, 111322.31670069379}, - {222588.12067589167, -111322.31670069379}, - {-222588.12067589167, 111322.31670069379}, - {-222588.12067589167, -111322.31670069379}, - }; - - XY s_fwd_expect[] = { - {223351.10900341379, 111703.9077217125}, - {223351.10900341379, -111703.9077217125}, - {-223351.10900341379, 111703.9077217125}, - {-223351.10900341379, -111703.9077217125}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0017966305685702751, 0.00089831528410111959}, - {0.0017966305685702751, -0.00089831528410111959}, - {-0.0017966305685702751, 0.00089831528410111959}, - {-0.0017966305685702751, -0.00089831528410111959}, - }; - - LP s_inv_expect[] = { - {0.0017904931101116717, 0.00089524655487369749}, - {0.0017904931101116717, -0.00089524655487369749}, - {-0.0017904931101116717, 0.00089524655487369749}, - {-0.0017904931101116717, -0.00089524655487369749}, - }; - - 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 - - - - - PJ *PROJECTION(kav5) { struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque)); @@ -146,65 +84,6 @@ PJ *PROJECTION(kav5) { } -#ifndef PJ_SELFTEST -int pj_kav5_selftest (void) {return 0;} -#else -int pj_kav5_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=kav5 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=kav5 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {200360.90530882866, 123685.08247699818}, - {200360.90530882866, -123685.08247699818}, - {-200360.90530882866, 123685.08247699818}, - {-200360.90530882866, -123685.08247699818}, - }; - - XY s_fwd_expect[] = { - {201047.7031108776, 124109.05062917093}, - {201047.7031108776, -124109.05062917093}, - {-201047.7031108776, 124109.05062917093}, - {-201047.7031108776, -124109.05062917093}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0019962591348533314, 0.00080848256185253912}, - {0.0019962591348533314, -0.00080848256185253912}, - {-0.0019962591348533314, 0.00080848256185253912}, - {-0.0019962591348533314, -0.00080848256185253912}, - }; - - LP s_inv_expect[] = { - {0.0019894397264987643, 0.00080572070962591153}, - {0.0019894397264987643, -0.00080572070962591153}, - {-0.0019894397264987643, 0.00080572070962591153}, - {-0.0019894397264987643, -0.00080572070962591153}, - }; - - 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 - - - - PJ *PROJECTION(qua_aut) { struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque)); @@ -214,64 +93,6 @@ PJ *PROJECTION(qua_aut) { return setup(P, 2., 2., 0); } -#ifndef PJ_SELFTEST -int pj_qua_aut_selftest (void) {return 0;} -#else -int pj_qua_aut_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=qua_aut +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=qua_aut +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {222613.54903309655, 111318.07788798446}, - {222613.54903309655, -111318.07788798446}, - {-222613.54903309655, 111318.07788798446}, - {-222613.54903309655, -111318.07788798446}, - }; - - XY s_fwd_expect[] = { - {223376.62452402918, 111699.65437918637}, - {223376.62452402918, -111699.65437918637}, - {-223376.62452402918, 111699.65437918637}, - {-223376.62452402918, -111699.65437918637}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0017966305684046586, 0.00089831528412872229}, - {0.0017966305684046586, -0.00089831528412872229}, - {-0.0017966305684046586, 0.00089831528412872229}, - {-0.0017966305684046586, -0.00089831528412872229}, - }; - - LP s_inv_expect[] = { - {0.0017904931099477471, 0.00089524655490101819}, - {0.0017904931099477471, -0.00089524655490101819}, - {-0.0017904931099477471, 0.00089524655490101819}, - {-0.0017904931099477471, -0.00089524655490101819}, - }; - - 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 - - - PJ *PROJECTION(mbt_s) { @@ -282,58 +103,9 @@ PJ *PROJECTION(mbt_s) { return setup(P, 1.48875, 1.36509, 0); } -#ifndef PJ_SELFTEST -int pj_mbt_s_selftest (void) {return 0;} -#else -int pj_mbt_s_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=mbt_s +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=mbt_s +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - XY e_fwd_expect[] = { - {204131.51785027285, 121400.33022550763}, - {204131.51785027285, -121400.33022550763}, - {-204131.51785027285, 121400.33022550763}, - {-204131.51785027285, -121400.33022550763}, - }; - - XY s_fwd_expect[] = { - {204831.24057099217, 121816.46669603503}, - {204831.24057099217, -121816.46669603503}, - {-204831.24057099217, 121816.46669603503}, - {-204831.24057099217, -121816.46669603503}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {0.0019593827209883237, 0.00082369854658027549}, - {0.0019593827209883237, -0.00082369854658027549}, - {-0.0019593827209883237, 0.00082369854658027549}, - {-0.0019593827209883237, -0.00082369854658027549}, - }; - - LP s_inv_expect[] = { - {0.0019526892859206603, 0.00082088471512331508}, - {0.0019526892859206603, -0.00082088471512331508}, - {-0.0019526892859206603, 0.00082088471512331508}, - {-0.0019526892859206603, -0.00082088471512331508}, - }; - - 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_fouc_selftest (void) {return 10000;} +int pj_kav5_selftest (void) {return 10000;} +int pj_qua_aut_selftest (void) {return 10000;} +int pj_mbt_s_selftest (void) {return 10000;} diff --git a/src/PJ_tcc.c b/src/PJ_tcc.c index 26cf67b6..37211fdd 100644 --- a/src/PJ_tcc.c +++ b/src/PJ_tcc.c @@ -31,29 +31,4 @@ PJ *PROJECTION(tcc) { } -#ifndef PJ_SELFTEST -int pj_tcc_selftest (void) {return 0;} -#else -int pj_tcc_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=tcc +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - {223458.84419245756, 111769.14504058579}, - {223458.84419245756, -111769.14504058579}, - {-223458.84419245756, 111769.14504058579}, - {-223458.84419245756, -111769.14504058579}, - }; - - 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_tcc_selftest (void) {return 10000;} diff --git a/src/PJ_tcea.c b/src/PJ_tcea.c index 65b3c604..76249827 100644 --- a/src/PJ_tcea.c +++ b/src/PJ_tcea.c @@ -1,5 +1,5 @@ #define PJ_LIB__ -#include <projects.h> +#include "projects.h" PROJ_HEAD(tcea, "Transverse Cylindrical Equal Area") "\n\tCyl, Sph"; @@ -33,43 +33,4 @@ PJ *PROJECTION(tcea) { } -#ifndef PJ_SELFTEST -int pj_tcea_selftest (void) {return 0;} -#else -int pj_tcea_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=tcea +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 223322.76057672748, 111769.14504058579}, - { 223322.76057672748, -111769.14504058579}, - {-223322.76057672748, 111769.14504058579}, - {-223322.76057672748, -111769.14504058579}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - { 0.0017904931102938101, 0.00089524655445477922}, - { 0.0017904931102938101, -0.00089524655445477922}, - {-0.0017904931102938101, 0.00089524655445477922}, - {-0.0017904931102938101, -0.00089524655445477922}, - }; - - 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_tcea_selftest (void) {return 10000;} diff --git a/src/PJ_times.c b/src/PJ_times.c index a8d6e67a..696c9fd5 100644 --- a/src/PJ_times.c +++ b/src/PJ_times.c @@ -76,46 +76,4 @@ PJ *PROJECTION(times) { } -#ifndef PJ_SELFTEST -int pj_times_selftest (void) {return 0;} -#else - -int pj_times_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - int result; - int n = 5; - - char s_args[] = {"+proj=times +ellps=sphere"}; - - XY *inv_in = malloc(n*sizeof(XY)); - LP *s_inv_expect = malloc(n*sizeof(LP)); - - LP fwd_in[] = { - { 0, 0}, - { 80, 70}, - { 25, -10}, - {-35, 20}, - {-45, -30} - }; - - XY s_fwd_expect[] = { - { 0.0, 0.0}, - { 5785183.5760670956, 7615452.0661204215}, - { 2065971.5301078814, -951526.0648494592}, - {-2873054.0454850947, 1917730.9530005211}, - {-3651383.2035214868, -2914213.4578159209}, - }; - - memcpy(inv_in, &s_fwd_expect, n*sizeof(XY)); - memcpy(s_inv_expect, &fwd_in, n*sizeof(LP)); - - result = pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, n, n, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect); - free(inv_in); - free(s_inv_expect); - - return result; -} - - -#endif +int pj_times_selftest (void) {return 10000;} diff --git a/src/PJ_tmerc.c b/src/PJ_tmerc.c index b3ec0030..2aa189fd 100644 --- a/src/PJ_tmerc.c +++ b/src/PJ_tmerc.c @@ -205,58 +205,4 @@ PJ *PROJECTION(tmerc) { } -#ifndef PJ_SELFTEST -int pj_tmerc_selftest (void) {return 0;} -#else -int pj_tmerc_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=tmerc +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=tmerc +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - { 222650.79679577847, 110642.22941192707}, - { 222650.79679577847, -110642.22941192707}, - {-222650.79679577847, 110642.22941192707}, - {-222650.79679577847, -110642.22941192707}, - }; - - XY s_fwd_expect[] = { - { 223413.46640632232, 111769.14504059685}, - { 223413.46640632232, -111769.14504059685}, - {-223413.46640632208, 111769.14504059685}, - {-223413.46640632208, -111769.14504059685}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - { 0.0017966305681649396, 0.00090436947663183841}, - { 0.0017966305681649396, -0.00090436947663183841}, - {-0.0017966305681649396, 0.00090436947663183841}, - {-0.0017966305681649396, -0.00090436947663183841}, - }; - - LP s_inv_expect[] = { - { 0.0017904931097048034, 0.00089524670602767842}, - { 0.0017904931097048034, -0.00089524670602767842}, - {-0.001790493109714345, 0.00089524670602767842}, - {-0.001790493109714345, -0.00089524670602767842}, - }; - - 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_tmerc_selftest (void) {return 10000;} diff --git a/src/PJ_tpeqd.c b/src/PJ_tpeqd.c index 6bea3968..dd19da8c 100644 --- a/src/PJ_tpeqd.c +++ b/src/PJ_tpeqd.c @@ -105,61 +105,4 @@ PJ *PROJECTION(tpeqd) { } -#ifndef PJ_SELFTEST int pj_tpeqd_selftest (void) {return 0;} -#else - -int pj_tpeqd_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char e_args[] = {"+proj=tpeqd +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5"}; - char s_args[] = {"+proj=tpeqd +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY e_fwd_expect[] = { - {-27750.758831679042, -222599.40369177726}, - {-250434.93702403645, -222655.93819326628}, - {-27750.758831679042, 222599.40369177726}, - {-250434.93702403645, 222655.93819326628}, - }; - - XY s_fwd_expect[] = { - {-27845.882978485075, -223362.43069526015}, - {-251293.37876465076, -223419.15898590829}, - {-27845.882978485075, 223362.43069526015}, - {-251293.37876465076, 223419.15898590829}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP e_inv_expect[] = { - {-0.00089855554821257374, 1.2517966304145272}, - {0.0008985555481998515, 1.2517966304145272}, - {-0.00089855431859741167, 1.2482033692781642}, - {0.00089855431859741167, 1.2482033692781642}, - }; - - LP s_inv_expect[] = { - {-0.00089548606640108474, 1.2517904929571837}, - {0.0008954860663883625, 1.2517904929571837}, - {-0.000895484845182587, 1.248209506737604}, - {0.00089548484516986475, 1.248209506737604}, - }; - - 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 diff --git a/src/PJ_urm5.c b/src/PJ_urm5.c index bd073459..e90cc9ee 100644 --- a/src/PJ_urm5.c +++ b/src/PJ_urm5.c @@ -29,7 +29,7 @@ PJ *PROJECTION(urm5) { if (0==Q) return pj_default_destructor(P, ENOMEM); P->opaque = Q; - + if (pj_param(P->ctx, P->params, "tn").i) { Q->n = pj_param(P->ctx, P->params, "dn").f; if (Q->n <= 0. || Q->n > 1.) @@ -51,29 +51,4 @@ PJ *PROJECTION(urm5) { } -#ifndef PJ_SELFTEST -int pj_urm5_selftest (void) {return 0;} -#else -int pj_urm5_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=urm5 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 223393.6384339639, 111696.81878511712}, - { 223393.6384339639, -111696.81878511712}, - {-223393.6384339639, 111696.81878511712}, - {-223393.6384339639, -111696.81878511712}, - }; - - 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_urm5_selftest (void) {return 10000;} diff --git a/src/PJ_urmfps.c b/src/PJ_urmfps.c index 64eb5c80..04ee8296 100644 --- a/src/PJ_urmfps.c +++ b/src/PJ_urmfps.c @@ -71,86 +71,5 @@ PJ *PROJECTION(wag1) { } -#ifndef PJ_SELFTEST -int pj_urmfps_selftest (void) {return 0;} -#else -int pj_urmfps_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=urmfps +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 196001.70813419219, 127306.84332999329}, - { 196001.70813419219, -127306.84332999329}, - {-196001.70813419219, 127306.84332999329}, - {-196001.70813419219, -127306.84332999329}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - { 0.002040720839642371, 0.00078547381740438178}, - { 0.002040720839642371, -0.00078547381740438178}, - {-0.002040720839642371, 0.00078547381740438178}, - {-0.002040720839642371, -0.00078547381740438178}, - }; - - 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_wag1_selftest (void) {return 0;} -#else -int pj_wag1_selftest (void) { - double tolerance_lp = 1e-10; - double tolerance_xy = 1e-7; - - char s_args[] = {"+proj=wag1 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; - - LP fwd_in[] = { - { 2, 1}, - { 2,-1}, - {-2, 1}, - {-2,-1} - }; - - XY s_fwd_expect[] = { - { 195986.78156115755, 127310.07506065986}, - { 195986.78156115755, -127310.07506065986}, - {-195986.78156115755, 127310.07506065986}, - {-195986.78156115755, -127310.07506065986}, - }; - - XY inv_in[] = { - { 200, 100}, - { 200,-100}, - {-200, 100}, - {-200,-100} - }; - - LP s_inv_expect[] = { - { 0.002040720839738254, 0.00078547381739207999}, - { 0.002040720839738254, -0.00078547381739207999}, - {-0.002040720839738254, 0.00078547381739207999}, - {-0.002040720839738254, -0.00078547381739207999}, - }; - - 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_urmfps_selftest (void) {return 10000;} +int pj_wag1_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 diff --git a/test/fuzzers/README.TXT b/test/fuzzers/README.TXT index 483c33be..a5f8f3ea 100644 --- a/test/fuzzers/README.TXT +++ b/test/fuzzers/README.TXT @@ -10,7 +10,7 @@ https://bugs.chromium.org/p/oss-fuzz/issues/list?q=proj4 - Build standard_fuzzer in a standalone mode: - $ g++ -g -std=c++11 standard_fuzzer.cpp -o standard_fuzzer -DSTANDALONE ../../src/.libs/libproj.a -lpthread + $ g++ -g -std=c++11 standard_fuzzer.cpp -o standard_fuzzer -DSTANDALONE ../../src/.libs/libproj.a -lpthread -I../../src Run it: $ PROJ_LIB=../../nad ./standard_fuzzer {file_generated_by_oss_fuzz} diff --git a/test/fuzzers/standard_fuzzer.cpp b/test/fuzzers/standard_fuzzer.cpp index 73c7827a..be90b80a 100644 --- a/test/fuzzers/standard_fuzzer.cpp +++ b/test/fuzzers/standard_fuzzer.cpp @@ -38,7 +38,7 @@ #include "proj_api.h" /* Standalone build: -g++ -g -std=c++11 standard_fuzzer.cpp -o standard_fuzzer -DSTANDALONE ../../src/.libs/libproj.a -lpthread +g++ -g -std=c++11 standard_fuzzer.cpp -o standard_fuzzer -DSTANDALONE ../../src/.libs/libproj.a -lpthread -I../../src */ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv); |
