unit_test_msg(3f) - [M_framework__verify] converts up to twenty standard scalar values to a message for unit testing (LICENSE:PD)
Synopsis
Description
Options
Examples
Author
License
function unit_test_msg(name, msg, & & g1,g2,g3,g4,g5,g6,g7,g8,g9,ga,gb,gc,gd,ge,gf,gg,gh,gi,gj,if)
character(len=*),intent(in) :: name class(*),intent(in),optional :: msg, & & g1,g2,g3,g4,g5,g6,g7,g8,g9,ga,gb,gc,gd,ge,gf,gg,gh,gi,gj
unit_test_msg(3f) builds a string from up to twenty scalar values and prints it to the error log.
name name of unit being tested msg,g[1-j] optional values to print the value of. May be of type INTEGER, LOGICAL, REAL, DOUBLEPRECISION, COMPLEX, or CHARACTER. if expression must be true or message is not output. Must be specified by keyword as "if=expression".
Sample program:
program demo_unit_test_msg use M_framework, only : unit_test_start,unit_test_msg, & & unit_test_end implicit nonecall unit_test_start(’myroutine’) call unit_test_msg(’myroutine’,’HUGE(3f) integers’, & & huge(0),’and real’,huge(0.0),’and double’,huge(0.0d0)) call unit_test_msg(’myroutine’,’real :’, & & huge(0.0),0.0,12345.6789,tiny(0.0) ) call unit_test_msg(’myroutine’,’doubleprecision :’, & & huge(0.0d0),0.0d0,12345.6789d0,tiny(0.0d0) ) call unit_test_msg(’myroutine’,’complex :’, & & cmplx(huge(0.0),tiny(0.0)) ) call unit_test_end(’myroutine’)
end program demo_unit_test_msg
John S. Urban
Public Domain
Nemo Release 3.1 | unit_test_msg (3) | February 23, 2025 |