Skip to content

Commit

Permalink
Merge pull request #657 from busstoptaktik/selftest-removal-lm
Browse files Browse the repository at this point in the history
Remove selftests from projection files starting with l, m
  • Loading branch information
busstoptaktik committed Nov 12, 2017
2 parents 42e375f + 48e476b commit 3bfab73
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 1,039 deletions.
44 changes: 1 addition & 43 deletions src/PJ_labrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
59 changes: 1 addition & 58 deletions src/PJ_laea.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
30 changes: 1 addition & 29 deletions src/PJ_lagrng.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
30 changes: 1 addition & 29 deletions src/PJ_larr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
30 changes: 1 addition & 29 deletions src/PJ_lask.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
8 changes: 4 additions & 4 deletions src/PJ_latlong.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
44 changes: 1 addition & 43 deletions src/PJ_lcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
44 changes: 1 addition & 43 deletions src/PJ_lcca.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
44 changes: 1 addition & 43 deletions src/PJ_loxim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
Loading

0 comments on commit 3bfab73

Please sign in to comment.