Skip to content

Commit 696eae3

Browse files
committed
Fix tests
1 parent 6baee40 commit 696eae3

2 files changed

Lines changed: 21 additions & 10 deletions

File tree

test/test_distribs_container.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ subroutine test_create(basis, success)
337337
[ basis_list(i)%spec(1)%name ], [ -9.027_real32 ] &
338338
)
339339
species_tmp = basis_list(i)%spec(j)%name(1:3)
340-
if(.not.allocated(elements)) then
340+
if(.not.allocated(elements).or.size(elements,1).eq.0) then
341341
elements = [ species_tmp ]
342342
cycle species_loop
343343
end if

test/test_generator.f90

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ function compare_bas(bas1, bas2) result(output)
308308
type(basis_type), intent(in) :: bas1, bas2
309309
logical :: output
310310

311-
integer :: is, ia
311+
integer :: is, ia, ja
312+
logical :: ltmp1
312313
output = .true.
313314

314315
! Compare the geometries
@@ -324,16 +325,26 @@ function compare_bas(bas1, bas2) result(output)
324325

325326
do is = 1, bas1%nspec
326327
do ia = 1, bas1%spec(is)%num
327-
if( &
328-
any( &
329-
abs( &
330-
bas1%spec(is)%atom(ia,:3) - &
331-
bas2%spec(is)%atom(ia,:3) &
332-
) .ge. 2._real32 * tolerance + 1.E-6_real32 &
333-
) &
334-
) then
328+
ltmp1 = .false.
329+
do ja = 1, bas2%spec(is)%num
330+
if( &
331+
all( &
332+
abs( &
333+
bas1%spec(is)%atom(ia,:3) - &
334+
bas2%spec(is)%atom(ja,:3) - &
335+
ceiling( &
336+
bas1%spec(is)%atom(ia,:3) - &
337+
bas2%spec(is)%atom(ja,:3) - &
338+
0.5_real32 &
339+
) &
340+
) .lt. 2._real32 * tolerance + 1.E-6_real32 &
341+
) &
342+
) ltmp1 = .true.
343+
end do
344+
if(.not. ltmp1) then
335345
write(0,*) 'Generator failed to produce expected atom: ', is, ia
336346
write(0,*) bas1%spec(is)%atom(ia,:3), bas2%spec(is)%atom(ia,:3)
347+
output = .false.
337348
end if
338349
end do
339350
end do

0 commit comments

Comments
 (0)