@@ -167,6 +167,28 @@ static int test_refract() {
167
167
return n ;
168
168
}
169
169
170
+ static int test_refract_astro () {
171
+ on_surface surf = {};
172
+ int n = 0 ;
173
+
174
+ if (check_nan ("refract_astro:converge" , refract_astro (& surf , NOVAS_STANDARD_ATMOSPHERE , 85.0 ))) {
175
+ if (check ("refract_astro:converge:errno" , ECANCELED , errno )) n ++ ;
176
+ }
177
+
178
+ return n ;
179
+ }
180
+
181
+ static int test_inv_refract () {
182
+ on_surface surf = {};
183
+ int n = 0 ;
184
+
185
+ if (check_nan ("inv_refract:converge" , novas_inv_refract (novas_optical_refraction , NOVAS_JD_J2000 , & surf , NOVAS_REFRACT_OBSERVED , 5.0 ))) {
186
+ if (check ("inv_refract:converge:errno" , ECANCELED , errno )) n ++ ;
187
+ }
188
+
189
+ return n ;
190
+ }
191
+
170
192
static int test_limb_angle () {
171
193
double pos [3 ] = { 0.01 }, pn [3 ] = { -0.01 }, pz [3 ] = {}, a , b ;
172
194
int n = 0 ;
@@ -335,12 +357,16 @@ static int test_radec_planet() {
335
357
}
336
358
337
359
static int test_mean_star () {
338
- double x ;
360
+ double x , y ;
339
361
int n = 0 ;
340
362
341
- if (check ("mean_star:ira" , -1 , mean_star (0.0 , 0.0 , 0.0 , NOVAS_FULL_ACCURACY , NULL , & x ))) n ++ ;
363
+ if (check ("mean_star:ira" , -1 , mean_star (0.0 , 0.0 , 0.0 , NOVAS_FULL_ACCURACY , NULL , & y ))) n ++ ;
342
364
if (check ("mean_star:idec" , -1 , mean_star (0.0 , 0.0 , 0.0 , NOVAS_FULL_ACCURACY , & x , NULL ))) n ++ ;
343
365
366
+ if (check ("mean_star:converge" , 1 , mean_star (NOVAS_JD_J2000 , 0.0 , 0.0 , NOVAS_REDUCED_ACCURACY , & x , & y ))) {
367
+ if (check ("mean_star:converge:errno" , ECANCELED , errno )) n ++ ;
368
+ }
369
+
344
370
return n ;
345
371
}
346
372
@@ -903,6 +929,11 @@ static int test_grav_undo_planets() {
903
929
if (check ("grav_undo_planets:pl_pos=pl_vel" , -1 , grav_undo_planets (p , po , NOVAS_REDUCED_ACCURACY , pl_mask , pb , pb , out ))) n ++ ;
904
930
if (check ("grav_undo_planets:pos_src" , -1 , grav_undo_planets (p , po , NOVAS_REDUCED_ACCURACY , pl_mask , pb , vb , NULL ))) n ++ ;
905
931
932
+ pl_mask = 1 << NOVAS_SUN ;
933
+ if (check ("grav_undo_planets:converge" , -1 , grav_undo_planets (p , po , NOVAS_REDUCED_ACCURACY , pl_mask , pb , vb , out ))) {
934
+ if (check ("grav_undo_planets:converge:errno" , ECANCELED , errno )) n ++ ;
935
+ }
936
+
906
937
return n ;
907
938
}
908
939
@@ -1171,7 +1202,9 @@ static int test_app_to_geom() {
1171
1202
if (check ("app_to_geom:frame:init" , -1 , novas_app_to_geom (& frame , NOVAS_ICRS , 1.0 , 2.0 , 10.0 , pos ))) n ++ ;
1172
1203
1173
1204
novas_make_frame (NOVAS_REDUCED_ACCURACY , & obs , & ts , 0.0 , 0.0 , & frame );
1174
- if (check ("app_to_geom:frame:ok" , 0 , novas_app_to_geom (& frame , NOVAS_ICRS , 1.0 , 2.0 , 10.0 , pos ))) n ++ ;
1205
+ if (check ("app_to_geom:frame:converge" , -1 , novas_app_to_geom (& frame , NOVAS_ICRS , 1.0 , 2.0 , 10.0 , pos ))) {
1206
+ if (check ("app_to_geom:frame:converge:errno" , ECANCELED , errno )) n ++ ;
1207
+ }
1175
1208
1176
1209
if (check ("app_to_geom:pos" , -1 , novas_app_to_geom (& frame , NOVAS_ICRS , 1.0 , 2.0 , 10.0 , NULL ))) n ++ ;
1177
1210
if (check ("app_to_geom:sys:-1" , -1 , novas_app_to_geom (& frame , -1 , 1.0 , 2.0 , 10.0 , pos ))) n ++ ;
@@ -1336,6 +1369,8 @@ int main() {
1336
1369
if (test_transform_hip ()) n ++ ;
1337
1370
1338
1371
if (test_refract ()) n ++ ;
1372
+ if (test_refract_astro ()) n ++ ;
1373
+ if (test_inv_refract ()) n ++ ;
1339
1374
if (test_limb_angle ()) n ++ ;
1340
1375
1341
1376
if (test_ephemeris ()) n ++ ;
0 commit comments