From f80e411bda5227dd49fdcb76e32014b8f060ebe4 Mon Sep 17 00:00:00 2001 From: Dan Bonachea Date: Mon, 13 Jan 2025 12:19:53 -0800 Subject: [PATCH] FIXUP: Expand teams test Correct a defect in `result_` aggregation that was wiping out earlier test results. Add a (redundant) initialization of `result_` for clarity. --- test/caf_teams_test.f90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/caf_teams_test.f90 b/test/caf_teams_test.f90 index a413297f..9a636d62 100644 --- a/test/caf_teams_test.f90 +++ b/test/caf_teams_test.f90 @@ -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 @@ -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") @@ -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")