star-hitran

Load line-by-line data from the HITRAN database
git clone git://git.meso-star.fr/star-hitran.git
Log | Files | Refs | README | LICENSE

commit a9446f04fcf7628fc1cf97e49d03d56316e1bf5f
parent a3ae18681deb6bf9b9a6f957a2ce57bf6b7cc1dd
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed,  9 Feb 2022 22:14:06 +0100

Test the loading of a submitted file

Diffstat:
Msrc/test_shitran_isotope_metadata.c | 16+++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/test_shitran_isotope_metadata.c b/src/test_shitran_isotope_metadata.c @@ -335,11 +335,22 @@ test_load_failures(struct shitran* shitran) CHK(fclose(fp) == 0); } +static void +test_load_file(struct shitran* shitran, const char* path) +{ + struct shitran_isotope_metadata* mdata = NULL; + CHK(path); + printf("Loading `%s'.\n", path); + CHK(shitran_isotope_metadata_load(shitran, path, &mdata) == RES_OK); + CHK(shitran_isotope_metadata_ref_put(mdata) == RES_OK); +} + int main(int argc, char** argv) { - struct shitran* shitran = NULL; struct shitran_create_args args = SHITRAN_CREATE_ARGS_DEFAULT; + struct shitran* shitran = NULL; + int i; (void)argc, (void)argv; args.verbose = 1; @@ -347,6 +358,9 @@ main(int argc, char** argv) test_load(shitran); test_load_failures(shitran); + FOR_EACH(i, 1, argc) { + test_load_file(shitran, argv[i]); + } CHK(shitran_ref_put(shitran) == RES_OK); CHK(mem_allocated_size() == 0);