Expand SPHLite particle state consistency tests

This commit is contained in:
Codex
2026-07-02 23:01:42 +08:00
parent 576a5c09c7
commit 9d1cf2668f
7 changed files with 114 additions and 23 deletions
+22
View File
@@ -63,6 +63,7 @@ program test_input
call check_bad_input('tests/data/missing_section_011.inp')
call check_bad_input('tests/data/missing_time_control_011.inp')
call check_bad_input('tests/data/water_missing_density_021.inp')
call check_repeat_read_replaces_model()
call check_input_fails('tests/data/water_section_unknown_material_021.inp')
call check_input_fails('tests/data/water_missing_eos_type_021.inp')
call check_input_fails('tests/data/water_missing_eos_material_021.inp')
@@ -106,6 +107,27 @@ contains
end if
end subroutine check_good_input
subroutine check_repeat_read_replaces_model()
call sph_initialize(ierr)
call assert_ok(ierr, 'initialize failed for repeat read')
call sph_read_inp('tests/data/water_minimal_021.inp', ierr)
call assert_ok(ierr, 'first repeat read failed')
call sph_build_model(ierr)
call assert_ok(ierr, 'first repeat build failed')
call sph_get_particle_count(count, ierr)
call assert_ok(ierr, 'first repeat count failed')
if (count /= 4) call fail('first repeat count mismatch')
call sph_read_inp('tests/data/water_eos_no_p0_021.inp', ierr)
call assert_ok(ierr, 'second repeat read failed')
call sph_build_model(ierr)
call assert_ok(ierr, 'second repeat build failed')
call sph_get_particle_count(count, ierr)
call assert_ok(ierr, 'second repeat count failed')
if (count /= 1) call fail('repeat read did not replace model')
call sph_finalize(ierr)
call assert_ok(ierr, 'finalize failed after repeat read')
end subroutine check_repeat_read_replaces_model
subroutine check_first_phase(filename, expected_phase)
character(len=*), intent(in) :: filename
integer, intent(in) :: expected_phase