Skip to content

Commit

Permalink
More fixes to testing error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Aug 3, 2024
1 parent 588586b commit 72d4763
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/src/test-errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,17 @@ static int test_radec_planet() {
}

static int test_mean_star() {
extern int novas_inv_max_iter;
double x, y;
int n = 0;

if(check("mean_star:ira", -1, mean_star(0.0, 0.0, 0.0, NOVAS_FULL_ACCURACY, NULL, &y))) n++;
if(check("mean_star:idec", -1, mean_star(0.0, 0.0, 0.0, NOVAS_FULL_ACCURACY, &x, NULL))) n++;

novas_inv_max_iter = 0;
if(check("mean_star:converge", 1, mean_star(NOVAS_JD_J2000, 0.0, 0.0, NOVAS_REDUCED_ACCURACY, &x, &y))) n++;
else if(check("mean_star:converge:errno", ECANCELED, errno)) n++;
novas_inv_max_iter = 100;

return n;
}
Expand Down Expand Up @@ -685,14 +688,14 @@ static int test_cio_array() {
if(check("cio_array:bin:header", -1, cio_array(2341952.6, 2, x))) n++;

set_cio_locator_file("bad-cio-data/bad-2.bin");
if(check("cio_array:bin:incomplete", -1, cio_array(2341952.6, 2, x))) n++;
if(check("cio_array:bin:incomplete", 6, cio_array(2341951.4, 2, x))) n++;
if(check("cio_array:bin:seek", -1, cio_array(2341965.4, 2, x))) n++;

set_cio_locator_file("bad-cio-data/bad-1.txt");
if(check("cio_array:ascii:header", -1, cio_array(2341952.6, 2, x))) n++;

set_cio_locator_file("bad-cio-data/bad-2.txt");
if(check("cio_array:ascii:incomplete", 6, cio_array(2341952.6, 2, x))) n++;
if(check("cio_array:ascii:incomplete", 6, cio_array(2341951.4, 2, x))) n++;
if(check("cio_array:ascii:seek", 2, cio_array(2341965.4, 2, x))) n++;

set_cio_locator_file("bad-cio-data/bad-3.txt");
Expand Down

0 comments on commit 72d4763

Please sign in to comment.