File: test-assert-subroutine-normal-termination.F90

package info (click to toggle)
fortran-assert 3.1.0-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 212 kB
  • sloc: f90: 305; ansic: 41; makefile: 9; sh: 4
file content (30 lines) | stat: -rw-r--r-- 771 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "assert_features.h"

program test_assert_subroutine_normal_termination
  !! Test direct calls to the "assert" subroutine that don't error-terminate
  use assert_m, only : assert
  implicit none

#if ASSERT_MULTI_IMAGE
  if (this_image()==1) then
#endif
    print *, new_line(''), "The assert subroutine"
#if ASSERT_MULTI_IMAGE
  end if
  sync all
#endif

  call assert(assertion = .true., description = "2 keyword arguments")
  call assert(            .true., description = "1 keyword arguments")
  call assert(            .true.,               "0 keyword arguments")

#if ASSERT_MULTI_IMAGE
  sync all
  if (this_image()==1) then
#endif
    print *,"  passes on not error-terminating when assertion=.true."
#if ASSERT_MULTI_IMAGE
  end if
#endif
  
end program