Skip to content

Commit d66cee2

Browse files
committed
changed indentation, added empty line in .fypp file back, replaced compare with answer, improved test_math.f90
1 parent c3ae302 commit d66cee2

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

src/Makefile.manual

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ SRCFYPP =\
1919
stdlib_stats_moment_mask.fypp \
2020
stdlib_stats_moment_scalar.fypp \
2121
stdlib_stats_var.fypp \
22-
stdlib_math.fypp \
22+
stdlib_math.fypp \
2323
stdlib_stats_distribution_PRNG.fypp \
2424
stdlib_string_type.fypp
2525

src/stdlib_math.fypp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ contains
2525

2626
res = max(min(x, xmax), xmin)
2727
end function clip_${k1}$
28+
2829
#:endfor
2930
end module stdlib_math

src/tests/math/test_math.f90

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,52 @@ module test_math
99

1010
contains
1111

12-
subroutine test_clip_int8(x, xmin, xmax, compare)
13-
integer(int8), intent(in) :: x, xmin, xmax, compare
12+
subroutine test_clip_int8(x, xmin, xmax, answer)
13+
integer(int8), intent(in) :: x, xmin, xmax, answer
1414

15-
call check(clip(x, xmin, xmax) == compare)
15+
call check(clip(x, xmin, xmax) == answer, 'test_clip_int8 failed.', warn=.true.)
1616

1717
end subroutine test_clip_int8
1818

19-
subroutine test_clip_int16(x, xmin, xmax, compare)
20-
integer(int16), intent(in) :: x, xmin, xmax, compare
19+
subroutine test_clip_int16(x, xmin, xmax, answer)
20+
integer(int16), intent(in) :: x, xmin, xmax, answer
2121

22-
call check(clip(x, xmin, xmax) == compare)
22+
call check(clip(x, xmin, xmax) == answer, 'test_clip_int16 failed.', warn=.true.)
2323

2424
end subroutine test_clip_int16
2525

26-
subroutine test_clip_int32(x, xmin, xmax, compare)
27-
integer(int32), intent(in) :: x, xmin, xmax, compare
26+
subroutine test_clip_int32(x, xmin, xmax, answer)
27+
integer(int32), intent(in) :: x, xmin, xmax, answer
2828

29-
call check(clip(x, xmin, xmax) == compare)
29+
call check(clip(x, xmin, xmax) == answer, 'test_clip_int32 failed.', warn=.true.)
3030

3131
end subroutine test_clip_int32
3232

33-
subroutine test_clip_int64(x, xmin, xmax, compare)
34-
integer(int64), intent(in) :: x, xmin, xmax, compare
33+
subroutine test_clip_int64(x, xmin, xmax, answer)
34+
integer(int64), intent(in) :: x, xmin, xmax, answer
3535

36-
call check(clip(x, xmin, xmax) == compare)
36+
call check(clip(x, xmin, xmax) == answer, 'test_clip_int64 failed.', warn=.true.)
3737

3838
end subroutine test_clip_int64
3939

40-
subroutine test_clip_sp(x, xmin, xmax, compare)
41-
real(sp), intent(in) :: x, xmin, xmax, compare
40+
subroutine test_clip_sp(x, xmin, xmax, answer)
41+
real(sp), intent(in) :: x, xmin, xmax, answer
4242

43-
call check(clip(x, xmin, xmax) == compare)
43+
call check(clip(x, xmin, xmax) == answer, 'test_clip_sp failed.', warn=.true.)
4444

4545
end subroutine test_clip_sp
4646

47-
subroutine test_clip_dp(x, xmin, xmax, compare)
48-
real(dp), intent(in) :: x, xmin, xmax, compare
47+
subroutine test_clip_dp(x, xmin, xmax, answer)
48+
real(dp), intent(in) :: x, xmin, xmax, answer
4949

50-
call check(clip(x, xmin, xmax) == compare)
50+
call check(clip(x, xmin, xmax) == answer, 'test_clip_dp failed.', warn=.true.)
5151

5252
end subroutine test_clip_dp
5353

54-
subroutine test_clip_qp(x, xmin, xmax, compare)
55-
real(qp), intent(in) :: x, xmin, xmax, compare
54+
subroutine test_clip_qp(x, xmin, xmax, answer)
55+
real(qp), intent(in) :: x, xmin, xmax, answer
5656

57-
call check(clip(x, xmin, xmax) == compare)
57+
call check(clip(x, xmin, xmax) == answer, 'test_clip_qp failed.', warn=.true.)
5858

5959
end subroutine test_clip_qp
6060

0 commit comments

Comments
 (0)