Skip to content

Commit 42d728f

Browse files
author
Damian Rouson
authored
Merge pull request #634 from sourceryinstitute/reduce-name-clashes
Reduce name clashes
2 parents ebc6f30 + e06de4b commit 42d728f

File tree

7 files changed

+15
-39
lines changed

7 files changed

+15
-39
lines changed

src/tests/unit/teams/get-communicator.f90

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
program main
3131
!! summary: Test get_commiunicator function, an OpenCoarrays-specific language extension
3232
use opencoarrays, only : get_communicator
33+
use oc_assertions_interface, only : assert
3334

3435
implicit none
3536

@@ -99,16 +100,4 @@ subroutine mpi_matches_caf(comm)
99100

100101
end subroutine
101102

102-
elemental subroutine assert(assertion,description)
103-
!! TODO: move this to a common place for all tests to use
104-
logical, intent(in) :: assertion
105-
character(len=*), intent(in) :: description
106-
integer, parameter :: max_digits=12
107-
character(len=max_digits) :: image_number
108-
if (.not.assertion) then
109-
write(image_number,*) this_image()
110-
error stop "Assertion '" // description // "' failed on image " // trim(image_number)
111-
end if
112-
end subroutine
113-
114103
end program

src/tests/unit/teams/team-number.f90

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
! BSD 3-Clause License
22
!
3-
! Copyright (c) 2018, Sourcery Institute
3+
! Copyright (c) 2018-2019, Sourcery Institute
44
! All rights reserved.
55
!
66
! Redistribution and use in source and binary forms, with or without
@@ -31,6 +31,7 @@ program main
3131
!! summary: Test team_number intrinsic function
3232
use iso_fortran_env, only : team_type
3333
use iso_c_binding, only : c_loc
34+
use oc_assertions_interface, only : assert
3435

3536
implicit none
3637

@@ -59,18 +60,4 @@ program main
5960
sync all
6061
if (this_image()==1) print *,"Test passed."
6162

62-
contains
63-
64-
elemental subroutine assert(assertion,description)
65-
!! TODO: move this to a common place for all tests to use
66-
logical, intent(in) :: assertion
67-
character(len=*), intent(in) :: description
68-
integer, parameter :: max_digits=12
69-
character(len=max_digits) :: image_number
70-
if (.not.assertion) then
71-
write(image_number,*) this_image()
72-
error stop "Assertion " // description // "failed on image " // trim(image_number)
73-
end if
74-
end subroutine
75-
7663
end program

src/tests/unit/teams/teams_subset.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ program teams_subset
33
!!
44
!! Regression test for prior potential deadlock in change team/end team
55
use iso_fortran_env, only : team_type
6-
use assertions_interface, only : assert
6+
use oc_assertions_interface, only : assert
77
implicit none
88

99
type(team_type) team

src/tests/utilities/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU" )
3232
endif()
3333

3434
add_library( oc_test_interfaces OBJECT
35-
object_interface.f90
36-
assertions_interface.F90
35+
opencoarrays_object_interface.f90
36+
oc_assertions_interface.F90
3737
)
3838
add_library( opencoarrays_test_utilities
39-
assertions_implementation.F90
39+
oc_assertions_implementation.F90
4040
$<TARGET_OBJECTS:oc_test_interfaces>
4141
)
4242
set_target_properties(opencoarrays_test_utilities

src/tests/utilities/assertions_implementation.F90 renamed to src/tests/utilities/oc_assertions_implementation.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
submodule(assertions_interface) assertions_implementation
1+
submodule(oc_assertions_interface) oc_assertions_implementation
22
!! Define the assert procedure
33

44
implicit none
@@ -29,7 +29,7 @@
2929

3030
pure subroutine set(msg)
3131

32-
use object_interface, only : object
32+
use opencoarrays_object_interface, only : object
3333
!! import abstract type with generic binding supporting user-defined derived type output
3434

3535
character(len=:), intent(out), allocatable :: msg
@@ -67,4 +67,4 @@ pure subroutine set(msg)
6767

6868
end procedure
6969

70-
end submodule
70+
end submodule oc_assertions_implementation

src/tests/utilities/assertions_interface.F90 renamed to src/tests/utilities/oc_assertions_interface.F90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef USE_ASSERTIONS
22
# define USE_ASSERTIONS .false.
33
#endif
4-
module assertions_interface
4+
module oc_assertions_interface
55
!! author: Damian Rouson
66
!!
77
!! Utility for runtime checking of logical assertions.
@@ -24,15 +24,15 @@ module assertions_interface
2424
!! ----------
2525
!! Pass the optional success argument & check for false return value as an indication of assertion failure:
2626
!!
27-
!! use assertions_interface, only : assert,assertions
27+
!! use opencoarrays_assertions_interface, only : assert, assertions
2828
!! if (assertions) call assert( 2 > 1, "always true inequality", success)
2929
!! if (error_code/=0) call my_error_handler()
3030
!!
3131
!! Use case 2
3232
!! ----------
3333
!! Error-terminate if the assertion fails:
3434
!!
35-
!! use assertions_interface, only : assert,assertions
35+
!! use opencoarrays_assertions_interface, only : assert,assertions
3636
!! if (assertions) call assert( 2 > 1, "always true inequality")
3737
!!
3838
implicit none
@@ -61,4 +61,4 @@ module subroutine assert(assertion,description,diagnostic_data,success,error_mes
6161
!! Optional informational message allocated only if assertion==.false. .and. present(success)
6262
end subroutine
6363
end interface
64-
end module
64+
end module oc_assertions_interface

src/tests/utilities/object_interface.f90 renamed to src/tests/utilities/opencoarrays_object_interface.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module object_interface
1+
module opencoarrays_object_interface
22
!! Object pattern abstract type to provide a universal interface to a userd-defined derived type ouptput
33
!! capability specified in a generic binding
44
implicit none

0 commit comments

Comments
 (0)