Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
elpa
elpa
Commits
4de50074
Commit
4de50074
authored
Mar 30, 2017
by
Lorenz Huedepohl
Browse files
Improve crazy assert macro
parent
6a8f926a
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/Fortran/test_new_interface.F90
View file @
4de50074
...
...
@@ -42,14 +42,33 @@
!
#include "config-f90.h"
#define assert(x) if (.not.(x)) error stop "Assertion failed"
program
test_inteface
#define stringify_(x) "x"
#define stringify(x) stringify_(x)
#define assert(x) call x_assert(x, stringify(x), __FILE__, __LINE__)
module
assert
implicit
none
contains
subroutine
x_assert
(
condition
,
condition_string
,
file
,
line
)
use
elpa_utilities
,
only
:
error_unit
logical
,
intent
(
in
)
::
condition
character
(
len
=*
),
intent
(
in
)
::
condition_string
character
(
len
=*
),
intent
(
in
)
::
file
integer
,
intent
(
in
)
::
line
if
(
.not.
condition
)
then
write
(
error_unit
,
'(a,i0)'
)
"Assertion failed:"
//
condition_string
//
" at "
//
file
//
":"
,
line
end
if
end
subroutine
end
module
program
test_interface
use
precision
use
mod_setup_mpi
use
elpa_mpi
use
elpa_type
use
assert
implicit
none
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment