Skip to content

Commit

Permalink
Add test for novas_set_errno message
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Feb 26, 2024
1 parent dca2a17 commit c5a2196
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/novas.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ static enum novas_debug_mode novas_debug_state = 0;
///< Opened CIO locator data file, or NULL.
static FILE *cio_file;



/// function to use for reading ephemeris data for all types of solar system sources
static novas_ephem_provider readeph2_call = NULL;

Expand Down
3 changes: 3 additions & 0 deletions test/src/test-errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,12 @@ static int test_refract() {
on_surface o;
int n = 0;

novas_debug(NOVAS_DEBUG_ON);
fprintf(stderr, ">>> Expecting error message...");
errno = 0;
double r = refract(NULL, NOVAS_STANDARD_ATMOSPHERE, 30.0);
if(check("refract:loc", 1, r == 0.0 && errno == EINVAL)) n++;
novas_debug(NOVAS_DEBUG_OFF);

errno = 0;
r = refract(&o, -1, 30.0);
Expand Down

0 comments on commit c5a2196

Please sign in to comment.