Skip to content

Commit

Permalink
FIXUP: Expand teams test
Browse files Browse the repository at this point in the history
Correct a defect in `result_` aggregation that was wiping out earlier
test results.

Add a (redundant) initialization of `result_` for clarity.
  • Loading branch information
bonachea committed Jan 13, 2025
1 parent 5b332d0 commit f80e411
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/caf_teams_test.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module caf_teams_test
use iso_c_binding, only: c_size_t, c_ptr, c_null_funptr, c_int64_t, c_int
use prif
use veggies, only: result_t, test_item_t, assert_equals, assert_that, describe, it, succeed
use veggies, only: result_t, test_item_t, assert_equals, assert_that, describe, it, succeed, fail

implicit none
private
Expand Down Expand Up @@ -29,6 +29,8 @@ function check_teams() result(result_)
type(c_ptr) :: allocated_memory
type(prif_team_type) :: team, initial_team, t

result_ = succeed("")

call prif_num_images(num_images=initial_num_imgs)
result_ = result_ .and. &
assert_that(initial_num_imgs > 0, "prif_num_images is valid")
Expand Down Expand Up @@ -81,7 +83,8 @@ function check_teams() result(result_)
call prif_form_team(team_number = which_team, team = team)
call prif_change_team(team)
call prif_num_images(num_images=num_imgs)
result_ = assert_equals( &
result_ = result_ .and. &
assert_equals( &
initial_num_imgs/2 + mod(initial_num_imgs,2)*(int(which_team)-1), &
num_imgs, &
"Team has correct number of images")
Expand Down

0 comments on commit f80e411

Please sign in to comment.