Skip to content

Commit a914fc5

Browse files
author
Damian Rouson
committed
refac(all): append _t to all derived type names
1 parent 504b3a9 commit a914fc5

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

src/assertions_implementation.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
module procedure assert
1313
use iso_fortran_env, only : error_unit
1414
use string_functions_interface, only : string
15-
use object_interface, only : object
15+
use object_interface, only : object_t
1616

1717
character(len=:), allocatable :: header, trailer
1818
integer, parameter :: max_this_image_digits=9
@@ -41,7 +41,7 @@
4141
trailer = prefix // diagnostic_data
4242
type is(integer)
4343
trailer = prefix // string(diagnostic_data)
44-
class is(object)
44+
class is(object_t)
4545
trailer = repeat(" ", ncopies = max_data_length)
4646
write(trailer,*) diagnostic_data
4747
class default

src/object_interface.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ module object_interface
1010
implicit none
1111

1212
private
13-
public :: object
13+
public :: object_t
1414

15-
type, abstract :: object
15+
type, abstract :: object_t
1616
!! author: Damian Rouson, GSE LLC
1717
!! category: Morfeus-FD
1818
!! summary: Abstract type to ensure all objects extending it implement the required methods
@@ -35,23 +35,23 @@ module object_interface
3535
pure module subroutine mark_as_defined(this)
3636
!! Mark the object as user-defined
3737
implicit none
38-
class(object), intent(inout) :: this
38+
class(object_t), intent(inout) :: this
3939
end subroutine
4040

4141
pure module function user_defined(this) result(is_defined)
4242
!! Return a boolean result indicating whether this object has been initialized since its declaration
4343
implicit none
44-
class(object), intent(in) :: this
44+
class(object_t), intent(in) :: this
4545
logical :: is_defined
4646
end function
4747

4848
end interface
4949

5050
abstract interface
5151
subroutine write_interface(self, unit, iotype, v_list, iostat, iomsg)
52-
import object
52+
import object_t
5353
implicit none
54-
class(object), intent(in) :: self
54+
class(object_t), intent(in) :: self
5555
integer, intent(in) :: unit
5656
character(*), intent(in) :: iotype
5757
integer, intent(in) :: v_list(:)

src/oracle_implementation.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
contains
66

77
module procedure within_tolerance
8-
class(oracle), allocatable :: error
8+
class(oracle_t), allocatable :: error
99

1010
error = this - reference
1111
in_tolerance = (error%norm() <= tolerance)

src/oracle_interface.f90

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module oracle_interface
22
!! verify actual output against expected
3-
use object_interface, only : object
3+
use object_interface, only : object_t
44
implicit none
55

66
private
7-
public :: oracle
7+
public :: oracle_t
88

9-
type, abstract, extends(object) :: oracle
9+
type, abstract, extends(object_t) :: oracle_t
1010
!! define procedures for testing output values against expected values
1111
contains
1212
procedure(subtract_interface), deferred :: subtract
@@ -19,17 +19,17 @@ module oracle_interface
1919

2020
function subtract_interface(this, rhs) result(difference)
2121
!! result has components corresponding to subtracting rhs's components fron this object's components
22-
import oracle
22+
import oracle_t
2323
implicit none
24-
class(oracle), intent(in) :: this, rhs
25-
class(oracle), allocatable :: difference
24+
class(oracle_t), intent(in) :: this, rhs
25+
class(oracle_t), allocatable :: difference
2626
end function
2727

2828
pure function norm_interface(this) result(norm_of_this)
2929
!! result is a norm of the array formed by concatenating the real components of this object
30-
import oracle
30+
import oracle_t
3131
implicit none
32-
class(oracle), intent(in) :: this
32+
class(oracle_t), intent(in) :: this
3333
real norm_of_this
3434
end function
3535

@@ -42,7 +42,7 @@ module function within_tolerance(this, reference, tolerance) result(in_tolerance
4242
!! (impure because of internal call to 'subtract' binding)
4343
!! The existence of this procedure eliminates the need to rewrite similar code for every oracle child type.
4444
implicit none
45-
class(oracle), intent(in) :: this, reference
45+
class(oracle_t), intent(in) :: this, reference
4646
real, intent(in) :: tolerance
4747
logical in_tolerance
4848
end function

tests/object_interface_test.f90

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ module object_interface_test
55
use vegetables, only: &
66
result_t, input_t, integer_input_t, test_item_t, & ! types
77
describe, it, assert_equals, assert_that, assert_not ! functions
8-
use object_interface, only : object
8+
use object_interface, only : object_t
99
implicit none
1010

1111
private
1212
public :: test_object
1313

14-
type, extends(object) :: subject
14+
type, extends(object_t) :: subject
1515
contains
1616
procedure write_formatted
1717
end type
@@ -33,23 +33,23 @@ function test_object() result(tests)
3333

3434
function check_default_initialization() result(result_)
3535
!! Verify that user_defined() is .false. for a default-initialied object
36-
class(object), allocatable :: object_
36+
class(object_t), allocatable :: object
3737
type(result_t) result_
3838

39-
allocate(subject :: object_)
39+
allocate(subject :: object)
4040

41-
result_ = assert_not(object_%user_defined())
41+
result_ = assert_not(object%user_defined())
4242
end function
4343

4444
function check_mark_as_defined() result(result_)
4545
!! Verify that mark_as_defined results in user_defined() being .true.
46-
class(object), allocatable :: object_
46+
class(object_t), allocatable :: object
4747
type(result_t) result_
4848

49-
allocate(subject :: object_)
49+
allocate(subject :: object)
5050

51-
call object_%mark_as_defined
52-
result_ = assert_that(object_%user_defined())
51+
call object%mark_as_defined
52+
result_ = assert_that(object%user_defined())
5353
end function
5454

5555
subroutine write_formatted(self, unit, iotype, v_list, iostat, iomsg)

0 commit comments

Comments
 (0)