Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
elpa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
elpa
elpa
Commits
75a3bcfd
Commit
75a3bcfd
authored
Jul 20, 2017
by
Pavel Kus
Committed by
Lorenz Huedepohl
Jul 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
separated assert implementation and #defines
and moved the implementation to test_util.F90
parent
6500ebe7
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
41 deletions
+41
-41
test/Fortran/assert.h
test/Fortran/assert.h
+0
-40
test/shared/test_analytic.F90
test/shared/test_analytic.F90
+1
-1
test/shared/test_util.F90
test/shared/test_util.F90
+40
-0
No files found.
test/Fortran/assert.h
View file @
75a3bcfd
subroutine
x_a
(
condition
,
condition_string
,
file
,
line
)
#ifdef HAVE_ISO_FORTRAN_ENV
use
iso_fortran_env
,
only
:
error_unit
#endif
implicit
none
#ifndef HAVE_ISO_FORTRAN_ENV
integer
,
parameter
::
error_unit
=
0
#endif
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 `"
// condition_string // "` failed at " // file // ":", line
stop
1
end
if
end
subroutine
subroutine
x_ao
(
error_code
,
error_code_string
,
file
,
line
)
use
elpa
#ifdef HAVE_ISO_FORTRAN_ENV
use
iso_fortran_env
,
only
:
error_unit
#endif
implicit
none
#ifndef HAVE_ISO_FORTRAN_ENV
integer
,
parameter
::
error_unit
=
0
#endif
integer
,
intent
(
in
)
::
error_code
character
(
len
=*
),
intent
(
in
)
::
error_code_string
character
(
len
=*
),
intent
(
in
)
::
file
integer
,
intent
(
in
)
::
line
if
(
error_code
/=
ELPA_OK
)
then
write
(
error_unit
,
'
(
a
,
i0
)
'
)
"Assertion failed: `"
// error_code_string // &
" is "
// elpa_strerr(error_code) // "` at " // file // ":", line
stop
1
end
if
end
subroutine
#define stringify_(x) "x"
#define stringify(x) stringify_(x)
#define assert(x) call x_a(x, stringify(x), "F", __LINE__)
...
...
test/shared/test_analytic.F90
View file @
75a3bcfd
...
...
@@ -41,7 +41,7 @@
! any derivatives of ELPA under the same license that we chose for
! the original distribution, the GNU Lesser General Public License.
!#include "assert.h" ! why complains?
#include "../Fortran/assert.h"
#include "config-f90.h"
module
test_analytic
...
...
test/shared/test_util.F90
View file @
75a3bcfd
...
...
@@ -99,4 +99,44 @@ module test_util
s
=
real
(
ticks
,
kind
=
c_double
)
/
tick_rate
end
function
subroutine
x_a
(
condition
,
condition_string
,
file
,
line
)
#ifdef HAVE_ISO_FORTRAN_ENV
use
iso_fortran_env
,
only
:
error_unit
#endif
implicit
none
#ifndef HAVE_ISO_FORTRAN_ENV
integer
,
parameter
::
error_unit
=
0
#endif
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 `"
//
condition_string
//
"` failed at "
//
file
//
":"
,
line
stop
1
end
if
end
subroutine
subroutine
x_ao
(
error_code
,
error_code_string
,
file
,
line
)
use
elpa
#ifdef HAVE_ISO_FORTRAN_ENV
use
iso_fortran_env
,
only
:
error_unit
#endif
implicit
none
#ifndef HAVE_ISO_FORTRAN_ENV
integer
,
parameter
::
error_unit
=
0
#endif
integer
,
intent
(
in
)
::
error_code
character
(
len
=*
),
intent
(
in
)
::
error_code_string
character
(
len
=*
),
intent
(
in
)
::
file
integer
,
intent
(
in
)
::
line
if
(
error_code
/
=
ELPA_OK
)
then
write
(
error_unit
,
'(a,i0)'
)
"Assertion failed: `"
//
error_code_string
//
&
" is "
//
elpa_strerr
(
error_code
)
//
"` at "
//
file
//
":"
,
line
stop
1
end
if
end
subroutine
end
module
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