Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding g2c_index test
Browse files Browse the repository at this point in the history
edwardhartnett committed Jan 15, 2024
1 parent 99018c8 commit f3da045
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/run_index_tests.sh
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ echo ""
echo "*** Running g2c_index test"

# Read GRIB1 index.
../utils/g2c_index -v data/ref_gdaswave_2.grib1.idx g2c_index_gdaswave_2.grib1.idx.txt
../utils/g2c_index -v data/gdaswave.t00z.wcoast.0p16.f000.grib2 gdaswave.t00z.wcoast.0p16.f000.grib2.idx

# Check against expected output.
#diff -w g2c_degrib2_gdaswave.t00z.wcoast.0p16.f000.grib2.degrib2 data/ref_gdaswave.degrib2.txt
20 changes: 10 additions & 10 deletions utils/g2c_index.c
Original file line number Diff line number Diff line change
@@ -30,8 +30,8 @@ main(int argc, char **argv)
int index;
int c;
int p = 0;
/* int g2cid; */
/* int ret; */
int g2cid;
int ret;

opterr = 0;

@@ -69,16 +69,16 @@ main(int argc, char **argv)
printf("g2c_index %s reading index file %s summarizing into %s.\n", G2C_VERSION, path[0], path[1]);

/* Open the GRIB2 file. */
/* if ((ret = g2c_open(path[0], G2C_NOWRITE, &g2cid))) */
/* return ret; */
if ((ret = g2c_open(path[0], G2C_NOWRITE, &g2cid)))
return ret;

/* /\* Write the degrib2 summary. *\/ */
/* if ((ret = g2c_degrib2(g2cid, path[1]))) */
/* return ret; */
/* Write the index file. */
if ((ret = g2c_write_index(g2cid, G2C_CLOBBER, path[1])))
return ret;

/* /\* Close the file. *\/ */
/* if ((ret = g2c_close(g2cid))) */
/* return ret; */
/* Close the file. */
if ((ret = g2c_close(g2cid)))
return ret;

/* Free memory. */
if (path[0])

0 comments on commit f3da045

Please sign in to comment.