Skip to content

Commit b2977a6

Browse files
committed
test/prif_init_test: Remove superfluous memoization on check_caffeination
Julienne guarantees that `test_fixture_t` elements in a `test_harness_t` are executed strictly in-order, so we don't need a hack to ensure proper initialization ordering.
1 parent 9415c42 commit b2977a6

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

test/julienne-driver.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ program test_suite_driver
1717
implicit none
1818

1919
associate(test_harness => test_harness_t([ &
20-
test_fixture_t( prif_init_test_t() ) &
20+
test_fixture_t( prif_init_test_t() ) & ! must come first
2121
,test_fixture_t( prif_num_images_test_t() ) &
2222
,test_fixture_t( prif_this_image_no_coarray_test_t() ) &
2323
,test_fixture_t( prif_image_queries_test_t() ) &

test/prif_init_test.F90

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,16 @@ function results() result(test_results)
3131

3232

3333
function check_caffeination() result(diag)
34-
! this test needs to run very early at startup, so we memoize the result
3534
type(test_diagnosis_t) :: diag
36-
type(test_diagnosis_t), save :: memo
37-
logical, save :: first_pass = .true.
38-
39-
if (first_pass) then
40-
first_pass = .false.
41-
write_memo: &
42-
block
4335
#if HAVE_MULTI_IMAGE
44-
integer, parameter :: successful_initiation = PRIF_STAT_ALREADY_INIT
36+
integer, parameter :: successful_initiation = PRIF_STAT_ALREADY_INIT
4537
#else
46-
integer, parameter :: successful_initiation = 0
38+
integer, parameter :: successful_initiation = 0
4739
#endif
48-
integer init_exit_code
49-
50-
call prif_init(init_exit_code)
51-
memo = init_exit_code .equalsExpected. successful_initiation
52-
end block write_memo
53-
endif
40+
integer init_exit_code
5441

55-
diag = memo
42+
call prif_init(init_exit_code)
43+
diag = init_exit_code .equalsExpected. successful_initiation
5644
end function
5745

5846
function check_subsequent_prif_init_call() result(diag)

0 commit comments

Comments
 (0)