Skip to content

Commit 7647c84

Browse files
committed
Add missing %release statements
Now all tests run through valgrind without any leaks
1 parent 1c2f467 commit 7647c84

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

test/test_random.F90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ subroutine test_uniform_int_distribution()
2525

2626
call uniform_int_distribution(5, 15, rng, arr)
2727
write(*,*) "Result:", arr
28+
call rng%release()
2829
end subroutine
2930

3031
!-----------------------------------------------------------------------------!
@@ -39,6 +40,7 @@ subroutine test_uniform_real_distribution()
3940

4041
call uniform_real_distribution(5.d0, 15.d0, rng, arr)
4142
write(*,*) "Result:", arr
43+
call rng%release()
4244
end subroutine
4345

4446
!-----------------------------------------------------------------------------!
@@ -58,6 +60,7 @@ subroutine test_normal_distribution()
5860
! Mean=1, sigma=1
5961
call normal_distribution(1.0d0, rng, arr)
6062
write(*,*) "Result:", arr
63+
call rng%release()
6164
end subroutine
6265

6366
!-----------------------------------------------------------------------------!

test/test_string.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ subroutine test_class()
6666
ASSERT(i == 5)
6767
i = s%find("woof")
6868
ASSERT(i == 0)
69+
call s%release()
6970
end subroutine
7071

7172
!-----------------------------------------------------------------------------!

test/test_vector.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ subroutine test_int4()
7272
ASSERT(element_ptr == -2)
7373
element_ptr = 1234
7474
ASSERT(v2%get(2) == 1234)
75-
75+
call v2%release()
7676
end subroutine
7777

7878
!-----------------------------------------------------------------------------!
@@ -96,6 +96,8 @@ subroutine test_string()
9696
call v%set_ref(4, v%get_ref(5))
9797
ASSERT(v%get(4) == "yours")
9898

99+
call sref%release()
100+
call v%release()
99101
end subroutine
100102

101103
!-----------------------------------------------------------------------------!

0 commit comments

Comments
 (0)