diff options
| author | stainer_t <thomas.stainer@oecd-nea.org> | 2025-09-08 13:48:49 +0200 |
|---|---|---|
| committer | stainer_t <thomas.stainer@oecd-nea.org> | 2025-09-08 13:48:49 +0200 |
| commit | 7dfcc480ba1e19bd3232349fc733caef94034292 (patch) | |
| tree | 03ee104eb8846d5cc1a981d267687a729185d3f3 /Trivac/data/assertS.c2m | |
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Trivac/data/assertS.c2m')
| -rwxr-xr-x | Trivac/data/assertS.c2m | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Trivac/data/assertS.c2m b/Trivac/data/assertS.c2m new file mode 100755 index 0000000..b5b6a58 --- /dev/null +++ b/Trivac/data/assertS.c2m @@ -0,0 +1,36 @@ +* +* Assert procedure for non-regression testing +* Recover a value from a real array +* Author: A. Hebert +* +PARAMETER LCMNAM :: ::: LINKED_LIST LCMNAM ; ; +CHARACTER KEY ; +INTEGER ISET IPOS ; +REAL REFVALUE ; +:: >>KEY<< >>IPOS<< >>REFVALUE<< ; +INTEGER ITYLCM ; +REAL VALUE DELTA ; +DOUBLE PRECISION DVALUE ; +MODULE GREP: ABORT: END: ; +* +GREP: LCMNAM :: TYPE <<KEY>> >>ITYLCM<< ; +IF ITYLCM 2 = THEN + GREP: LCMNAM :: GETVAL <<KEY>> <<IPOS>> >>VALUE<< ; +ELSEIF ITYLCM 4 = THEN + GREP: LCMNAM :: GETVAL <<KEY>> <<IPOS>> >>DVALUE<< ; + EVALUATE VALUE := DVALUE D_TO_R ; +ELSE + PRINT "assertS: INVALID TYPE=" ITYLCM ; + ABORT: ; +ENDIF ; +EVALUATE DELTA := VALUE REFVALUE - REFVALUE / ABS ; +IF DELTA 5.0E-5 < THEN + PRINT "TEST SUCCESSFUL; DELTA=" DELTA ; +ELSE + PRINT "------------" ; + PRINT "TEST FAILURE" ; + PRINT "------------" ; + PRINT "REFERENCE=" REFVALUE " CALCULATED=" VALUE ; + ABORT: ; +ENDIF ; +END: ; |
