commit 2f9261a5cb11c26faa9ed069d35e10f95c4e49d3
parent 055c2e753c48994b92ef0f847fbeb2e4635ebe42
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 13 Jul 2018 09:17:32 +0200
Test the "clamp to border" of the fetch functions
Diffstat:
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/test_htmie_load.c b/src/test_htmie_load.c
@@ -44,6 +44,19 @@ test_fetch(struct htmie* htmie)
scatt = htmie_get_xsections_scattering(htmie);
absor = htmie_get_xsections_absorption(htmie);
+ /* Test clamp to border */
+ CHK(absor[0] == htmie_fetch_xsection_absorption(htmie, wlens[0]-1, NEAREST));
+ CHK(scatt[0] == htmie_fetch_xsection_scattering(htmie, wlens[0]-1, NEAREST));
+ CHK(absor[0] == htmie_fetch_xsection_absorption(htmie, wlens[0]-1, LINEAR));
+ CHK(scatt[0] == htmie_fetch_xsection_scattering(htmie, wlens[0]-1, LINEAR));
+
+ i = nwlens - 1;
+ CHK(absor[i] == htmie_fetch_xsection_absorption(htmie, wlens[i]+1, NEAREST));
+ CHK(scatt[i] == htmie_fetch_xsection_scattering(htmie, wlens[i]+1, NEAREST));
+ CHK(absor[i] == htmie_fetch_xsection_absorption(htmie, wlens[i]+1, LINEAR));
+ CHK(scatt[i] == htmie_fetch_xsection_scattering(htmie, wlens[i]+1, LINEAR));
+
+
FOR_EACH(i, 0, nwlens-1) {
CHK(absor[i+0] == htmie_fetch_xsection_absorption(htmie, wlens[i+0], NEAREST));
CHK(absor[i+1] == htmie_fetch_xsection_absorption(htmie, wlens[i+1], NEAREST));