Skip to content

Commit

Permalink
add test following issue fortran-lang#726
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdp1 committed Jul 8, 2023
1 parent de2dbbb commit 96763e1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/bitsets/test_stdlib_bitset_large.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ subroutine collect_stdlib_bitset_large(testsuite)
new_unittest("string-operations", test_string_operations), &
new_unittest("io", test_io), &
new_unittest("initialization", test_initialization), &
new_unittest("bitset-assignment-array", test_assignment_array), &
new_unittest("bitset-inquiry", test_bitset_inquiry), &
new_unittest("bit-operations", test_bit_operations), &
new_unittest("bitset-comparisons", test_bitset_comparisons), &
Expand Down Expand Up @@ -558,6 +559,36 @@ subroutine test_initialization(error)

end subroutine test_initialization

subroutine test_assignment_array(error)
!> Error handling
type(error_type), allocatable, intent(out) :: error

logical(int8) :: log1(64) = .true.

integer :: i
type(bitset_large) :: set1(0:4)

do i = 0, size(set1) - 1
set1(i) = log1
enddo

do i = 0, size(set1) - 1
call check(error, set1(i) % bits(), 64, &
' initialization with logical(int8) failed to set' // &
' the right size in a bitset array.')
if (allocated(error)) return
enddo

!Test added following issue https://github.com/fortran-lang/stdlib/issues/726
set1(0) = set1(0)

call check(error, set1(0) % bits(), 64, &
' initialization from bitset_large failed to set' // &
' the right size in a bitset array.')
if (allocated(error)) return

end subroutine test_assignment_array

subroutine test_bitset_inquiry(error)
!> Error handling
type(error_type), allocatable, intent(out) :: error
Expand Down

0 comments on commit 96763e1

Please sign in to comment.