From db35b102ed3c3597fc3588a7d589dce7538800d2 Mon Sep 17 00:00:00 2001 From: q-posev Date: Tue, 19 Oct 2021 10:22:08 +0200 Subject: [PATCH] fix tests broken due to new dimension of basis_nucleus_index --- tests/io_dset_int_hdf5.c | 4 ++-- tests/io_dset_int_text.c | 4 ++-- tests/test_f.f90 | 14 +++++++++----- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/io_dset_int_hdf5.c b/tests/io_dset_int_hdf5.c index 49ff5bb..fa5703c 100644 --- a/tests/io_dset_int_hdf5.c +++ b/tests/io_dset_int_hdf5.c @@ -25,7 +25,7 @@ static int test_write_dset (const char* file_name, const back_end_t backend) { assert (file != NULL); // write numerical attribute in an empty file - rc = trexio_write_nucleus_num(file, num); + rc = trexio_write_basis_num(file, num); assert (rc == TREXIO_SUCCESS); // write numerical (integer) dataset in a file @@ -91,7 +91,7 @@ static int test_read_dset (const char* file_name, const back_end_t backend) { assert (file != NULL); // read numerical attribute from the file - rc = trexio_read_nucleus_num(file, &num); + rc = trexio_read_basis_num(file, &num); assert (rc == TREXIO_SUCCESS); assert (num == 12); diff --git a/tests/io_dset_int_text.c b/tests/io_dset_int_text.c index ca6ded2..6026afe 100644 --- a/tests/io_dset_int_text.c +++ b/tests/io_dset_int_text.c @@ -25,7 +25,7 @@ static int test_write_dset (const char* file_name, const back_end_t backend) { assert (file != NULL); // write numerical attribute in an empty file - rc = trexio_write_nucleus_num(file, num); + rc = trexio_write_basis_num(file, num); assert (rc == TREXIO_SUCCESS); // write numerical (integer) dataset in a file @@ -91,7 +91,7 @@ static int test_read_dset (const char* file_name, const back_end_t backend) { assert (file != NULL); // read numerical attribute from the file - rc = trexio_read_nucleus_num(file, &num); + rc = trexio_read_basis_num(file, &num); assert (rc == TREXIO_SUCCESS); assert (num == 12); diff --git a/tests/test_f.f90 b/tests/test_f.f90 index 0390756..59027b9 100644 --- a/tests/test_f.f90 +++ b/tests/test_f.f90 @@ -44,9 +44,9 @@ subroutine test_write(file_name, back_end) integer :: rc = 1 - integer :: num + integer :: num, basis_num - integer :: basis_nucleus_index(12) + integer :: basis_nucleus_index(24) double precision :: charge(12) double precision :: coord(3,12) @@ -70,7 +70,8 @@ subroutine test_write(file_name, back_end) 0.00000000d0, 2.47304151d0 , 0.00000000d0 /), & shape(coord) ) - basis_nucleus_index = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 /) + basis_num = 24 + basis_nucleus_index = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 /) label = [character(len=8) :: 'C', 'Na','C', 'C 66', 'C','C', 'H 99', 'Ru', 'H', 'H', 'H', 'H' ] @@ -104,6 +105,8 @@ subroutine test_write(file_name, back_end) deallocate(sym_str) call trexio_assert(rc, TREXIO_SUCCESS, 'SUCCESS WRITE POINT GROUP') + rc = trexio_write_basis_num(trex_file, basis_num) + call trexio_assert(rc, TREXIO_SUCCESS, 'SUCCESS WRITE BASIS NUM') rc = trexio_write_basis_nucleus_index(trex_file, basis_nucleus_index) call trexio_assert(rc, TREXIO_SUCCESS, 'SUCCESS WRITE INDEX') @@ -137,9 +140,9 @@ subroutine test_read(file_name, back_end) integer :: i, j, k, ind, offset, flag integer :: rc = 1 - integer :: num, num_read + integer :: num, num_read, basis_num - integer :: basis_nucleus_index(12) + integer :: basis_nucleus_index(24) double precision :: charge(12) double precision :: coord(3,12) @@ -152,6 +155,7 @@ subroutine test_read(file_name, back_end) character*(128) :: str num = 12 + basis_num = 24 ! ================= START OF TEST ===================== !