summaryrefslogtreecommitdiff
path: root/Trivac/data/assertV.c2m
diff options
context:
space:
mode:
authorstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
committerstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
commit7dfcc480ba1e19bd3232349fc733caef94034292 (patch)
tree03ee104eb8846d5cc1a981d267687a729185d3f3 /Trivac/data/assertV.c2m
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Trivac/data/assertV.c2m')
-rwxr-xr-xTrivac/data/assertV.c2m32
1 files changed, 32 insertions, 0 deletions
diff --git a/Trivac/data/assertV.c2m b/Trivac/data/assertV.c2m
new file mode 100755
index 0000000..7b8ee3d
--- /dev/null
+++ b/Trivac/data/assertV.c2m
@@ -0,0 +1,32 @@
+*
+* Assert procedure for non-regression testing
+* Recover a value from a list of real arrays
+* Author: A. Hebert
+*
+PARAMETER LCMNAM :: ::: LINKED_LIST LCMNAM ; ;
+CHARACTER KEY ;
+INTEGER ISET IPOS ;
+REAL REFVALUE ;
+:: >>KEY<< >>ISET<< >>IPOS<< >>REFVALUE<< ;
+INTEGER ITYLCM ;
+REAL VALUE DELTA ;
+MODULE GREP: ABORT: END: ;
+*
+GREP: LCMNAM :: TYPE <<KEY>> >>ITYLCM<< ;
+IF ITYLCM 10 = THEN
+ GREP: LCMNAM :: STEP UP <<KEY>> GETVAL <<ISET>> <<IPOS>> >>VALUE<< ;
+ELSE
+ PRINT "assertV: 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: ;