MONC
Functions/Subroutines
test_logging_mod Module Reference

Functions/Subroutines

subroutine test_logging_level
 
subroutine test_logging_preamble ()
 
character(len=15) function str (k)
 

Function/Subroutine Documentation

◆ str()

character(len=15) function test_logging_mod::str ( integer, intent(in)  k)

Definition at line 57 of file test_logging.F90.

57  integer, intent(in) :: k
58  write (str, *) k
59  str = adjustl(str)
Here is the caller graph for this function:

◆ test_logging_level()

subroutine test_logging_mod::test_logging_level ( )

Definition at line 15 of file test_logging.F90.

15  character(len=30) :: outpt
16 
17  integer i, j, space
18 
19  do i=1,4
20  call log_set_logging_level(i)
21  call assert_equals(i, log_get_logging_level(), "Logging level has been set correctly")
22  do j=1,4
23  call log_log(j, str(j)//" level", outpt)
24  if (j .le. i) then
25  space = index(outpt, "] ")
26  call assert_true(space .gt. 0, "The logging_mod message terminates")
27  outpt = outpt(space+2 : len(outpt))
28  call assert_equals(str(j)//" level", outpt, &
29  "Message included for specific logging_mod level")
30  else
31  call assert_not_equals(str(j)//" level", outpt, &
32  "Message ignored for specific logging_mod level")
33  end if
34  end do
35  end do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_logging_preamble()

subroutine test_logging_mod::test_logging_preamble ( )

Definition at line 40 of file test_logging.F90.

40  character(len=7) :: preamble
41 
42  preamble = get_logging_preamble(log_error)
43  call assert_equals(error_preamble, preamble)
44 
45  preamble = get_logging_preamble(log_warn)
46  call assert_equals(warn_preamble, preamble)
47 
48  preamble = get_logging_preamble(log_info)
49  call assert_equals(info_preamble, preamble)
50 
51  preamble = get_logging_preamble(log_debug)
52  call assert_equals(debug_preamble, preamble)
Here is the call graph for this function:
Here is the caller graph for this function: